• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Placing a spell on cooldown via triggers/JASS?

Status
Not open for further replies.
Level 5
Joined
Aug 3, 2005
Messages
70
Is there any way to place a specified spell on cooldown for a unit by using triggers?

I have a spell based off Channel that deals damage to a unit on the event of 'Unit - A unit Begins casting an ability'. However, when the unit is near death, and the spell is used, the trigger kills the target before the spell can finish and go into cooldown.

For some reason, using the 'Unit - A unit Begins casting an ability' is the only event in which the rest of the trigger will work. (Rest of the trigger being simply damaging the target unit)

I've tried 'Unit - A unit Finishes casting an ability', but that made the rest of the trigger not work for some reason, and the unit didn't take any damage.

I also tried adding a minor wait time before damaging the unit, but that made the trigger not work, and the unit didn't take any damage either.

So is there any way to force a cooldown short of spawning a dummy and force casting it on the dummy (That would look a bit strange)?

Or is there something else that I could do to fix the trigger so that the cooldown would register / cast would finish before the target dies?

Any help or light shedding on the subject would be greatly appreciated :grin:
 
Level 11
Joined
Feb 22, 2006
Messages
752
Use the event unit starts the effect of an ability. It's triggered after the spell is cast (mana deducted and cooldown applied). Using unit starts casting an ability is a bad idea because sometimes it fails to fire at all and sometimes it fires even if the ability wasn't cast (like if the unit got ordered to cast it but it didn't have enough mana).

And the reason using waits doesnt work is because all event response functions (get casting unit, get target unit of ability, etc.) stop working after you do a wait (the only exception is get triggering unit).
 
Level 10
Joined
Feb 20, 2008
Messages
448
cooldown ability glitch

Use the event unit starts the effect of an ability. It's triggered after the spell is cast (mana deducted and cooldown applied). Using unit starts casting an ability is a bad idea because sometimes it fails to fire at all and sometimes it fires even if the ability wasn't cast (like if the unit got ordered to cast it but it didn't have enough mana).

And the reason using waits doesnt work is because all event response functions (get casting unit, get target unit of ability, etc.) stop working after you do a wait (the only exception is get triggering unit).


some how i got this problem the ability when i cast Throw explosion c1 the trigger goes on but the ability cooldown doesnt goes on, and it will probly gonna happen on other spell

and another glitch that i never understand WHY THE FREAK when i cast an ability another can be cast Like i cast C1 and c4 explose in the place of C1
 
Status
Not open for further replies.
Top