//==========================================================================================
//
//	alanbrooke_v1.gm
//
//	Who 	When		What
//------------------------------------------------------------------------------------------
//	^1Loffy	26 August 2018	Initial Script
//
//==========================================================================================
//

global Map =
{
	Debug = 0, // please set to zero before distributing your script
	ShowMovers = false,

	Allied_gate_Dyno = 0,
	Central_Wall_Dyno = 0,
	Command_Post_Dyno = 0,
	Cover_Dyno = 0,
	Ramp_Dyno = 0,
	Side_Route_Dyno = 0,
	Radio_Side_Route_Dyno = 0,
	Allied_CP_Built = false,
	Axis_CP_Built = false,

// COMMAND POST
	
	Allied_Command_Post_Built = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Command_Post" );
		Map.Allied_CP_Built = true;
		Util.MapDebugPrint( "Allied_Command_Post_Built" );
	},

	Axis_Command_Post_Built = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Command_Post" );
		Map.Axis_CP_Built = true;
		Util.MapDebugPrint( "Axis_Command_Post_Built" );
	},
	
	Command_Post_Planted = function( trigger )
	{
		if	( TestMap )
			{ return; }
			
		if	( Map.Axis_CP_Built )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "DEFUSE_Command_Post_.*" );
					SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Command_Post" );
				}
		if	( Map.Allied_CP_Built )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "DEFUSE_Command_Post_.*" );
					SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Command_Post" );
				}
		Util.MapDebugPrint( "Command_Post_Planted" );
	},

	Command_Post_Defused = function( trigger )
	{
		if	( TestMap )
			{ return; }
			
		if	( Map.Axis_CP_Built )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Command_Post" );
				}
		if	( Map.Allied_CP_Built )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Command_Post" );
				}
		Map.Command_Post_Dyno -= 1;
		Util.MapDebugPrint( "Command_Post_Defused" );
	},
	
	Allied_Command_Post_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" );
		Map.Allied_CP_Built = false;
		Util.MapDebugPrint( "Allied_Command_Post_Destroyed" );
	},
	
	Axis_Command_Post_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" );
		Map.Axis_CP_Built = false;
		Util.MapDebugPrint( "Axis_Command_Post_Destroyed" );
	},
	
// WATER FLAG POLE
	gateflag_Axis_Captured = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_01" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_02" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_03" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_04" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_05" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_06" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_07" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_08" );
		Util.MapDebugPrint( "gateflag_Axis_Captured" );
	},

	gateflag_Allies_Captured = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_01" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_02" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_03" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_04" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_05" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_06" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_07" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_08" );
		Util.MapDebugPrint( "gateflag_Allies_Captured" );
	},

// ALLIED WATER GATE
	Allied_gate_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Allied_gate_Dyno += 1;
		SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Allied_gate" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_01" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_02" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_03" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_04" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_05" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_06" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_07" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_water_08" );
		Util.MapDebugPrint( "Allied_gate_Planted" );
	},
	
	Allied_gate_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Allied_gate_Dyno -= 1;
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Allied_gate" );
		Util.MapDebugPrint( "Allied_gate_Defused" );
	},
	
	Allied_gate_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Allied_gate_Dyno = 0;
		Wp.SetWaypointFlag( "waterwall_01", "closed", false );
		Wp.SetWaypointFlag( "waterwall_02", "closed", false );
		Wp.SetWaypointFlag( "waterwall_03", "closed", false );
		Wp.SetWaypointFlag( "waterwall_04", "closed", false );
		Wp.SetWaypointFlag( "central_01", "closed", false );
		Wp.SetWaypointFlag( "central_02", "closed", false );
		Wp.SetWaypointFlag( "central_plant_1a", "closed", false );
		Wp.SetWaypointFlag( "central_plant_1b", "closed", false );
		Wp.SetWaypointFlag( "central_plant_1c", "closed", false );
		SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_bankflag" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_bankflag" );
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Side_Route" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_01" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_02" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_03" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_04" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_05" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_06" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_07" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_08" );
		Util.MapDebugPrint( "Allied_gate_Destroyed" );
	},

