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

[JASS] Firing Cooldowns

Status
Not open for further replies.
Level 4
Joined
Nov 24, 2007
Messages
55
Is there any way in JASS or the trigger script at all to fire the cooldown (activate the cooldowns) on all other abilities, or on just some abilities?

i.e., a unit uses one of its abilities, now it cannot use it (because of its own cooldown) or any of its other abilities for a couple of seconds.
 
Last edited:
Level 3
Joined
Sep 13, 2008
Messages
63
As far as I know there is no trigger for it. But there may be a work around. For the abilities set a requirement of a unit or building. Create this unit at the start of game. Now, whenever any of the abilities are used remove the unit for a set time then remake it. The abilities won't with without the unit present.
 
Level 4
Joined
Nov 24, 2007
Messages
55
I suppose that could work, but is very ugly and requires tracking of ownership of that unit of a player and making the buildings (which i suppose could have the NONE.mdl)...

Thanks though for the thought, I may either re-design this hero or have fun with buildings...
 
Level 19
Joined
Nov 16, 2006
Messages
2,165
Hey there tigershark.
It is in a way possible, but it requires some work and adjustments.

So you may be able using a 'backdoor'.
Lets say a unit has thunder clap, and you want a cooldown on it every 60 seconds.
First of all, you'd need to create a 'fake' dummy spell which deals no damage, no effects and has NO targets. Important is that this dummy spell should have all the same data of the original and the same cooldown (no mana cost!).

Then, you'd create a timer which runs each 60 seconds for example.
After these 60 seconds you'd replace the original with the dummy and make it instantly cast the dummy spell. Create a wait function which has the same amount of time like the cooldown of your choise. After the wait is done, simply replace the dummy with the original again.

Extra notes:
- I suggest you'd use an instant castable spell.
- To check if the cooldown is already running at those 60 seconds, make a boolean. Whenever you launch the original spell, set that boolean to true (false after the cooldown time, use wait), and make the timer check the boolean first.

I hope this helps you and could give you a possibly solution for your problem.

-Xarwin
 
Status
Not open for further replies.
Top