| 01-23-2009, 05:51 AM | #1 |
Hey, I was wondering if it was possible to reset the cooldowns of a units abilities via triggers (Yes I know it is possible via GUI using the "Reset ability cooldowns of <Unit>") but that way will not work for me because it resets all cooldowns, including those of items that the unit has in its inventories. So essentially is it possible to reset a units abilities without reseting item cooldowns for that unit! Thanks in advance!! :P |
| 01-23-2009, 05:56 AM | #2 |
maybe removing and adding the ability again would do the job... |
| 01-23-2009, 06:00 AM | #3 |
Would removing the abilities then giving them back work? It'd be a hassle and more work than it's worth and I'm not even sure it works. edit: damn ninja post before me |
| 01-23-2009, 06:10 AM | #4 |
Do not forget to note the level of the ability before removing it, if it is a leveled ability. store level remove add set level |
| 01-23-2009, 07:01 AM | #5 |
Well if that is the only way I'm not going to bother trying.. would cause more problems then its worth IMO. But I have a another question.. is their any way to activate the cooldown of an ability for a unit using triggers? |
| 01-23-2009, 09:05 AM | #6 |
And what it does if you put the items on the floor, reset cooldown, and then give back the items to the unit ? |
| 01-23-2009, 10:39 AM | #7 |
It is not so complicated. You need only one function that runs straight: JASS:function lalala takes... local integer INT_Level = GetUnitAbilityLevel(theUnit, theAbility) call UnitRemoveAbility(theUnit, theAbility) call UnitAddAbility(theUnit, theAbility) call SetUnitAbilityLevel(theUnit, theAbility, INT_Level) endfunction that's it |
| 01-23-2009, 10:42 AM | #8 | |
Quote:
If UnitRemove... then UnitAdd... Also i dunno if it works if an unit own an item which have an ability, but maybe it works. |
| 01-23-2009, 10:44 AM | #9 | |
Quote:
|
| 01-23-2009, 11:19 AM | #10 |
Actually I found away around all of that. Now it still resets item cooldowns but not the item that gives the ability so it is essentially fixed as far as I'm concerned. Trigger: Will reset all the abilities before the actual "Refresher" ability fires so it doesn't reset its own cooldown. I origionally used: Trigger: in that one, the reset is applied after the ability goes on cooldown so essentially gives you an infinite CD reset witch is very bad.. |
| 01-23-2009, 09:01 PM | #11 |
I believe with the event "begins casting an ability" that it is possible for the player to abort the cast before cooldown sets in (albeit quite difficult to do), so even with your method it may still be possible to have infinite Refresher... not sure - it might not be a problem for instant-cast abilities. |
| 01-23-2009, 09:10 PM | #12 |
I don't believe that is an issue for abilities cast via items, which don't factor in the cast time of the hero. |
