- Joined
- Sep 3, 2006
- Messages
- 940
As in the headline, why does the function stop running at "TimerStart"? The actions in the callback-function are not yet complete, and doesn't currently work, will this stop the function from continuing..?
The functions:
The functions:
JASS:
function GreaseActionFunction takes nothing returns nothing
call CreateNUnitsAtLoc(1, 'h001', GetOwningPlayer(GetTriggerUnit()), GetSpellTargetLoc(), bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(10.00, 'BTLF', GetLastCreatedUnit())
call UnitAddAbilityBJ('Aslo', GetLastCreatedUnit())
call IssueTargetOrderBJ(GetLastCreatedUnit(), "slow", GetEnumUnit())
endfunction
function GreaseTimerFunction takes nothing returns nothing
call ForGroupBJ(GetUnitsInRectAll(RectFromCenterSizeBJ(GetSpellTargetLoc(), 300.00, 300.00)), function GreaseActionFunction)
endfunction
function GreaseFunction takes nothing returns nothing
local unit c = GetTriggerUnit()
local location t = GetSpellTargetLoc()
local effect array effect1
local timer timer1
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 20
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddSpecialEffectLocBJ(GetRandomLocInRect(RectFromCenterSizeBJ(t, 300.00, 300.00)), "Abilities\\Spells\\Undead\\PlagueCloud\\PlagueCloudCaster.mdl")
set effect1[GetForLoopIndexA()] = GetLastCreatedEffectBJ()
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TimerStart(timer1, 1.00, true, function GreaseTimerFunction)
set timer1 = null
call TriggerSleepAction((6.00 + (2.00 * I2R(GetUnitLevel(c)))))
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 20
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call DestroyEffectBJ(effect1[GetForLoopIndexA()])
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call DestroyTimer(timer1)
call RemoveLocation(t)
endfunction