Azathrael
New Member
- Reaction score
- 0
Also, will the loop (aka tree plow) end when the ability ends? Or do I need to add additional stuff for that too?
function Trig_BlazeFury_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 039;A00J039;
endfunction
function killtree takes nothing returns nothing
call KillDestructable (GetEnumDestructable())
endfunction
function Trig_BlazeFury_Actions takes nothing returns nothing
local integer x = 0
local integer y = 4 //How long tha ability Lasts
local real range = 225 //The killing radius
loop
call EnumDestructablesInCircleBJ( range,GetUnitLoc(GetTriggerUnit()),function killtree)
call TriggerSleepAction(1)
set x = x + 1
exitwhen(x == (y))
endloop
endfunction
function InitTrig_BlazeFury takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ (t, EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition (t, Condition( function Trig_BlazeFury_Conditions))
call TriggerAddAction (t, function Trig_BlazeFury_Actions)
endfunction
call TriggerSleepAction(0.5)
exitwhen(x == (y*2))