| 12-21-2005, 05:04 PM | #1 |
Basically, i want windwalk to renew its cooldown when it has been broken out of. So it will act like this: Suppose we have a hero with ww (10 sec cool) 1) Hero wws and attacks something after 5 seconds. I want ww to revert to 10 sec cool after this. 2) Hero wws and attacks something after 15 seconds. He is unable to use ww right again, and for 10 seconds more How can this be done? |
| 12-21-2005, 05:11 PM | #2 |
Simply register when the hero casts windwalk, and start a timer. Then, periodically check the hero if he still has the windwalk buff. When it hasn't got the buff any longer, check how much time has elapsed by checking the timer. If it is 5 seconds, then store the level of windwalk ability for the hero in a variable, remove the ability, add it again and set it's level to the number stored in the integer value. This "resets" the cooldown for the windwalk ability, and no other abilities. If the time is 15 seconds, simply wait ten seconds and "reset" the cooldown the way I described above. Of course, the cooldown of the spell in object editor should be greater than those values to prevent problems. |
| 12-22-2005, 05:48 AM | #3 |
So if I understood correctly... The default behavior of windwalk is that, upon cast, you become invisible and the cooldown starts to recharge. Consequently, if you have a duration of 30 seconds and a cooldown of 10 seconds, then 1/3 of the way through the windwalk's duration, thej player would be able to attack and immediately windwalk again to avoid being hit back. You want windwalk's cooldown to kick in after it wears off (either through the duration expiring or the unit attacking to break invisibility). This way, there will be at least 10 seconds of time where the unit is visible and able to be attacked between windwalk castings. My suggestion would be that when windwalk is cast, create a timer set to the duration of windwalk + 10 seconds. Remove the windwalk ability and add a dummy ability that looks just like windwalk but has no mana cost and has a cooldown equal to windwalk's duration + 10 seconds and force the unit to cast it (ie. trigger the cooldown). When a unit attacks, if it has the windwalk ability then remove the dummy ability and add another dummy ability--one that has a duration of 10 seconds--adn trigger it. Change the timer to 10 seconds. When the timer expires (ie. when the cooldown on one of the abilities fully recharges), remove the dummy ability and add back the original windwalk ability. If in the instance that windwalk wears off without the unit attacking, you want them to be able to cast again immediately, then just remove the + 10 seconds parts in the two areas that I mentioned above in the first paragraph of the explanation. Good luck! |
| 12-22-2005, 09:29 AM | #4 |
Thanks u both |
