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

Reset an Ability Cooldown

Status
Not open for further replies.
Level 7
Joined
Mar 22, 2010
Messages
228
first remove the ability(s) that are not to be reseted.(but put their levels to a variable)
then do the action reset.
after that add the abilities then set their levels to according to variable.

thats it.
 
Level 7
Joined
Jul 18, 2009
Messages
272
first remove the ability(s) that are not to be reseted.(but put their levels to a variable)
then do the action reset.
after that add the abilities then set their levels to according to variable.

thats it.

It's easier the other way around.
1) Save the ability level of your ability in a variable.
2) Remove the ability and add it again.
3) Reset the level.

You don't need the Cooldown-Reset-Action.
This also works fine for hero abilities. Only with abilities in a spellbook it could be a bit more complicated.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
meOme is correct. You don't need to reset the ability cooldown if you add/remove it. Furthermore, if you do reset the ability cooldowns in addition to removing/adding the ability, then all of your abilities are going to be "cooled down".

If you remove/add an ability, the cooldown will be reset. If you disable an ability it will not reset the cooldown, such as using SetPlayerAbilityAvailable.
 
Level 19
Joined
Jan 3, 2022
Messages
320
The above discussion relates to old Warcraft versions. However, this thread still comes up in results. The new natives added in version 1.29 make it possible in an easier way.

BlzEndUnitAbilityCooldown and BlzSetUnitAbilityCooldown or in GUI:
cooldown-gui.png
 
Status
Not open for further replies.
Top