Does anyone know how to add an internal cooldown to a unit behavior? I am trying to write a hero that has an ability (+75 armor +10hp/s regeneration for 15 seconds) which triggers when his health goes below 25%. I only want this behavior to fire at a maximum of every 45 seconds. I have the behavior written properly (I think), but I'm having difficulty setting up a trigger. The trigger I have is:
Events: Unit life changes.
Conditions: Triggering unit property between 1 and 450.
Actions: Add 1 'Incredible Vitality' to Unit from Unit.
That, as far as it goes, seems to work fine. But I'm baffled by how to incorporate a 45-second ICD to this trigger. There is an Action called Add Cooldown for Unit Behavior...YES! THAT'S WHAT I WANT! ...wait. It lets me add X seconds (good so far!) to cooldown Y on behavior 'Incredible Vitality' on Unit. But it wants the variable cooldown to be of String-type...wait what? I can create a local String-type variable initially set to 0, but I'm not sure where to go from here.
How do I make the cooldown actually...run? And how do I set a Condition such that my trigger only fires if the cooldown is expired? The Condition I would want to use is Within Bounds (that is, cooldown <= 0), but that Condition only accepts Integer-type variables...and cooldowns have to be String-type. I am thoroughly baffled.
What you really want is a periodic behavior that does something say every 1 second.
Then the behavior needs a validator that returns true only if the unit has less then x% of life.
The behavior can have a built in CoolDown period.
You shouldnt need to use triggers at all for this
Possibly you may need two behaviors... One being the passive that procs the abiltiy at most once every 45 seconds.
Then another behavior that actually applies the effects you want to the unit and this would be periodic and wear off after so many seconds.
Thanks! I seem to have it almost working with one behavior...I'm just not entirely sure which fields I need to set to activate the cooldown. There are four cooldown fields: Damage Response Time Start, Damage Response Time Use, Modification Death Response Time Start and Modification Death Response Time Use. Which one (or many) do I need to set to 45 to get this to function?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Does anyone know how to add an internal cooldown to a unit behavior? I am trying to write a hero that has an ability (+75 armor +10hp/s regeneration for 15 seconds) which triggers when his health goes below 25%. I only want this behavior to fire at a maximum of every 45 seconds. I have the behavior written properly (I think), but I'm having difficulty setting up a trigger. The trigger I have is:
Events: Unit life changes. Conditions: Triggering unit property between 1 and 450. Actions: Add 1 'Incredible Vitality' to Unit from Unit.
That, as far as it goes, seems to work fine. But I'm baffled by how to incorporate a 45-second ICD to this trigger. There is an Action called Add Cooldown for Unit Behavior...YES! THAT'S WHAT I WANT! ...wait. It lets me add X seconds (good so far!) to cooldown Y on behavior 'Incredible Vitality' on Unit. But it wants the variable cooldown to be of String-type...wait what? I can create a local String-type variable initially set to 0, but I'm not sure where to go from here.
How do I make the cooldown actually...run? And how do I set a Condition such that my trigger only fires if the cooldown is expired? The Condition I would want to use is Within Bounds (that is, cooldown <= 0), but that Condition only accepts Integer-type variables...and cooldowns have to be String-type. I am thoroughly baffled.
@HaifischSC2: Go
What you really want is a periodic behavior that does something say every 1 second.
Then the behavior needs a validator that returns true only if the unit has less then x% of life.
The behavior can have a built in CoolDown period.
You shouldnt need to use triggers at all for this
Possibly you may need two behaviors... One being the passive that procs the abiltiy at most once every 45 seconds. Then another behavior that actually applies the effects you want to the unit and this would be periodic and wear off after so many seconds.
@SouLCarveRR: Go
Thanks! I seem to have it almost working with one behavior...I'm just not entirely sure which fields I need to set to activate the cooldown. There are four cooldown fields: Damage Response Time Start, Damage Response Time Use, Modification Death Response Time Start and Modification Death Response Time Use. Which one (or many) do I need to set to 45 to get this to function?