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

	Allied_gate_Dyno = 0,
	Bank_Wall_Dyno = 0,
	Command_Post_Dyno = 0,
	Ramp_Dyno = 0,
	Side_Route_Dyno = 0,

	Allied_CP_Built = false, // These two are added manually.
	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" );
		Util.MapDebugPrint( "Testutskrift" );
	},

	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" );
	},

	// ************* GATEFLAG ***********************
	Gateflag_Axis_Captured = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Allied_gate" );
		Util.MapDebugPrint( "gateflag_Axis_Captured" );
	},

	Gateflag_Allies_Captured = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Util.MapDebugPrint( "gateflag_Allies_Captured" );
	},
	
	Gateflag_cover_down = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_gateflag" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_gateflag" );
		Util.MapDebugPrint( "gateflag_cover_down" );
	},
	
	// ************* THE GATE ***********************
	Allied_gate_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Allied_gate_Dyno += 1;
		SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Allied_gate" );
		Util.MapDebugPrint( "Allied_gate_Planted" );
	},
	
	Allied_gate_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Allied_gate_Dyno -= 1;
		Util.MapDebugPrint( "Allied_gate_Defused" );
	},
	
	Allied_gate_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Allied_gate_Dyno = 0;
		Wp.SetWaypointFlag( "gatekeeper", "closed", false );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_gateflag_ax_def03" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_ax_gatedef_04" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_ax_gatedef_05" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_gateflag_ax_def05" );
		SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_bankflag" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_bankflag" );
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_gate_al_01" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_gate_al_02" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_gate_al_03" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_gate_al_04" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_gate_al_05" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_gate_al_06" );	
		SetAvailableMapGoals( TEAM.AXIS, true, "SNIPE_ax_snipe_03" );
		SetAvailableMapGoals( TEAM.AXIS, true, "SNIPE_ax_snipe_04" );
		Wp.SetWaypointFlag( "gatewalk1", "closed", true );
		Wp.SetWaypointFlag( "gatewalk2", "closed", true );
		Wp.SetWaypointFlag( "ax_bankplantspot1", "closed", false );
		Wp.SetWaypointFlag( "ax_gold_spot", "closed", false );
		
		Util.MapDebugPrint( "Allied_gate_Destroyed" );
	},
	
	// ************* BANK FLAG ***********************
	Bankflag_Axis_Captured = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Side_Route" );
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Ramp" );
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Bank_Wall" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_bank_al_01" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_bank_al_02" );
		SetAvailableMapGoals( TEAM.AXIS, false, "SNIPE_ax_snipe_03" );
		SetAvailableMapGoals( TEAM.AXIS, false, "SNIPE_ax_snipe_04" );
		Util.MapDebugPrint( "bankflag_Axis_Captured" );
	},

	Bankflag_Allies_Captured = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, true, "SNIPE_ax_snipe_03" );
		SetAvailableMapGoals( TEAM.AXIS, true, "SNIPE_ax_snipe_04" );
		Util.MapDebugPrint( "bankflag_Allies_Captured" );
	},

	// ************* SIDE ROUTE ***********************
	Side_Route_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Side_Route" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Side_Route" );
		Map.Side_Route_Dyno += 1;
		Util.MapDebugPrint( "Side_Route_Planted" );
	},
	
	Side_Route_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Side_Route_Dyno -= 1;
		Util.MapDebugPrint( "Side_Route_Defused" );
	},
	
	Side_Route_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Side_Route_Dyno = 0;
		Wp.SetWaypointFlag( "sideroute01", "closed", false );
		Util.MapDebugPrint( "Side_Route_Destroyed" );
	},

	// ************* BANK RAMP ***********************
	Ramp_Built = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Ramp" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Ramp" );
		Wp.SetWaypointFlag( "ramp01", "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;

		Util.MapDebugPrint( "Ramp_Destroyed" );
	},
	
	// ************* BANK WALL ***********************
	Bank_Wall_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Bank_Wall" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Bank_Wall" );
		Map.Bank_Wall_Dyno += 1;
		Util.MapDebugPrint( "Bank_Wall_Planted" );
	},

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

		Map.Bank_Wall_Dyno -= 1;
		Util.MapDebugPrint( "Bank_Wall_Defused" );
	},
	
	Bank_Wall_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }
		Map.Bank_Wall_Dyno = 0;
		SetAvailableMapGoals( TEAM.AXIS, true, "FLAG_allied_goldbox" );
		Wp.SetWaypointFlag( "bankgate1", "closed", false );
		Wp.SetWaypointFlag( "bankgate2", "closed", false );
		Wp.SetWaypointFlag( "bankgate3", "closed", false );
		Wp.SetWaypointFlag( "bankgate4", "closed", false );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_01" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_02" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_03" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_04" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_05" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_06" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_07" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_08" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_09" );
		Wp.SetWaypointFlag( "ax_door_left", "closed", false );
		Wp.SetWaypointFlag( "ax_door_right", "closed", false );
		Util.MapDebugPrint( "Bank_Wall_Destroyed" );
	},

	// ************* THE GOLD ***********************
	Allied_goldbox_Taken = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, true, "CAPPOINT_Drop_gold_here" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_bank_al_01" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_bank_al_02" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_01" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_02" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_03" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_04" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_05" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_06" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_07" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_08" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_09" );
		Util.MapDebugPrint( "allied_goldbox_Taken" );
	},

	Allied_goldbox_Returned = function( trigger )
	{
		if ( TestMap )
			{ return; }
		SetAvailableMapGoals( TEAM.AXIS, false, "CAPPOINT_Drop_gold_here" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_bank_al_01" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_bank_al_02" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_01" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_02" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_03" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_04" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_05" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_06" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_07" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_08" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_al_bank_def_09" );
		Util.MapDebugPrint( "allied_goldbox_Returned" );
	},

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

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

	// Register callback functions
	
// ==================	SET TRIGGERS ==========================
		Util.MapDebugPrint( "START." );
// ******************** COMMAND POST
	// OnTrigger( "MISSING_STRING", Map.Command_Post_Built ); // This one is removed, because it is not team-specific.
	
	OnTrigger( "Allied Command Post constructed", Map.Allied_Command_Post_Built ); // These two are added.
	OnTrigger( "Axis Command Post constructed", Map.Axis_Command_Post_Built );
	
	OnTrigger( "Planted at the Command Post", Map.Command_Post_Planted ); // These are kept, although they are not team-specific.
	OnTrigger( "Defused at the Command Post", Map.Command_Post_Defused );

	// OnTrigger( "MISSING_STRING", Map.Command_Post_Destroyed ); // This one is removed, because it is not team-specific.

	OnTrigger( "Axis team has destroyed the Allied Command Post", Map.Allied_Command_Post_Destroyed ); // These two are added.
	OnTrigger( "^1Allied team has destroyed the Axis Command Post!", Map.Axis_Command_Post_Destroyed ); // These two are added.

// ******************** GATE FLAG

	OnTrigger( "sm_gateflag_cover_Moving", Map.Gateflag_cover_down );
	OnTrigger( "^1Axis reclaim the Gate Flag!", Map.Gateflag_Axis_Captured );
	OnTrigger( "Allied Forces reclaim the Gate Flag", Map.Gateflag_Allies_Captured );
	
// ******************** THE 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 );

// ******************** BANK FLAG
	OnTrigger( "^1Axis reclaim the Bank Flag!", Map.Bankflag_Axis_Captured );
	OnTrigger( "^1Allied Forces reclaim the Bank Flag!", Map.Bankflag_Allies_Captured );
	
// ******************** SIDE ROUTE
	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.", Map.Side_Route_Destroyed );

// ******************** BANK 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", Map.Ramp_Destroyed );

// ******************** BANK WALL
	OnTrigger( "Planted at the Bank Wall.", Map.Bank_Wall_Planted );
	OnTrigger( "Defused at the Bank Wall.", Map.Bank_Wall_Defused );
	OnTrigger( "^1The Axis have dynamited the Bank Wall.", Map.Bank_Wall_Destroyed );
	
// ******************** THE GOLD
	OnTrigger( "Axis have stolen Gold!", Map.Allied_goldbox_Taken );
	OnTrigger( "Allies have returned Gold!", Map.Allied_goldbox_Returned );
	OnTrigger( "^1Acta est fabula.", Map.Allied_goldbox_Secured );
	

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

// ******************** COMMAND POST
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" );

// ******************** GATE FLAG
SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_gateflag" );
SetAvailableMapGoals( TEAM.ALLIES, false, "CHECKPOINT_gateflag" );

// ******************** THE GATE
SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Allied_gate" );
SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Allied_gate" );

// ******************** BANK FLAG
SetAvailableMapGoals( TEAM.AXIS, false, "CHECKPOINT_bankflag" );
SetAvailableMapGoals( TEAM.ALLIES, false, "CHECKPOINT_bankflag" );

// ******************** SIDE ROUTE
SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Side_Route" );
SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Side_Route" );

// ******************** BANK 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" );

// ******************** BANK WALL
SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Bank_Wall" );
SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Bank_Wall" );

// ******************** THE GOLD
SetAvailableMapGoals( TEAM.AXIS, false, "FLAG_allied_goldbox" );
SetAvailableMapGoals( TEAM.ALLIES, false, "FLAG_allied_goldbox" );

// ******************** AXIS DEFENCE AT GATE
SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_gateflag_ax_def03" );
SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_gateflag_ax_def03" );

SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_ax_gatedef_04" );
SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_ax_gatedef_04" );

SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_gateflag_ax_def05" );
SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_ax_gatedef_05" );

// ******************** AXIS SNIPE AT GATE
SetAvailableMapGoals( TEAM.AXIS, false, "SNIPE_ax_snipe_03" );
SetAvailableMapGoals( TEAM.ALLIES, false, "SNIPE_ax_snipe_03" );

SetAvailableMapGoals( TEAM.AXIS, false, "SNIPE_ax_snipe_04" );
SetAvailableMapGoals( TEAM.ALLIES, false, "SNIPE_ax_snipe_04" );

// ******************** ALLIED DEFENCE AT GATE
SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_gate_al_01" );
SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_gate_al_01" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_gate_al_02" );
SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_gate_al_02" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_gate_al_03" );
SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_gate_al_03" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_gate_al_04" );
SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_gate_al_04" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_gate_al_05" );
SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_gate_al_05" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_gate_al_06" );
SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_gate_al_06" );

