//==========================================================================================
//
//	grotli_b6.gm
//
//	Who				When			What
//------------------------------------------------------------------------------------------
//	^2o-0._.0-o		11 July 2023	Initial Script
//
//==========================================================================================
//

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

	Command_Post_Dyno = 0,
	Main_Gate_Dyno = 0,
	Side_Entrance_Dyno = 0,
	TankGate_Dyno = 0,
	Tank_Gate_Dyno = 0,
	Vault_room_door_Dyno = 0,
	first_Tank_Barrier_Dyno = 0,
	second_Tank_Barrier_Dyno = 0,

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

		Util.MapDebugPrint( "Command_Post_Built" );
	},

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

		Util.MapDebugPrint( "Side_Entrance_Built" );
	},

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

		Util.MapDebugPrint( "Tank_Built" );
	},

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

		Util.MapDebugPrint( "Vault_room_door_Built" );
	},

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

		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_firstbarrier_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_firstbarrier_.*" );		
		
		Util.MapDebugPrint( "first_Tank_Barrier_Built" );
	},

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

		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_secondbarrier_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_secondbarrier_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "SMOKEBOMB_axisB_.*" );		
		
		Util.MapDebugPrint( "second_Tank_Barrier_Built" );
	},

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

		Map.Command_Post_Dyno += 1;
		Util.MapDebugPrint( "Command_Post_Planted" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_maingate_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "SMOKEBOMB_alliesA_.*" );	
		SetAvailableMapGoals( TEAM.ALLIES, false, "SMOKEBOMB_alliesB_.*" );	
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_alliedvault_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_maingate_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANTMINE_mineA_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "PLANTMINE_mineB_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_tankgate_.*" );	
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_alliedvault_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "SMOKEBOMB_axisB_.*" );	
		SetAvailableMapGoals( TEAM.AXIS, false, "SMOKEBOMB_alliesA_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "SWITCH_garage_3" );		

		Map.Main_Gate_Dyno += 1;
		Util.MapDebugPrint( "Main_Gate_Planted" );
	},

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

		Map.Side_Entrance_Dyno += 1;
		Util.MapDebugPrint( "Side_Entrance_Planted" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_tankgate_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_flag_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_alliedvault_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_tankgate_.*" );

		Map.TankGate_Dyno += 1;
		Util.MapDebugPrint( "TankGate_Planted" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_tankgate_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_flag_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_alliedvault_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_tankgate_.*" );

		Map.Tank_Gate_Dyno += 1;
		Util.MapDebugPrint( "Tank_Gate_Planted" );
	},

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

		Map.Vault_room_door_Dyno += 1;
		Util.MapDebugPrint( "Vault_room_door_Planted" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_tankgate_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_firstbarrier_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_firstbarrier_.*" );	

		Map.first_Tank_Barrier_Dyno += 1;
		Util.MapDebugPrint( "first_Tank_Barrier_Planted" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_secondbarrier_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_secondbarrier_.*" );		
		
		Map.second_Tank_Barrier_Dyno += 1;
		Util.MapDebugPrint( "second_Tank_Barrier_Planted" );
	},

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

		Map.Command_Post_Dyno -= 1;
		Util.MapDebugPrint( "Command_Post_Defused" );
	},

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

		Map.Main_Gate_Dyno -= 1;
		Util.MapDebugPrint( "Main_Gate_Defused" );
	},

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

		Map.Side_Entrance_Dyno -= 1;
		Util.MapDebugPrint( "Side_Entrance_Defused" );
	},

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

		Map.TankGate_Dyno -= 1;
		Util.MapDebugPrint( "TankGate_Defused" );
	},

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

		Map.Tank_Gate_Dyno -= 1;
		Util.MapDebugPrint( "Tank_Gate_Defused" );
	},

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

		Map.Vault_room_door_Dyno -= 1;
		Util.MapDebugPrint( "Vault_room_door_Defused" );
	},

	first_Tank_Barrier_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }
		
		Map.first_Tank_Barrier_Dyno -= 1;
		Util.MapDebugPrint( "first_Tank_Barrier_Defused" );
	},

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

		Map.second_Tank_Barrier_Dyno -= 1;
		Util.MapDebugPrint( "second_Tank_Barrier_Defused" );
	},

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

		Map.Command_Post_Dyno = 0;

		Util.MapDebugPrint( "Command_Post_Destroyed" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Side_Entrance" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Vault_room_door" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_maingate_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_firstbarrier_.*" );		
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_secondbarrier_.*" );	
		SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_first_Tank_Barrier" );	
		SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_second_Tank_Barrier" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_gold_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_alliedvault_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_tankgate_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_flag_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Vault_room_door" );	
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_gold_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_axistunnel_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_firstbarrier_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_secondbarrier_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_maingate_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_tankgate_.*" );	
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_flag_.*" );		

		sleep(4);
		Util.BotChat(TEAM.ALLIES, "vsay", VOICE.LETS_GO, 1);	

		Map.Main_Gate_Dyno = 0;

		Util.MapDebugPrint( "Main_Gate_Destroyed" );
	},

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

		Map.Side_Entrance_Dyno = 0;

		Util.MapDebugPrint( "Side_Entrance_Destroyed" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_tankgate_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_tankgate_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "ESCORT_tank" );		

		Map.TankGate_Dyno = 0;

		Util.MapDebugPrint( "TankGate_Destroyed" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_tankgate_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_tankgate_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "ESCORT_tank" );		
		
		Map.Tank_Gate_Dyno = 0;

		Util.MapDebugPrint( "Tank_Gate_Destroyed" );
	},

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

		sleep(3);
		Util.BotChat(TEAM.AXIS, "vsay", VOICE.DEFEND_OBJECTIVE, 1);	
		
		Map.Vault_room_door_Dyno = 0;

		Util.MapDebugPrint( "Vault_room_door_Destroyed" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_secondbarrier_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_second_Tank_Barrier" );	
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_firstbarrier_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_firstbarrier_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_secondbarrier_.*" );
		
		Map.first_Tank_Barrier_Dyno = 0;

		Util.MapDebugPrint( "first_Tank_Barrier_Destroyed" );
	},

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

		SetAvailableMapGoals( TEAM.AXIS, true, "SMOKEBOMB_axisB_.*" );

		Map.second_Tank_Barrier_Dyno = 0;

		Util.MapDebugPrint( "second_Tank_Barrier_Destroyed" );
	},

	axis_gold1_Taken = function( trigger )
	{
		if ( TestMap )
			{ return; }
			
		SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Vault_room_door" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Side_Entrance" );			
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_gold_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_alliedvault_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_garage_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_art_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_art_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_alliedvault_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANTMINE_mineA_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "PLANTMINE_mineB_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_gold_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_axistunnel_.*" );			
		SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Side_Entrance" );
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Vault_room_door" );	

		Util.MapDebugPrint( "axis_gold1_Taken" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Vault_room_door" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Side_Entrance" );			
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_gold_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_alliedvault_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "SWITCH_garage_1" );		
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANTMINE_mineB_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "PLANTMINE_mineA_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_alliedvault_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_gold_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_axistunnel_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Side_Entrance" );
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Vault_room_door" );			

		Util.MapDebugPrint( "axis_gold1_Returned" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Vault_room_door" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Side_Entrance" );		
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_gold_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_alliedvault_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANTMINE_mineB_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "PLANTMINE_mineA_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_alliedvault_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_gold_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_axistunnel_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Side_Entrance" );
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Vault_room_door" );			

		Util.MapDebugPrint( "axis_gold1_Secured" );
	},

	forwardbunkerflag_Axis_Captured = function( trigger )
	{
		if ( TestMap )
			{ return; }
			
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_alliedvault_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_forwardbunkerflag" );		
		
		Util.MapDebugPrint( "forwardbunkerflag_Axis_Captured" );
	},

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

		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_alliedvault_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_forwardbunkerflag" );
		
		Util.MapDebugPrint( "forwardbunkerflag_Allies_Captured" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, false, "SMOKEBOMB_alliesA_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_tankgate_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_flag_.*" );	
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANTMINE_mineB_.*" );		

		Util.MapDebugPrint( "Tank_stolen" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_flag_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_first_Tank_Barrier" );	
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_firstbarrier_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "SMOKEBOMB_alliesB_.*" );	
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_tankgate_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "CHECKPOINT_forwardbunkerflag" );	
		SetAvailableMapGoals( TEAM.ALLIES, false, "SWITCH_garage_1" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_art_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_firstbarrier_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Vault_room_door" );
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Side_Entrance" );
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANTMINE_mineB_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_garage_3" );		
		SetAvailableMapGoals( TEAM.AXIS, false, "PLANTMINE_mineA_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_flag_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_maingate_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_tankgate_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, false, "CHECKPOINT_forwardbunkerflag" );
		SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Command_Post" );
		SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Command_Post" );
		SetAvailableMapGoals( TEAM.AXIS, false, "SWITCH_piano_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "SWITCH_phone_1" );	
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_art_.*" );
		
		Util.MapDebugPrint( "Tank_outside" );
	},
	
	Tank_inside = function( trigger )
	{
		if ( TestMap )
			{ return; }

		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_secondbarrier_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_gold_.*" );		
		SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Side_Entrance" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Vault_room_door" );		
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANTMINE_mineB_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_axistunnel_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_gold_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_secondbarrier_.*" );		
		SetAvailableMapGoals( TEAM.AXIS, false, "SMOKEBOMB_axisB_.*" );		

		Util.MapDebugPrint( "Tank_inside" );
	},
	
	Tank_end = function( trigger )
	{
		if ( TestMap )
			{ return; }

		SetAvailableMapGoals( TEAM.ALLIES, false, "ESCORT_tank" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Tank" );	

		Util.MapDebugPrint( "Tank_end" );
	},
	
};

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

	// Register callback functions
	OnTrigger( "^oAllied Command Post constructed. Charge speed increased!", Map.Command_Post_Built );
	OnTrigger( "^oAxis Command Post constructed. Charge speed increased!", Map.Command_Post_Built );	
	OnTrigger( "^oThe Side Entrance has been built", Map.Side_Entrance_Built );
	OnTrigger( "^oThe Tank has been repaired", Map.Tank_Built );
	OnTrigger( "^oThe Vault room door has been built", Map.Vault_room_door_Built );
	OnTrigger( "^oThe first Tank Barrier has been constructed.", Map.first_Tank_Barrier_Built );
	OnTrigger( "^oThe second Tank Barrier has been constructed.", Map.second_Tank_Barrier_Built );
	OnTrigger( "Planted at the Command Post.", Map.Command_Post_Planted );
	OnTrigger( "Planted at the Main Gate.", Map.Main_Gate_Planted );
	OnTrigger( "Planted at the Side Entrance.", Map.Side_Entrance_Planted );
	OnTrigger( "Planted at the Tank Gate.", Map.TankGate_Planted );
	OnTrigger( "Planted at the Tank Gate.", Map.Tank_Gate_Planted );
	OnTrigger( "Planted at the Vault room door.", Map.Vault_room_door_Planted );
	OnTrigger( "Planted at the first Tank Barrier.", Map.first_Tank_Barrier_Planted );
	OnTrigger( "Planted at the second Tank Barrier.", Map.second_Tank_Barrier_Planted );
	OnTrigger( "Defused at the Command Post.", Map.Command_Post_Defused );
	OnTrigger( "Defused at the Main Gate.", Map.Main_Gate_Defused );
	OnTrigger( "Defused at the Side Entrance.", Map.Side_Entrance_Defused );
	OnTrigger( "Defused at the Tank Gate.", Map.TankGate_Defused );
	OnTrigger( "Defused at the Tank Gate.", Map.Tank_Gate_Defused );
	OnTrigger( "Defused at the Vault room door.", Map.Vault_room_door_Defused );
	OnTrigger( "Defused at the first Tank Barrier.", Map.first_Tank_Barrier_Defused );
	OnTrigger( "Defused at the second Tank Barrier.", Map.second_Tank_Barrier_Defused );
	OnTrigger( "^oAllied team has destroyed the Axis Command Post!", Map.Command_Post_Destroyed );	
	OnTrigger( "^oAxis team has destroyed the Allied Command Post!", Map.Command_Post_Destroyed );
	OnTrigger( "^oThe Allies have destroyed the Main Gate!", Map.Main_Gate_Destroyed );
	OnTrigger( "^oAllies have breached the Side Entrance", Map.Side_Entrance_Destroyed );
	OnTrigger( "^oThe Allies have destroyed the Tank Gate!", Map.TankGate_Destroyed );
	OnTrigger( "^oThe Allies have destroyed the Tank Gate!", Map.Tank_Gate_Destroyed );
	OnTrigger( "^oThe Vault room door has been destroyed", Map.Vault_room_door_Destroyed );
	OnTrigger( "^oAllies team has destroyed the first Tank Barrier!", Map.first_Tank_Barrier_Destroyed );
	OnTrigger( "^oAllies team has destroyed the second Tank Barrier!", Map.second_Tank_Barrier_Destroyed );
	OnTrigger( "^oThe Allies have stolen a Gold Crate!", Map.axis_gold1_Taken );
	OnTrigger( "^oThe Axis have intercepted the stolen Gold Crate!", Map.axis_gold1_Returned );
	OnTrigger( "^oAllies have escaped with the Gold!", Map.axis_gold1_Secured );
	OnTrigger( "^oAxis reclaim the Forward Bunker!", Map.forwardbunkerflag_Axis_Captured );
	OnTrigger( "^oAllies capture the Forward Bunker!", Map.forwardbunkerflag_Allies_Captured );
	OnTrigger( "^oAllied team has stolen the Tank!", Map.Tank_stolen );	
	OnTrigger( "^oThe Tank is outside the Grotli tunnel", Map.Tank_outside );	
	OnTrigger( "^oThe Tank has entered the Axis Base", Map.Tank_inside );	
	OnTrigger( "^o+4 min Timebonus", Map.Tank_end );	

	//~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_.*" );	
	Util.SetMaxUsers( 1, "PLANT_.*" );
	Util.SetMaxUsers( 1, "ESCORT_tank" );	
	Util.SetMaxUsers( 1, "SWITCH_piano_.*" );
	Util.SetMaxUsers( 1, "SWITCH_art_.*" );	

	// Camp times
	SetMapGoalProperties( "MOUNTMG42_.*", {MinCampTime=15, MaxCampTime=90} );
	SetMapGoalProperties( "MOBILEMG42_.*", {MinCampTime=10, MaxCampTime=60} );

	// Allies goals
	SetGoalPriority( "CHECKPOINT_forwardbunkerflag", 0.95, TEAM.ALLIES );
	SetGoalPriority( "DEFEND_hill_3", 0.82, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "DEFEND_hill_2", 0.81, TEAM.ALLIES, CLASS.COVERTOPS );	
	SetGoalPriority( "FLAG_axis_gold1", 0.88, TEAM.ALLIES );
	SetGoalPriority( "PLANT_Command_Post", 0.40, TEAM.ALLIES );	
	SetGoalPriority( "PLANT_Main_Gate", 0.95, TEAM.ALLIES, CLASS.ENGINEER );	
	SetGoalPriority( "PLANT_first_Tank_Barrier", 0.95, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_second_Tank_Barrier", 0.93, TEAM.ALLIES, CLASS.ENGINEER );	
	SetGoalPriority( "PLANT_Tank_Gate", 0.95, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_TankGate", 0.95, TEAM.ALLIES, CLASS.ENGINEER );	
	SetGoalPriority( "PLANT_Side_Entrance", 0.94, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "PLANT_Vault_room_door", 0.96, TEAM.ALLIES, CLASS.ENGINEER );	
	SetGoalPriority( "ESCORT_tank", 0.94, TEAM.ALLIES );
	SetGoalPriority( "BUILD_Tank", 0.95, TEAM.ALLIES, CLASS.ENGINEER );	
	SetGoalPriority( "ATTACK_maingate_1", 0.80, TEAM.ALLIES, CLASS.MEDIC );	
	SetGoalPriority( "ATTACK_maingate_2", 0.81, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "ATTACK_maingate_3", 0.81, TEAM.ALLIES, CLASS.SOLDIER );	
	SetGoalPriority( "ATTACK_maingate_4", 0.80, TEAM.ALLIES, CLASS.FIELDOPS );
	SetGoalPriority( "ATTACK_maingate_.*", 0.79, TEAM.ALLIES );	
	SetGoalPriority( "ATTACK_tankgate_1", 0.80, TEAM.ALLIES, CLASS.SOLDIER );
	SetGoalPriority( "ATTACK_tankgate_2", 0.80, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "ATTACK_tankgate_3", 0.80, TEAM.ALLIES, CLASS.FIELDOPS );
	SetGoalPriority( "ATTACK_tankgate_4", 0.80, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "ATTACK_tankgate_.*", 0.79, TEAM.ALLIES );	
	SetGoalPriority( "ATTACK_flag_1", 0.79, TEAM.ALLIES );
	SetGoalPriority( "ATTACK_flag_2", 0.79, TEAM.ALLIES );
	SetGoalPriority( "ATTACK_flag_3", 0.79, TEAM.ALLIES );
	SetGoalPriority( "ATTACK_flag_4", 0.79, TEAM.ALLIES );	
	SetGoalPriority( "ATTACK_firstbarrier_1", 0.80, TEAM.ALLIES, CLASS.MEDIC );	
	SetGoalPriority( "ATTACK_firstbarrier_2", 0.80, TEAM.ALLIES, CLASS.FIELDOPS );
	SetGoalPriority( "ATTACK_firstbarrier_3", 0.81, TEAM.ALLIES, CLASS.COVERTOPS );	
	SetGoalPriority( "ATTACK_firstbarrier_4", 0.81, TEAM.ALLIES, CLASS.SOLDIER );
	SetGoalPriority( "ATTACK_firstbarrier_5", 0.81, TEAM.ALLIES, CLASS.SOLDIER );
	SetGoalPriority( "ATTACK_firstbarrier_.*", 0.79, TEAM.ALLIES );	
	SetGoalPriority( "ATTACK_secondbarrier_1", 0.80, TEAM.ALLIES, CLASS.MEDIC );	
	SetGoalPriority( "ATTACK_secondbarrier_2", 0.80, TEAM.ALLIES, CLASS.FIELDOPS );
	SetGoalPriority( "ATTACK_secondbarrier_3", 0.81, TEAM.ALLIES, CLASS.COVERTOPS );	
	SetGoalPriority( "ATTACK_secondbarrier_4", 0.81, TEAM.ALLIES, CLASS.SOLDIER );
	SetGoalPriority( "ATTACK_secondbarrier_5", 0.81, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "ATTACK_secondbarrier_.*", 0.79, TEAM.ALLIES );	
	SetGoalPriority( "ATTACK_gold_1", 0.80, TEAM.ALLIES, CLASS.MEDIC );	
	SetGoalPriority( "ATTACK_gold_2", 0.80, TEAM.ALLIES, CLASS.FIELDOPS );
	SetGoalPriority( "ATTACK_gold_3", 0.81, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "ATTACK_gold_4", 0.81, TEAM.ALLIES, CLASS.SOLDIER );
	SetGoalPriority( "ATTACK_gold_5", 0.80, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "ATTACK_gold_6", 0.81, TEAM.ALLIES, CLASS.SOLDIER );
	SetGoalPriority( "ATTACK_gold_.*", 0.79, TEAM.ALLIES );	
	SetGoalPriority( "ATTACK_alliedvault_1", 0.79, TEAM.ALLIES, CLASS.SOLDIER );
	SetGoalPriority( "ATTACK_alliedvault_2", 0.79, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "ATTACK_alliedvault_3", 0.79, TEAM.ALLIES, CLASS.FIELDOPS );
	SetGoalPriority( "ATTACK_alliedvault_4", 0.79, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "ATTACK_alliedvault_5", 0.79, TEAM.ALLIES, CLASS.MEDIC );
	SetGoalPriority( "ATTACK_alliedvault_.*", 0.78, TEAM.ALLIES );
	SetGoalPriority( "SMOKEBOMB_alliesA_1", 0.83, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "SMOKEBOMB_alliesA_2", 0.84, TEAM.ALLIES, CLASS.COVERTOPS );	
	SetGoalPriority( "SMOKEBOMB_alliesB_.*", 0.83, TEAM.ALLIES, CLASS.COVERTOPS );	
	
	
	// Axis goals
	SetGoalPriority( "CHECKPOINT_forwardbunkerflag", 0.95, TEAM.AXIS );	
	SetGoalPriority( "PLANT_Command_Post", 0.40, TEAM.AXIS );
	SetGoalPriority( "BUILD_first_Tank_Barrier", 0.99, TEAM.AXIS );
	SetGoalPriority( "BUILD_second_Tank_Barrier", 0.98, TEAM.AXIS );	
	SetGoalPriority( "BUILD_Vault_room_door", 0.97, TEAM.AXIS );
	SetGoalPriority( "DEFEND_tankgate_1", 0.80, TEAM.AXIS, CLASS.MEDIC );	
	SetGoalPriority( "DEFEND_tankgate_2", 0.80, TEAM.AXIS, CLASS.FIELDOPS );
	SetGoalPriority( "DEFEND_tankgate_3", 0.81, TEAM.AXIS, CLASS.SOLDIER );	
	SetGoalPriority( "DEFEND_tankgate_4", 0.80, TEAM.AXIS, CLASS.COVERTOPS );
	SetGoalPriority( "DEFEND_tankgate_.*", 0.79, TEAM.AXIS );	
	SetGoalPriority( "DEFEND_gold_1", 0.81, TEAM.AXIS, CLASS.COVERTOPS );
	SetGoalPriority( "DEFEND_gold_2", 0.80, TEAM.AXIS, CLASS.FIELDOPS );
	SetGoalPriority( "DEFEND_gold_3", 0.80, TEAM.AXIS, CLASS.MEDIC );	
	SetGoalPriority( "DEFEND_gold_4", 0.81, TEAM.AXIS, CLASS.SOLDIER );	
	SetGoalPriority( "DEFEND_gold_5", 0.81, TEAM.AXIS, CLASS.COVERTOPS );
	SetGoalPriority( "DEFEND_gold_.*", 0.79, TEAM.AXIS );	
	SetGoalPriority( "DEFEND_axistunnel_1", 0.80, TEAM.AXIS, CLASS.COVERTOPS );	
	SetGoalPriority( "DEFEND_axistunnel_2", 0.80, TEAM.AXIS, CLASS.COVERTOPS );	
	SetGoalPriority( "DEFEND_axistunnel_3", 0.80, TEAM.AXIS, CLASS.FIELDOPS );	
	SetGoalPriority( "DEFEND_axistunnel_4", 0.80, TEAM.AXIS, CLASS.MEDIC );	
	SetGoalPriority( "DEFEND_axistunnel_5", 0.81, TEAM.AXIS, CLASS.SOLDIER );	
	SetGoalPriority( "DEFEND_axistunnel_6", 0.82, TEAM.AXIS, CLASS.SOLDIER );
	SetGoalPriority( "DEFEND_axistunnel_.*", 0.79, TEAM.AXIS );	
	SetGoalPriority( "DEFEND_maingate_1", 0.80, TEAM.AXIS, CLASS.MEDIC );	
	SetGoalPriority( "DEFEND_maingate_2", 0.81, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "DEFEND_maingate_3", 0.80, TEAM.AXIS, CLASS.COVERTOPS );	
	SetGoalPriority( "DEFEND_maingate_4", 0.81, TEAM.AXIS, CLASS.SOLDIER );	
	SetGoalPriority( "DEFEND_maingate_5", 0.80, TEAM.AXIS, CLASS.FIELDOPS );
	SetGoalPriority( "DEFEND_maingate_.*", 0.79, TEAM.AXIS );	
	SetGoalPriority( "DEFEND_flag_1", 0.79, TEAM.AXIS, CLASS.COVERTOPS );
	SetGoalPriority( "DEFEND_flag_2", 0.79, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "DEFEND_flag_3", 0.79, TEAM.AXIS, CLASS.MEDIC );	
	SetGoalPriority( "DEFEND_flag_4", 0.79, TEAM.AXIS, CLASS.SOLDIER );	
	SetGoalPriority( "DEFEND_firstbarrier_1", 0.80, TEAM.AXIS, CLASS.MEDIC );	
	SetGoalPriority( "DEFEND_firstbarrier_2", 0.81, TEAM.AXIS, CLASS.COVERTOPS );
	SetGoalPriority( "DEFEND_firstbarrier_3", 0.80, TEAM.AXIS, CLASS.FIELDOPS );	
	SetGoalPriority( "DEFEND_firstbarrier_4", 0.81, TEAM.AXIS, CLASS.SOLDIER );
	SetGoalPriority( "DEFEND_firstbarrier_5", 0.81, TEAM.AXIS, CLASS.SOLDIER );
	SetGoalPriority( "DEFEND_firstbarrier_.*", 0.79, TEAM.AXIS );	
	SetGoalPriority( "DEFEND_secondbarrier_1", 0.80, TEAM.AXIS, CLASS.MEDIC );	
	SetGoalPriority( "DEFEND_secondbarrier_2", 0.80, TEAM.AXIS, CLASS.FIELDOPS );
	SetGoalPriority( "DEFEND_secondbarrier_3", 0.81, TEAM.AXIS, CLASS.COVERTOPS );	
	SetGoalPriority( "DEFEND_secondbarrier_4", 0.81, TEAM.AXIS, CLASS.SOLDIER );
	SetGoalPriority( "DEFEND_secondbarrier_5", 0.81, TEAM.AXIS, CLASS.SOLDIER );
	SetGoalPriority( "DEFEND_secondbarrier_.*", 0.79, TEAM.AXIS );	
	SetGoalPriority( "DEFEND_alliedvault_1", 0.80, TEAM.AXIS, CLASS.MEDIC );	
	SetGoalPriority( "DEFEND_alliedvault_2", 0.80, TEAM.AXIS, CLASS.FIELDOPS );
	SetGoalPriority( "DEFEND_alliedvault_3", 0.80, TEAM.AXIS, CLASS.COVERTOPS );	
	SetGoalPriority( "DEFEND_alliedvault_4", 0.80, TEAM.AXIS, CLASS.SOLDIER );	
	SetGoalPriority( "DEFEND_alliedvault_5", 0.80, TEAM.AXIS, CLASS.FIELDOPS );	
	SetGoalPriority( "DEFEND_alliedvault_6", 0.80, TEAM.AXIS, CLASS.COVERTOPS );	
	SetGoalPriority( "DEFEND_alliedvault_7", 0.80, TEAM.AXIS, CLASS.SOLDIER );
	SetGoalPriority( "DEFEND_alliedvault_.*", 0.79, TEAM.AXIS );
	SetGoalPriority( "PLANTMINE_mineA_.*", 0.79, TEAM.AXIS, CLASS.ENGINEER );	
	SetGoalPriority( "PLANTMINE_mineB_.*", 0.86, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "SMOKEBOMB_axisB_.*", 0.92, TEAM.AXIS, CLASS.COVERTOPS );

	// All
	SetGoalPriority( "DEFEND_chair_1", 0.78, TEAM.AXIS, CLASS.SOLDIER );
	SetGoalPriority( "DEFEND_art_.*", 0.79, TEAM.ALLIES );
	SetGoalPriority( "DEFEND_art_.*", 0.79, TEAM.AXIS );	
	SetGoalPriority( "SWITCH_piano_1", 0.79, TEAM.AXIS, CLASS.SOLDIER );	
	SetGoalPriority( "SWITCH_piano_2", 0.79, TEAM.AXIS, CLASS.COVERTOPS );
	SetGoalPriority( "SWITCH_phone_1", 0.79, TEAM.AXIS, CLASS.SOLDIER );	
	SetGoalPriority( "SWITCH_piano_1", 0.79, TEAM.ALLIES, CLASS.SOLDIER );	
	SetGoalPriority( "SWITCH_piano_2", 0.79, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "SWITCH_phone_1", 0.79, TEAM.ALLIES, CLASS.SOLDIER );	
	SetGoalPriority( "SWITCH_phone_2", 0.79, TEAM.ALLIES, CLASS.SOLDIER );	
	SetGoalPriority( "SWITCH_phone_3", 0.79, TEAM.AXIS, CLASS.SOLDIER );
	SetGoalPriority( "SWITCH_garage_1", 0.79, TEAM.ALLIES );	
	SetGoalPriority( "SWITCH_garage_2", 0.79, TEAM.ALLIES, CLASS.COVERTOPS );	
	SetGoalPriority( "SWITCH_garage_3", 0.79, TEAM.AXIS );	
	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 =
	{
		BUILD_first_Tank_Barrier =
		{
		},
		BUILD_Side_Entrance =
		{
		},
		BUILD_Tank =
		{
		},
		BUILD_Vault_room_door =
		{
		},
		BUILD_second_Tank_Barrier =
		{
		},
		BUILD_Command_Post =
		{
		},
		PLANT_second_Tank_Barrier =
		{
		},
		PLANT_first_Tank_Barrier =
		{
		},
		PLANT_Main_Gate =
		{
		},
		PLANT_TankGate =
		{
		},
		PLANT_Tank_Gate =
		{
		},
		PLANT_Side_Entrance =
		{
		},
		PLANT_Command_Post =
		{
		},
		PLANT_Vault_room_door =
		{
		},
		FLAG_axis_gold1 =
		{
		},
		CHECKPOINT_forwardbunkerflag =
		{
		},
	};
	Util.Routes(MapRoutes);
};
