• 🏆 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!

Dodge spell...

Status
Not open for further replies.
Level 11
Joined
Jun 20, 2009
Messages
880
So anyone knows how to make basic dodge spell? I mean, if you use it, you will dodge the next attack. I have tried things but doest work >_< Whats wrong with this?

  • Dodge
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) has buff Dodge ) Equal to True
    • Actions
      • Set DodgeCaster = (Attacked unit)
      • Unit - Set life of DodgeCaster to ((Life of DodgeCaster) + (Damage taken))
      • Unit - Remove Dodge buff from DodgeCaster
 
Level 4
Joined
Jan 20, 2007
Messages
65
Give your hero evasion with two levels. Set one to 100% evasion. When the dodge spell is cast, set the level of evasion to 100%. After the unit is attacked, restore it to the normal level.

Obviously this won't work to avoid spells, but hopefully that's not what you want.

EDIT: The benefit of using this, rather than restoring the caster's health, is that you actually avoid damage. If the caster has 50 health, is hit by something that will deal 60 damage, the caster will die, regardless of having the dodge ability up or not. Because the damage will be dealt before you can heal the caster.
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
If the caster has 50 health, is hit by something that will deal 60 damage, the caster will die, regardless of having the dodge ability up or not.
Though the problem has been solved, I just had to mention that there's a way to allow a unit to survive in that scenario.

Basically, you would add some ability that raised the unit's max health to some high number. Then use a timer that expires in 0 seconds to remove that ability and set the unit's life to the correct value. This is used in Damage Modifiers.
Since this method can work, it demonstrates that the event fires upon the unit getting damaged, not after the unit has been damaged.
 
Status
Not open for further replies.
Top