• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] Check if unit is still casting an ability

Status
Not open for further replies.
Level 7
Joined
Mar 8, 2009
Messages
360
i'm trying to make an ability with a casting time of 4 sec. I use a timer that runs another function after 3.50 seconds. Then i should find a way to see that the unit is still casting the ability but i don't know how to do that.
The ability i'm using is flame strike.
 
Level 5
Joined
Dec 18, 2007
Messages
205
or if it does not matter and your trigger can also run when he casts the spell, you can use
Unit - Aunit starts the effect of an ability

But is this not possible with one of the events like
otherwise just use the order<->string comparison
 
Level 4
Joined
Mar 14, 2009
Messages
98
Use a trigger instead of a timer. Add two events to it, the first one should be a timer event to happen after 3.50 seconds, the second should be for spell endcast.

JASS:
function NewTriggerActions takes nothing returns nothing
if GetTriggerEventId() == EVENT_UNIT_SPELL_ENDCAST then
call DestroyTrigger(GetTriggeringTrigger())
else
call WhateverItShouldBeDoing()
endif
endfunction

Nevermind this. I just learned something: dynamic triggers are evil.
 
Last edited:
Status
Not open for further replies.
Top