// AXIS COVER
	Cover_Built = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Wp.SetWaypointFlag( "cover_01", "closed", true );
		Wp.SetWaypointFlag( "cover_02", "closed", true );
		Wp.SetWaypointFlag( "cover_03", "closed", true );
		Util.MapDebugPrint( "Cover_Built" );
	},

	Cover_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Cover_Dyno += 1;
		Util.MapDebugPrint( "Cover_Planted" );
	},
	
	Cover_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Cover_Dyno -= 1;
		Util.MapDebugPrint( "Cover_Defused" );
	},
	
	Cover_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Cover_Dyno = 0;
		Wp.SetWaypointFlag( "cover_01", "closed", false );
		Wp.SetWaypointFlag( "cover_02", "closed", false );
		Wp.SetWaypointFlag( "cover_03", "closed", false );
		Util.MapDebugPrint( "Cover_Destroyed" );
	},
	
// AXIS RAMP
	Ramp_Built = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Wp.SetWaypointFlag( "ramp_01", "closed", false );
		Util.MapDebugPrint( "Ramp_Built" );
	},
	
	Ramp_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Ramp_Dyno += 1;
		Util.MapDebugPrint( "Ramp_Planted" );
	},

	Ramp_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Ramp_Dyno -= 1;
		Util.MapDebugPrint( "Ramp_Defused" );
	},
	
	Ramp_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Ramp_Dyno = 0;
		Wp.SetWaypointFlag( "ramp_01", "closed", true );
		Util.MapDebugPrint( "Ramp_Destroyed" );
	},
	
// CENTRAL FLAG POLE
	bankflag_Axis_Captured = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Util.MapDebugPrint( "bankflag_Axis_Captured" );
	},

	bankflag_Allies_Captured = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Util.MapDebugPrint( "bankflag_Allies_Captured" );
	},
	
// ALLIED CENTRAL WALL
	Central_Wall_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Central_Wall_Dyno += 1;
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_central_01" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_central_02" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_central_03" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_central_04" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_central_05b" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_central_06" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_central_07b" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_central_08" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_central_09" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_central_10" );
		SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Central_Wall" );
		Util.MapDebugPrint( "Central_Wall_Planted" );
	},

	Central_Wall_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Central_Wall_Dyno -= 1;
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Central_Wall" );
		Util.MapDebugPrint( "Central_Wall_Defused" );
	},
	
	Central_Wall_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Central_Wall_Dyno = 0;
		Wp.SetWaypointFlag( "central_door_1", "closed", false );
		Wp.SetWaypointFlag( "central_door_2", "closed", false );
		Wp.SetWaypointFlag( "central_post_boom_1", "closed", false );
		Wp.SetWaypointFlag( "central_post_boom_2", "closed", false );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_01" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_02" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_03" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_04" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_05b" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_06" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_07b" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_08" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_09" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_10" );
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Radio_Side_Route" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_obj_01" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_obj_02" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_obj_03" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_obj_04" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_obj_05" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_obj_06" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_obj_07" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_obj_08" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_obj_09" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_obj_10" );
		
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_radio_1" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_radio_2" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_radio_3" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_radio_4" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_radio_5" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_radio_6" );
		
		Util.MapDebugPrint( "Central_Wall_Destroyed" );
	},
	
// AXIS SIDE ROUTE AT CENTRAL HALL
	Side_Route_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Side_Route_Dyno += 1;
		SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Side_Route" );
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" );
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Central_Wall" );
		Util.MapDebugPrint( "Side_Route_Planted" );
	},

	Side_Route_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Side_Route_Dyno -= 1;
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Side_Route" );
		Util.MapDebugPrint( "Side_Route_Defused" );
	},
	
	Side_Route_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Side_Route_Dyno = 0;
		Wp.SetWaypointFlag( "central_health_ammo_1", "closed", false );
		Util.MapDebugPrint( "Side_Route_Destroyed" );
	},

