function Trig_Test_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit u
local location tempLocation
call GroupEnumUnitsInRect(g, gg_rct_Arena, null)
loop
set u = FristOfGroup( g )
exitwhen u == null
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_MAX_LIFE) * RMaxBJ(0,GetUnitLifePercent(u) - 5.00) * 0.01)
if GetOwningPlayer(u) == Player(10) and GetUnitCurrentOrder(u) == 0 then
set tempLocation = Location(GetRectCenterX(gg_rct_Move_to_2),GetRectCenterY(gg_rct_Move_to_2))
call IssuePointOrderLoc(u,"attack",tempLocation)
call RemoveLocation(tempLocation)
endif
if GetOwningPlayer(u) == Player(11) and GetUnitCurrentOrder(u) == OrderId("") then
set tempLocation = Location(GetRectCenterX(gg_rct_Move_to_1),GetRectCenterY(gg_rct_Move_to_1))
call IssuePointOrderLoc(u,"attack",tempLocation)
call RemoveLocation(tempLocation)
endif
call GroupRemoveUnit( g, u )
endloop
call DestroyGroup(g)
set g = null
set tempLocation = null
endfunction
function InitTrig_Test takes nothing returns nothing
set gg_trg_Test = CreateTrigger()
call TriggerRegisterTimerEvent(gg_trg_Test,5.00,true)
call TriggerAddAction(gg_trg_Test,function Trig_Test_Actions)
endfunction