• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Damage based on Damage Dealt

Status
Not open for further replies.
I'm working on a trigger that deals extra damage based on initial damage dealt. So if unit is dealt 10 damage when they have a specific buff then they are dealt an extra 2 damage (20%). The issue I'm having is finding a way to store the initial damage as an integer so I can do the damage calculation.

  • Critical Sector
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) has buff Critical Sector ) Equal to True
      • ((Attacking unit) is A ranged attacker) Equal to True
    • Actions
 
Level 5
Joined
Jun 30, 2004
Messages
170
Eeeh... Haven't used GUI in years; I don't know how to explain/do it without confusing you with Jass.

With what you're trying to do, the "Is Attacked" event will not work; you will need the specific unit event called "Unit takes damage". Events like this either need a preplaced unit or another event that will make the trigger for the unit after they are put on the map.

After that, you'll be able to find which unit took the damage, which unit dealt the damage, and the amount of damage the unit took.
 
Level 5
Joined
Jun 30, 2004
Messages
170
Eeeh... Haven't used GUI in years; I don't know how to explain/do it without confusing you with Jass.

With what you're trying to do, the "Is Attacked" event will not work; you will need the specific unit event called "Unit takes damage". Events like this either need a preplaced unit or another event that will make the trigger for the unit after they are put on the map.

After that, you'll be able to find which unit took the damage, which unit dealt the damage, and the amount of damage the unit took.
What I meant by that was that you need to trigger this part yourself. Any unit gets buff, create damage event for unit that got the buff.
 
Status
Not open for further replies.
Top