// AXIS SIDE ROUTE AT RADIO
	Radio_Side_Route_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Radio_Side_Route_Dyno += 1;
		SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Radio_Side_Route" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_radio_1" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_radio_2" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_radio_3" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_radio_4" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_radio_5" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_radio_6" );
		Util.MapDebugPrint( "Radio_Side_Route_Planted" );
	},

	Radio_Side_Route_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Radio_Side_Route_Dyno -= 1;
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Radio_Side_Route" );
		Util.MapDebugPrint( "Radio_Side_Route_Defused" );
	},

	Radio_Side_Route_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Radio_Side_Route_Dyno = 0;
		Wp.SetWaypointFlag( "radio_1", "closed", false );
		Wp.SetWaypointFlag( "radio_2", "closed", false );
		SetAvailableMapGoals( TEAM.AXIS, true, "FLAG_allied_goldbox" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radio_1" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radio_2" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radio_3" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radio_4" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radio_5" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radio_6" );
		Util.MapDebugPrint( "Radio_Side_Route_Destroyed" );
	},

// ALLIED DOCUMENTS
	allied_goldbox_Taken = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, true, "CAPPOINT_bring_docs_here");
		Util.MapDebugPrint( "allied_goldbox_Taken" );
	},

	allied_goldbox_Returned = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, false, "CAPPOINT_bring_docs_here");
		Util.MapDebugPrint( "allied_goldbox_Returned" );
	},

	allied_goldbox_Secured = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, false, "CAPPOINT_bring_docs_here");
		Util.MapDebugPrint( "allied_goldbox_Secured" );
	},
};

global OnMapLoad = function()
{
	if ( TestMapOn )
		{ Util.AutoTestMap(); }

// ==================	SET TRIGGERS (WHEN MAP LOADS) ==========================

// COMMANDPOST
	OnTrigger( "^1Allied Command Post constructed. Charge speed increased!", Map.Allied_Command_Post_Built );
	OnTrigger( "^1Axis Command Post constructed. Charge speed increased!", Map.Axis_Command_Post_Built );
	OnTrigger( "Planted at the Command Post", Map.Command_Post_Planted );
	OnTrigger( "Defused at the Command Post", Map.Command_Post_Defused );
	OnTrigger( "^1Axis team has destroyed the Allied Command Post!", Map.Allied_Command_Post_Destroyed );
	OnTrigger( "^1Allied team has destroyed the Axis Command Post!", Map.Axis_Command_Post_Destroyed );
// WATER FLAG POLE
	OnTrigger( "^1Axis reclaim the Gate Flag!", Map.gateflag_Axis_Captured );
	OnTrigger( "^1Allied Forces reclaim the Gate Flag!", Map.gateflag_Allies_Captured );
// ALLIED WATER GATE
	OnTrigger( "Planted at the Allied gate.", Map.Allied_gate_Planted );
	OnTrigger( "Defused at the Allied gate.", Map.Allied_gate_Defused );
	OnTrigger( "^1The Axis have dynamited the Gate!", Map.Allied_gate_Destroyed );
// AXIS COVER
	OnTrigger( "The Axis have constructed covers! (A satchel will destroy it.)", Map.Cover_Built );
	OnTrigger( "Planted at the Cover.", Map.Cover_Planted );
	OnTrigger( "Defused at the Cover.", Map.Cover_Defused );
	OnTrigger( "The Allies have destroyed the cover! (Axis can rebuild it.)", Map.Cover_Destroyed );
// AXIS RAMP
	OnTrigger( "The Axis have constructed the Ramp! (A satchel will destroy it.)", Map.Ramp_Built );
	OnTrigger( "Planted at the Ramp.", Map.Ramp_Planted );
	OnTrigger( "Defused at the Ramp.", Map.Ramp_Defused );
	OnTrigger( "The Allies have destroyed the Ramp! (Axis can rebuild it.)", Map.Ramp_Destroyed );
// CENTRAL FLAG POLE
	OnTrigger( "^1Axis reclaim the Central Flag!", Map.bankflag_Axis_Captured );
	OnTrigger( "^1Allied Forces reclaim the Central Flag!", Map.bankflag_Allies_Captured );
// ALLIED CENTRAL WALL
	OnTrigger( "Planted at the Central Wall.", Map.Central_Wall_Planted );
	OnTrigger( "Defused at the Central Wall.", Map.Central_Wall_Defused );
	OnTrigger( "^1The Axis have dynamited the Central Wall.", Map.Central_Wall_Destroyed );
// AXIS SIDE ROUTE AT CENTRAL HALL
	OnTrigger( "Planted at the Side Route.", Map.Side_Route_Planted );
	OnTrigger( "Defused at the Side Route.", Map.Side_Route_Defused );
	OnTrigger( "^1The Axis have dynamited the Side Route in the centre.", Map.Side_Route_Destroyed );
// AXIS SIDE ROUTE AT RADIO
	OnTrigger( "Planted at the Radio Side Route.", Map.Radio_Side_Route_Planted );
	OnTrigger( "Defused at the Radio Side Route.", Map.Radio_Side_Route_Defused );
	OnTrigger( "^1The Axis have dynamited the second Side Route to the Radio.", Map.Radio_Side_Route_Destroyed );
// ALLIED DOCUMENTS
	OnTrigger( "Axis have stolen the Documents!", Map.allied_goldbox_Taken );
	OnTrigger( "Allies have returned the Documents!", Map.allied_goldbox_Returned );
	OnTrigger( "^1Acta est fabula.", Map.allied_goldbox_Secured );

// ==================	SET GOALS (WHEN MAP LOADS) ==========================

// AMMO N HEALTH CABINETS
	SetAvailableMapGoals( TEAM.AXIS, false, "AMMOCAB_mcs_water" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "AMMOCAB_mcs_water" );
	SetAvailableMapGoals( TEAM.AXIS, false, "AMMOCAB_mcs_central" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "AMMOCAB_mcs_central" );
	
	SetAvailableMapGoals( TEAM.AXIS, false, "HEALTHCAB_mch_water" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "HEALTHCAB_mch_water" );
	SetAvailableMapGoals( TEAM.AXIS, false, "HEALTHCAB_mch_central" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "HEALTHCAB_mch_central" );
	
// COMMANDPOST
	SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Command_Post" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Command_Post" );
	SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Command_Post" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Command_Post" );
