• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Evasion with Cooldown

Status
Not open for further replies.

Kith

K

Kith

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!
 
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.
 
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.
Back
Top