• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Evasion with Cooldown

Status
Not open for further replies.
Level 1
Joined
Feb 12, 2020
Messages
1
I'm trying to create a guaranteed Evasion passive that has a cooldown - for example, a unit is guaranteed to evade an attack, but can only do so once every 5 seconds. I thought that I could do so by adding a value to the "Stats - Cooldown" field for an Evasion ability, but apparently not! Does anyone know how to achieve such a thing?

Thank you!
 
Level 1
Joined
Feb 3, 2020
Messages
7
I don't think Evasion is natively coded for that. You might have to create a triggered passive ability, and just capture when a unit is attacked, nullify the damage, and then set a timer to be allowed again.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
You can either evaluate it in JASS and set a boolean variable equal to it that you then compare to true, or (in this case) just assign a real variable to the output of that function and compare it as normal:
  • Custom script: set udg_BoolVar = BlzGetUnitAbilityCooldownRemaining(...) <= 0.00
  • If (All conditions are true) then do (Then actions) else do (Else actions)
    • If - Conditions
      • BoolVar equal to True
    • Then - Actions
      • -------- ... --------
    • Else - Actions
  • Custom script: set udg_RealVar = BlzGetUnitAbilityCooldownRemaining(...)
  • If (All conditions are true) then do (Then actions) else do (Else actions)
    • If - Conditions
      • RealVar less than or equal to 0.00
    • Then - Actions
      • -------- ... --------
    • Else - Actions
 
Status
Not open for further replies.
Top