// WATER FLAG POLE
	SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_gateflag" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_gateflag" );
// ALLIED WATER GATE
	SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Allied_gate" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Allied_gate" );
	
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_01" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_water_01" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_02" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_water_02" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_03" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_water_03" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_04" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_water_04" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_05" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_water_05" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_06" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_water_06" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_07" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_water_07" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_water_08" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_water_08" );
	
// AXIS COVER
	SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Cover" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Cover" );
	SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Cover" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cover" );
// AXIS RAMP
	SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Ramp" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Ramp" );
	SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Ramp" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Ramp" );
// CENTRAL FLAG POLE
	SetAvailableMapGoals( TEAM.AXIS, false, "CHECKPOINT_bankflag" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "CHECKPOINT_bankflag" );
// ALLIED CENTRAL WALL
	SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Central_Wall" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Central_Wall" );
// AXIS SIDE ROUTE AT CENTRAL HALL
	SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Side_Route" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Side_Route" );
// AXIS SIDE ROUTE AT RADIO
	SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Radio_Side_Route" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Radio_Side_Route" );
	
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radio_1" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_radio_1" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radio_2" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_radio_2" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radio_3" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_radio_3" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radio_4" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_radio_4" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radio_5" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_radio_5" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radio_6" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_radio_6" );

// ALLIED DOCUMENTS AND DROP ZONE
	SetAvailableMapGoals( TEAM.AXIS, false, "FLAG_allied_goldbox" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "FLAG_allied_goldbox" );
	SetAvailableMapGoals( TEAM.AXIS, false, "CAPPOINT_bring_docs_here");
	SetAvailableMapGoals( TEAM.ALLIES, false, "CAPPOINT_bring_docs_here");
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_obj_01" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_obj_01" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_obj_02" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_obj_02" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_obj_03" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_obj_03" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_obj_04" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_obj_04" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_obj_05" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_obj_05" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_obj_06" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_obj_06" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_obj_07" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_obj_07" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_obj_08" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_obj_08" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_obj_09" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_obj_09" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_obj_10" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_obj_10" );
	
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_01" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_central_01" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_02" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_central_02" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_03" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_central_03" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_04" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_central_04" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_05b" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_central_05b" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_06" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_central_06" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_07b" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_central_07b" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_08" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_central_08" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_09" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_central_09" );
	SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_central_10" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_central_10" );