// ******************** ALLIED DEFENCE AT BANK
SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_bank_al_01" );
SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_bank_al_01" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_bank_al_02" );
SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_bank_al_02" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_al_bank_def_01" );
SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_01" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_al_bank_def_02" );
SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_02" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_al_bank_def_03" );
SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_03" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_al_bank_def_04" );
SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_04" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_al_bank_def_05" );
SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_05" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_al_bank_def_06" );
SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_06" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_al_bank_def_07" );
SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_07" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_al_bank_def_08" );
SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_08" );

SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_al_bank_def_09" );
SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_al_bank_def_09" );

// ***** WAYPOINTS *****
Wp.SetWaypointFlag( "gatewalk1", "closed", false );
Wp.SetWaypointFlag( "gatewalk2", "closed", false );

Wp.SetWaypointFlag( "gatekeeper", "closed", true );
Wp.SetWaypointFlag( "sideroute01", "closed", true );
Wp.SetWaypointFlag( "ramp01", "closed", true );

Wp.SetWaypointFlag( "bankgate1", "closed", true );
Wp.SetWaypointFlag( "bankgate2", "closed", true );
Wp.SetWaypointFlag( "bankgate3", "closed", true );
Wp.SetWaypointFlag( "bankgate4", "closed", true );
Wp.SetWaypointFlag( "ax_bankplantspot1", "closed", true );

