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

How to detect evasion via trigger!

Status
Not open for further replies.

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
not possible.
The events that exist are:
a unit is attacked
a unit is damaged
You could think, that if after the attack event no damage event follows, that the unit evaded the attack, but there are so many reasons, why no damage event follows. The problem, is that the attack event fires, when a unit starts the attack, so you could even cancel the attack and no damage event happens.

You could do a triggered version of evasion, but that's hard to make it work right.
You detect when a unit with evasion is damaged, check if it was an attack and give it a certain chance to reduce the damage to 0. Problem is that it does not behabe exactly as normal evasion.
Normal evasion reduces aoe damage to 25% and also secondary effects are dodged (stun from bash, poison, ...).
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
you practically cant

but there is a way to do it you will have to have a triggerd version of evasion that uses a Damage Engine 3.7.0.1 with physical damage detection as well
i dont know much about other damage detection systems but bribes has a feature to null damage and detect if physical or spell

the trigger would look somthing like this
  • Esence attacks
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of Evasion for DamageEventSource) Greater than 0
      • IsDamageSpell Equal to False
      • random integer between 1 and 100 less then or equal to (the miss chance)
    • Actions
    • Set DamageEventAmount = 0
      • ==Do your effect==
 
Level 7
Joined
Jun 19, 2017
Messages
141
hmm well i guess i'll have to drop that idea for now, since it's kinda hard to make it work. The idea of the ability was to enable another ability for the unit whenever it dodges and then disable it after a few seconds, something like the Hunter ability in WoW, Mongoose Bite.
 
Status
Not open for further replies.
Top