// ==================	SET SOME INDIVIDUAL WAYPOINTS (WHEN MAP LOADS) ==========================

Wp.SetWaypointFlag( "waterwall_01", "closed", true );
Wp.SetWaypointFlag( "waterwall_02", "closed", true );
Wp.SetWaypointFlag( "waterwall_03", "closed", true );
Wp.SetWaypointFlag( "waterwall_04", "closed", true );

Wp.SetWaypointFlag( "central_01", "closed", true );
Wp.SetWaypointFlag( "central_02", "closed", true );

Wp.SetWaypointFlag( "cover_01", "closed", false );
Wp.SetWaypointFlag( "cover_02", "closed", false );
Wp.SetWaypointFlag( "cover_03", "closed", false );

Wp.SetWaypointFlag( "ramp_01", "closed", true );

Wp.SetWaypointFlag( "central_health_ammo_1", "closed", true );

Wp.SetWaypointFlag( "central_door_1", "closed", true );
Wp.SetWaypointFlag( "central_door_2", "closed", true );

Wp.SetWaypointFlag( "central_plant_1a", "closed", true );
Wp.SetWaypointFlag( "central_plant_1b", "closed", true );
Wp.SetWaypointFlag( "central_plant_1c", "closed", true );

Wp.SetWaypointFlag( "central_post_boom_1", "closed", true );
Wp.SetWaypointFlag( "central_post_boom_2", "closed", true );

Wp.SetWaypointFlag( "radio_1", "closed", true );
Wp.SetWaypointFlag( "radio_2", "closed", true );
	
	Util.MapDebugPrint( "Omni-bot map script for " + GetMapName() + " executed." );
};

global OnBotJoin = function( bot )
{
	bot.TargetBreakableDist = 90.0;
};

global InitializeRoutes = function()
{
	MapRoutes =
	{
	
// COMMANDPOST
		BUILD_Command_Post =
		{
		},
		PLANT_Command_Post =
		{
		},
		
// WATER FLAG POLE
		CHECKPOINT_gateflag =
		{
			ROUTE_ax_spawn_1 =
			{
				ROUTE_water_drop_1a = {},
				ROUTE_water_drop_2 = {},
			},
		},
		
// ALLIED WATER GATE
		PLANT_Allied_gate =
		{
			ROUTE_ax_spawn_1 =
			{
				ROUTE_plant_water_1 = {},
				ROUTE_water_drop_1 = {},
			},
		},
		
// AXIS COVER
		BUILD_Cover =
		{
		},
		PLANT_Cover =
		{
		},
		
// AXIS RAMP
		BUILD_Ramp =
		{
		},
		PLANT_Ramp =
		{
		},
		
// CENTRAL FLAG POLE
		CHECKPOINT_bankflag =
		{
			ROUTE_ax_spawn_3 =
			{
				ROUTE_side_route_1 = {},
				ROUTE_side_route_2 = {},
				ROUTE_central_1 = {},
				ROUTE_central_2 = {},
			},
		},
		
// ALLIED CENTRAL WALL
		PLANT_Central_Wall =
		{
		},
		
// AXIS SIDE ROUTE AT CENTRAL HALL
		PLANT_Side_Route =
		{
		},
		
// AXIS SIDE ROUTE AT RADIO
		PLANT_Radio_Side_Route =
		{
		},
		
// ALLIED DOCUMENTS
		FLAG_allied_goldbox =
		{
			ROUTE_ax_spawn_4 =
			{
				ROUTE_obj_drop_doc_1 = {},
				ROUTE_obj_drop_radio_1 = {},
				ROUTE_obj_middle_1 = {},
				ROUTE_obj_middle_2 = {},
			},
		},
	};
	
	Util.Routes(MapRoutes);
};
