• 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.

[Solved] Cooldown Not Working

Status
Not open for further replies.
Level 4
Joined
Jan 8, 2012
Messages
66
Hello, I've been struggling with an ability I made lately based off Channel. The only problem is that when I use it the cool down doesn't trigger at all, even though I have it set at 12 seconds. I have no idea where to start with this, and help is much appreciated! Here's my trigger if that helps, thanks in advance.

  • Charge
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Charge
    • Actions
      • Unit - Turn collision for Champion Off
      • Trigger - Turn on ChargeMove <gen>
      • Cinematic - Disable user control for Player Group - Player 1 (Red)
      • Wait 1.40 seconds
      • Trigger - Turn off ChargeMove <gen>
      • Cinematic - Enable user control for Player Group - Player 1 (Red)
      • Unit - Turn collision for Champion On
      • Animation - Play Champion's stand animation
  • ChargeMove
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit - Move Champion instantly to ((Position of Champion) offset by 30.00 towards (Facing of Champion) degrees)
      • Animation - Play Champion's attack animation
      • Special Effect - Create a special effect at (Position of Champion) using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • Special Effect - Create a special effect at (Position of Champion) using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
      • Sound - Play LavaSpawnMissileBirth1 <gen>
      • Unit Group - Pick every unit in (Units within 200.00 of (Position of Champion)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) Equal to Player 9 (Gray)) or ((Owner of (Picked unit)) Equal to Neutral Hostile)
            • Then - Actions
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (((Real((Strength of Champion (Include bonuses)))) / 10.00) x 3.00))
              • Unit - Set (Picked unit) movement speed to (((Current movement speed of (Picked unit)) / 10.00) x 3.00)
              • Wait 3.00 seconds
              • Unit - Set (Picked unit) movement speed to (Default movement speed of (Picked unit))
            • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Moving unit instantly gives a stop order, and that overrides the spell order.

When you press the ability button, the unit "Begins casting an ability". The unit "Starts the effect of an ability" after a short time, Art - animation - cast point. Usually it is around 0.3-0.5 seconds. Mana cost and cooldown are applied when a unit "Starts the effect...".

You use the Begins casting event and move the unit after 0.05 seconds and give it the stop order. The unit never Starts the effect so cooldown and mana cost are not applied.

Always use Starts the effect of an ability for your triggered spells, unless you spesifically need Begins casting for somethng special.

http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
 
Status
Not open for further replies.
Top