Wp.SetWaypointFlag( "ax_door_left", "closed", true );
Wp.SetWaypointFlag( "ax_door_right", "closed", true );

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

// Turn off drop off-zone
SetAvailableMapGoals( TEAM.AXIS, false, "CAPPOINT_Drop_gold_here" );
SetAvailableMapGoals( TEAM.ALLIES, false, "CAPPOINT_Drop_gold_here" );


	//~Util.DisableGoal( ".*", true ); // all but routes
	//~SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_.*" );
	//~SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_.*" );

	// Max users per goal
	Util.SetMaxUsers( 1, "ATTACK_.*" );
	Util.SetMaxUsers( 1, "DEFEND_.*" );
	Util.SetMaxUsers( 1, "GRENADE_.*" );
	Util.SetMaxUsers( 1, "SNIPE_.*" );
	Util.SetMaxUsers( 1, "MOUNTMG42_.*" );
	Util.SetMaxUsers( 1, "MOBILEMG42_.*" );
	Util.SetMaxUsers( 1, "MOBILEMORTAR_.*" );
	Util.SetMaxUsers( 1, "AIRSTRIKE_.*" );
	Util.SetMaxUsers( 1, "CALLARTILLERY_.*" );

	// Camp times
	SetMapGoalProperties( "MOUNTMG42_.*", {MinCampTime=15, MaxCampTime=90} );
	SetMapGoalProperties( "MOBILEMG42_.*", {MinCampTime=10, MaxCampTime=60} );
	
	// Max users per goal
	Util.SetMaxUsersInProgress( 1, "BUILD_Command_Post.*" );
	Util.SetMaxUsersInProgress( 1, "PLANT_Allied_gate.*" );
	Util.SetMaxUsersInProgress( 1, "BUILD_Ramp.*" );
	Util.SetMaxUsersInProgress( 1, "PLANT_Side_Route.*" );
	Util.SetMaxUsersInProgress( 1, "PLANT_Bank_Wall.*" );
	

	Util.MapDebugPrint( "Omni-bot map script for " + GetMapName() + " executed." );
};

