As the title suggests, I'm failing at resetting an ability cooldown using effects. Now I think I should be using modify unit for this, it should definitely be the caster as well, cooldown link is Abil\LightningBolt, I'm just not figuring out how to make this happen.
Basically, I have an ability that casts a spell, then it has a recast time of 15 seconds. When it gets used, a behavior of duration of 15 seconds gets added to the caster unit to make sure it won't try to use it again during that time(it has a second spell it can also use). The ability is also disabled at that time, which apparently also disables the cooldown timer from resetting on its own. When the behavior wears off, it has a final effect of modify unit, which refuses to work for me. All I want to have happen is for whatever the remaining cooldown is to get removed/reset.
I have gotten this to work by the way doing it another way, but it is bothering me a lot to not be able to do this in data. And I refuse to use a data/trigger hybrid this time, is no reason for it at all. Thanks in advance to any knowledgeable.
I tinkered around with this a lot before, and I couldn't get it to work. The only way a modify unit effect can affect cooldowns is via the Cost field. And while it seems to be able to refill ability charges, it cannot refill charge time or cooldown time the same way.
However what you can do is use charges instead of the cooldown, set max charges to 1, hide the charge count and make the modify unit effect restore charges.
Not saying it wouldn't work Kueken, it simply wasn't what I was wanting to figure out how to do. The charge way could be used in combination with a behavior in a sense, but it wouldn't show the usual refresh time. Shooting out a dummy effect then having a trigger clear the ability for you on said unit works too, but I was hoping a data only way of doing this existed is all. That is what vexes me, is how to make that specifically happen using data only.
Not sure I'm understanding your suggestion then either. As far as I understood, you were saying something like set Ability Charge to 1, when you use ability use that charge and also apply a behavior(persistent probably also do the trick) for X seconds, have final effect be modify unit, and have that add a charge back to the ability. This is what is being suggested correct? It would indeed create an ability with recast X seconds, but what about the little clockwise cooldown that shows up during a regular recast time? I'm guessing that would not show up.
If I understand correctly you want the ui to show the cooldown and the charge-solution would only show it grey until the new charge is applied. if that is the only ability of that unit, you could change the units time scale. e.g. having time-scale of 200 for 0.1 seconds means an ability with 20 seconds cooldown is "instant" ready. I used that to reset all cooldowns of a hero in one of my maps, but you would have to disable movement and attack during that time just to be save.
Well essentially what I wanted was a data only way to reset time based cool downs since disabled abilities cooldowns get frozen, that has proven impossible. So instead, I opted to disable abilities by using requirements setting them to only be visible when a certain behavior is applied. This solved my issue of wanting to make abilities not available but still have cooldowns occur automatically for when a monster is in autopilot kill the players mode. It also made it so I can simply show the abilities all the time when my necro class uses a ghost to possess said monster. If you really want more details I can give them, it is simply, complicated :P