- Joined
- Apr 29, 2005
- Messages
- 999
Another question, when do you have to destroy triggers? And when to do it? This can't be correct in my script bellow since the actions is never executed if a use those two last lines. Shouldn't the actions be executed and THEN the trigger is destroyed?
JASS:
function CF_Condition takes nothing returns boolean
return GetSpellAbilityId() == 'A008'
endfunction
function Actions takes nothing returns nothing
call DisplayTimedTextToForce( GetPlayersAll(), 3.00, "Local trigger executed.")
endfunction
//===========================================================================
function InitTrig_Local_trigger takes nothing returns nothing
local trigger CT_Trigger
set CT_Trigger = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CT_Trigger, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CT_Trigger, Condition(function CF_Condition))
call TriggerAddAction(CT_Trigger, function
Actions)
//call DestroyTrigger(CT_Trigger)
//set CT_Trigger = null
endfunction