JASS:
scope FrostStrom initializer init
globals
private constant real i = 1.0 //Interval
private timer t
private real x
private real y
endglobals
function execute takes nothing returns nothing
call BJDebugMsg("Tick!")
endfunction
private function condition takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
private function action takes nothing returns nothing
local location loc = GetSpellTargetLoc()
local unit u = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()), 'h001', loc, 180.0)
local integer i = 0
set x = GetLocationX(loc)
set y = GetLocationY(loc)
call BJDebugMsg(R2S(x))
call BJDebugMsg(R2S(y))
call TimerStart(t, i, true, function execute)
call KillUnit(u)
call BJDebugMsg("Unit Kiled")
set u = null
set loc = null
endfunction
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function condition))
call TriggerAddAction(t, function action)
endfunction
endscope
The above code is what I wrote for testing purpose. But then when I test I find that my timer never fire.(The debug message in the execute function never run) As you can see I had put some debug msg so I can figure it out that everything run just fine until it reach the timer one. So I come here to seek for some help. Can you find out that what's wrong? Thanks!