function Trig_RetreatRed_Conditions takes nothing returns boolean
if ( not ( udg_RedPlayerMorale < 10 ) ) then
return false
endif
return true
endfunction
function Trig_RetreatRed_Func001A takes nothing returns nothing
call IssuePointOrderLocBJ( GetEnumUnit(), "move", GetRandomLocInRect(GetPlayableMapRect()) )
endfunction
function Trig_RetreatRed_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectOfPlayer(GetPlayableMapRect(), Player(0)), function Trig_RetreatRed_Func001A )
endfunction
//===========================================================================
function InitTrig_RetreatRed takes nothing returns nothing
set gg_trg_RetreatRed = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_RetreatRed, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_RetreatRed, Condition( function Trig_RetreatRed_Conditions ) )
call TriggerAddAction( gg_trg_RetreatRed, function Trig_RetreatRed_Actions )
endfunction