Get Damage taken from Attacking Unit

Aedes

Member
Reaction score
8
how do you get the damage you receive from the unit thats attacking you? i'm using the event - EVENT_PLAYER_UNIT_ATTACKED, and not EVENT_UNIT_DAMAGE. ..

PS: how do you add damage from a unit using trigger?
 

Aedes

Member
Reaction score
8
damage event? but it also includes the damage received from spells. my trigger is:

when a unit is attacked, it will return the damage it receives from the attacking unit. the damage is based on the attack-damage of the attacking unit or the damage the unit received from the attacking unit.
 

hgkjfhfdsj

Active Member
Reaction score
55
Damage (the system) this can detect whether a damage is from an attack, provided that you do all the damage (from spells etc) with the system. if the condition are inadequate, you can also consider using an buff-placer, detect when a unit is damage, then check whether the unit has the buff. for something less accurate, use dynamic triggers when a unit attacks.
also what do you mean by 'add damage'?

EDIT
when a unit is attacked, it will return the damage it receives from the attacking unit. the damage is based on the attack-damage of the attacking unit or the damage the unit received from the attacking unit.
could you base the spell off thorns aura/ spiked shell?
 

Aedes

Member
Reaction score
8
what do you mean by 'add damage'?

adding damage to hero or increasing its damage. +2 damage, +4, etc.

thanks for the link by the way. i'm gonna check that out. :thup:
 

Rushhour

New Member
Reaction score
46
Well you can't get the damage simply because no damage has been dealt when the event EVENT_PLAYER_UNIT_ATTACKED fires.

The reason you should avoid this event is because it can be easily exploitet by spamming the STOP botton. Each attempt to attack (mustn't be successful) will trigger EVENT_PLAYER_UNIT_ATTACKED.

The "takes damage" event only fires on successful and finished attacks. There is no generic unit event for this and that's the reason why there are damage detection systems.
 

13lade619

is now a game developer :)
Reaction score
399
how do you get the damage you receive from the unit thats attacking you? i'm using the event - EVENT_PLAYER_UNIT_ATTACKED, and not EVENT_UNIT_DAMAGE. ..

Generic damage detection was never actually implemented by Blizzard.
you might think it's a simple fix but it's not.
it's actually one of the more complicated things to implement in wc3.

So you have to use some special libraries, like Damage.
 

Aedes

Member
Reaction score
8
ok. .. i guess i have to use that system. .. thanks. ..anyways., another question. in the event, EVENT_UNIT_DAMAGED, whats the syntax for the unit that's doing the damage? GetAttacker()?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top