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

Status
Not open for further replies.
Level 7
Joined
Nov 15, 2009
Messages
225
I don't think you can detect cooldowns so easy.

What you could do is, create a boolean variable for the spells and everytime a spell is casted you set the boolean to true.
(for example: set BlizzardCooldown[PlayerNumber(GetTriggerPlayer) - 1] = true)
And wait x seconds and set it to false again.

So you just have to check if the boolean is true or false.

Another way is to work with dummys, make a dummy for every spell and everytime you want to know if the spell is on cooldown, try to cast the spell and check if something happens (damage or whatever).

Both took long, but I don't know other ways..
Hopefully it helps you anyway.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
For me, I would save each spell that is used on map (not all spells in Object Editor), to be saved in a hashtable with Real values representing the cooldown for a certain spell.

Then, each time a spell is casted, I load up the value and start handle its timer.
When it reaches 0, the cooldown is over.
If not, the cooldown still goes on.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
The "timer" I'm talking about, is not the "Timer" in the variable.
The "timer" is just a mere representation so that he understands.

The "timer" in this topic, I talk about Integer, being the timer.
So that the Integer will keep each spell cooldown in an indexing method.
 
Status
Not open for further replies.
Top