function Trig_RMG_place_start_locations_Func002Func005Func003001003 takes nothing returns boolean return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == true ) endfunction function Trig_RMG_place_start_locations_Func002Func005Func003A takes nothing returns nothing set udg_Grove_TreePlacementOK = false return endfunction function Trig_RMG_place_start_locations_Func002Func005Func004001003 takes nothing returns boolean return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) endfunction function Trig_RMG_place_start_locations_Func002Func005Func004A takes nothing returns nothing set udg_Grove_TreePlacementOK = false return endfunction function Trig_RMG_place_start_locations_Func002Func005Func005A takes nothing returns nothing set udg_Grove_TreePlacementOK = false return endfunction function Trig_RMG_place_start_locations_Func002Func005Func006C takes nothing returns boolean if ( not ( RectContainsLoc(udg_Map_UsedMap, udg_Grove_TreePosition) == true ) ) then return false endif if ( not ( udg_Grove_TreePlacementOK == true ) ) then return false endif return true endfunction function Trig_RMG_place_start_locations_Func002A takes nothing returns nothing set udg_SP_StartPosition[GetConvertedPlayerId(GetEnumPlayer())] = PolarProjectionBJ(GetRectCenter(udg_Map_UsedMap), ( 0.80 * udg_Map_MaxCoordinatesXY ), ( udg_SP_BaseAngle + I2R(( udg_SP_CurrentIndex * ( 360 / udg_C_NumberOfPlayers ) )) )) call PanCameraToTimedLocForPlayer( GetEnumPlayer(), udg_SP_StartPosition[GetConvertedPlayerId(GetEnumPlayer())], 0 ) call SetCameraQuickPositionLocForPlayer( GetEnumPlayer(), udg_SP_StartPosition[GetConvertedPlayerId(GetEnumPlayer())] ) call CreateNUnitsAtLocFacingLocBJ( 1, 'ngol', Player(PLAYER_NEUTRAL_PASSIVE), PolarProjectionBJ(udg_SP_StartPosition[GetConvertedPlayerId(GetEnumPlayer())], 700.00, AngleBetweenPoints(GetRectCenter(udg_Map_UsedMap), udg_SP_StartPosition[GetConvertedPlayerId(GetEnumPlayer())])), udg_SP_StartPosition[GetConvertedPlayerId(GetEnumPlayer())] ) set bj_forLoopAIndex = 1 set bj_forLoopAIndexEnd = 500 loop exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd set udg_Grove_TreePosition = PolarProjectionBJ(udg_SP_StartPosition[GetConvertedPlayerId(GetEnumPlayer())], GetRandomReal(600.00, 1000.00), GetRandomReal(( AngleBetweenPoints(GetUnitLoc(GetLastCreatedUnit()), udg_SP_StartPosition[GetConvertedPlayerId(GetEnumPlayer())]) - 90.00 ), ( AngleBetweenPoints(GetUnitLoc(GetLastCreatedUnit()), udg_SP_StartPosition[GetConvertedPlayerId(GetEnumPlayer())]) + 90.00 ))) set udg_Grove_TreePlacementOK = true call ForGroupBJ( GetUnitsInRangeOfLocMatching(300.00, udg_Grove_TreePosition, Condition(function Trig_RMG_place_start_locations_Func002Func005Func003001003)), function Trig_RMG_place_start_locations_Func002Func005Func003A ) call ForGroupBJ( GetUnitsInRangeOfLocMatching(100.00, udg_Grove_TreePosition, Condition(function Trig_RMG_place_start_locations_Func002Func005Func004001003)), function Trig_RMG_place_start_locations_Func002Func005Func004A ) call EnumDestructablesInCircleBJ( 50.00, udg_Grove_TreePosition, function Trig_RMG_place_start_locations_Func002Func005Func005A ) if ( Trig_RMG_place_start_locations_Func002Func005Func006C() ) then call CreateDestructableLoc( udg_TS_Tree_Default, udg_Grove_TreePosition, GetRandomDirectionDeg(), GetRandomReal(0.75, 1.25), GetRandomInt(0, udg_TS_TreeMaxVariation) ) else set udg_Grove_NumberOfFailedTrees = ( udg_Grove_NumberOfFailedTrees + 1 ) endif set bj_forLoopAIndex = bj_forLoopAIndex + 1 endloop call MeleeStartingUnitsForPlayer( GetPlayerRace(GetEnumPlayer()), GetEnumPlayer(), udg_SP_StartPosition[GetConvertedPlayerId(GetEnumPlayer())], true ) set udg_SP_CurrentIndex = ( udg_SP_CurrentIndex + 1 ) endfunction function Trig_RMG_place_start_locations_Actions takes nothing returns nothing set udg_SP_BaseAngle = GetRandomDirectionDeg() call ForForce( udg_C_Players, function Trig_RMG_place_start_locations_Func002A ) endfunction //=========================================================================== function InitTrig_RMG_place_start_locations takes nothing returns nothing set gg_trg_RMG_place_start_locations = CreateTrigger( ) call TriggerAddAction( gg_trg_RMG_place_start_locations, function Trig_RMG_place_start_locations_Actions ) endfunction