global OnBotJoin = function( bot )
{
	// Uncomment for shootable breakables
	bot.TargetBreakableDist = 90.0;
	// Only set MaxViewDistance on maps with limited sight (e.g. fog)
	//~bot.MaxViewDistance = 2400;
};

global InitializeRoutes = function()
{
	MapRoutes =
	{
		CHECKPOINT_gateflag =
		{
			ROUTE_ax_base_01 =
			{
				ROUTE_ax_in_gate_spawn_1 = {},
				ROUTE_ax_in_gate_spawn_2 = {},
				ROUTE_gold_left = {},
				ROUTE_gold_centre = {},
			},
		},
		
		
		BUILD_Command_Post =
		{
		},
		BUILD_Ramp =
		{
		},
		PLANT_Side_Route =
		{
		},
		PLANT_Command_Post =
		{
		},
		PLANT_Allied_gate =
		{
			ROUTE_ax_base_01 =
			{
				ROUTE_ax_in_gate_spawn_1 = {},
				ROUTE_ax_in_gate_spawn_2 = {},
			},
		},
		
		PLANT_Ramp =
		{
		},
		PLANT_Bank_Wall =
		{
		},
		FLAG_allied_goldbox =
		{
			ROUTE_ax_bankflag_spawn_01 =
			{
				ROUTE_ax_bank_left_01 =
				{
						ROUTE_ax_bank_left_02 = {},
						ROUTE_ax_bank_left_03 = {},
				},
				
				ROUTE_ax_bank_centre_01 =
				{
				},
				
				ROUTE_ax_bank_right_01 =
				{
						ROUTE_ax_bank_right_02 = {},
						ROUTE_ax_bank_right_03 = {},
				},
			},
		},
		
		CHECKPOINT_bankflag =
		{
		},

		CAPPOINT_Drop_gold_here =
		{
			ROUTE_at_gold =
			{
				ROUTE_gold_left =
				{
					ROUTE_gold_left2 =
					{
						ROUTE_gold_left3a = {},
						ROUTE_gold_left3b = {},
					}
				},
				
				ROUTE_gold_centre =
				{
					ROUTE_gold_centre2 =
					{
						ROUTE_gold_centre3a = {},
						ROUTE_gold_centre3b = {},
					}
				},
			},
		},
	};
	Util.Routes(MapRoutes);
};
