| 04-19-2004, 01:59 AM | #1 |
I need to know if an ability is cooling down, anyone have a suggestion on how to do so. It currently makes my Drag and Drop Spellbook flawed as you can use it to escape a cooldown: http://www.battle.net/forums/war3/th...t=0#post120921 |
| 04-19-2004, 02:09 AM | #2 | |
^_^ Quote:
AFAIK you need to keep track manually track it by making note each time a spell finishes casting meaning there is no IfSpellIsCoolingDown conditon/function/ etc. ^_^ |
| 04-19-2004, 02:40 AM | #3 |
Use WEUnleashed, and create a custom value. The event type would be "a unit attacks" "a unit finishes casting a spell" etc Then, you do an if then else. If the custom integer = 1, you set it to 0. If it is 0, you set it to 1. Forgot to note: The custom integer for the unit. |
| 04-19-2004, 02:55 AM | #4 |
custom values are not some WEU feature. And second of all do you really think i'd use anything other then delicious jass. But the real question is how do I detect cooldown length etc? Its all fine and good to know that the spell just cast, but having to manaully write the cooldown would be rather malicious to say the least. |
| 04-19-2004, 04:44 AM | #5 | |
Quote:
WEU is overrated to detect cooldown length simply run the spell being cast through your list of spells and get its cooldown length. you will have to: have a list of spells & have a list of their cooldown lengths a unit finishes casting a spell wait function calculate spelllength [do w/e u do after the cooldown expires] function calculatespellength takes string returns integer if spell = LKSJ then return 8 elseif spell = DFJK then return 2 ----- thats just my idea, if someone else knows a better way pls post!! ^_^ |
| 04-19-2004, 06:16 AM | #6 |
Order the unit to cast the spell and check the return value of the order native. It should return false if there is still a cooldown on that ability. Immediately cancel that order afterwards (restore the original order). |
