function Trig_Guardian_Conditions takes nothing returns boolean
return(GetUnitTypeId(GetSummonedUnit())=='Unit Rob')
endfunction
function Trig_Guardian_Actions takes nothing returns nothing
local unit ball=GetSummonedUnit()
local unit master=GetSummoningUnit()
local location target
local real angle
local real distance
loop
exitwhen IsUnitDeadBJ(ball)
if(DistanceBetweenPoints(GetUnitLoc(ball),GetUnitLoc(master))>1000.)then
set target=GetUnitLoc(master)
call IssuePointOrderByIdLoc(ball,851986,target)
call RemoveLocation(target)
else
set target=GetUnitLoc(master)
set angle=GetRandomReal(0,360)
set distance=GetRandomReal(100.,500.)
call PolarProjectionNL(target,distance,angle)
call IssuePointOrderByIdLoc(ball,851983,target)
call RemoveLocation(target)
endif
call TriggerSleepAction(.5)
endloop
endfunction