//==========================================================================================
//
//	alcazaba_assault.gm
//
//	Who                   	When		What
//------------------------------------------------------------------------------------------
//	^1T^3N^1T^4|^1*^8Cinco^1*	08 September 2011	Initial Script
//
//==========================================================================================
//

global Map =
{
	Debug = false,

	EscortVehicle =
	{
		Tank =
		{
			Enabled = false,
			Priority = 0,
			ButtonPress = BTN.CROUCH,
			EscortVehicleGoalName = "MOVER_tank",
			LimitTeam = (1<<TEAM.AXIS),
			LimitClass = (1<<CLASS.ENGINEER) | (1<<CLASS.SOLDIER),
			LimitBots = 1,
			Offset =
			{
				Vector3(-60,-215,0),    // Rear, left
				Vector3(60,-215,0),     // Rear, right
				Vector3(-105,10,0),     // Left
				Vector3(105,10,0),      // Right
			},
		},
	},

	// cs: todo: upgrade this to 0.8 goal
	MountVehicle =
	{
		Enabled = true,
		Priority = 0.55,
		LimitClass = (1<<CLASS.ENGINEER) | (1<<CLASS.SOLDIER),
		LimitTeam = Util.AllTeams,
		LimitBots = 1,
	},

	// Conditionals
	Command_Post_Status = 0, // 0 = neutral, 1 = Axis, 2 = Allies
	Tank_Barrier_1 = 0,
	Tank_Barrier_2 = 0,
	Bunker_Door_Destroyed = false,
	FieldRadio_Destroyed = true,
	Safe_Destroyed = false,

	// Dynamite Counters
	Allied_MG_Dyno = 0,
	Command_Post_Dyno = 0,
	Field_Radio_Dyno = 0,
	Safe_Dyno = 0,
	Tank_Barrier_1_Dyno = 0,
	Tank_Barrier_2_Dyno = 0,

	// Tank Positions
	Tank_Near_BarrierOne = false,
	Tank_Near_BarrierTwo = false,
	Tank_Near_BunkerDoor = false,

	Ammo_Cabinet_south_ammocabinet = "AMMOCAB_south_ammocabinet",
	Health_Cabinet_south_healthcabinet = "HEALTHCAB_south_healthcabinet",
	Flag_Das_Kochrezept = "FLAG_Das_Kochrezept",
	Cappoint_FieldRadio = "CAPPOINT_FieldRadio",
	Build_Allied_MG = "BUILD_Allied_MG",
	Build_Command_Post = "BUILD_Command_Post",
	Build_Field_Radio = "BUILD_Field_Radio",
	Build_Tank = "BUILD_Tank",
	Build_Tank_Barrier_1 = "BUILD_Tank_Barrier_1",
	Build_Tank_Barrier_2 = "BUILD_Tank_Barrier_2",
	Plant_Allied_MG = "PLANT_Allied_MG",
	Plant_Command_Post = "PLANT_Command_Post",
	Plant_Field_Radio = "PLANT_Field_Radio",
	Plant_Safe = "PLANT_Safe",
	Plant_Tank_Barrier_1 = "PLANT_Tank_Barrier_1",
	Plant_Tank_Barrier_2 = "PLANT_Tank_Barrier_2",
	Mount_1190 = "MOUNTMG42_1190",
	Mount_Allied_MG = "MOUNTMG42_Allied_MG",
	Mount_axismg = "MOUNTMG42_axismg",
	Repair_1190 = "REPAIRMG42_1190",
	Repair_Allied_MG = "REPAIRMG42_Allied_MG",
	Repair_axismg = "REPAIRMG42_axismg",
	Mover_tank = "MOVER_tank",

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

		// Allied Goals
		SetAvailableMapGoals( TEAM.ALLIES, false, Map.Build_Allied_MG );

		// Axis Goals
		SetAvailableMapGoals( TEAM.AXIS, true, Map.Plant_Allied_MG );

		Util.MapDebugPrint( "Allied_MG_Built" );
	},

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

		Map.Command_Post_Status = 2;

		// Allied Goals
		SetAvailableMapGoals( TEAM.ALLIES, false, Map.Build_Command_Post );
		SetAvailableMapGoals( TEAM.ALLIES, false, Map.Plant_Command_Post );

		// Axis Goals
		SetAvailableMapGoals( TEAM.AXIS, false, Map.Build_Command_Post );
		SetAvailableMapGoals( TEAM.AXIS, true, Map.Plant_Command_Post );

		if ( Map.Tank_Near_BunkerDoor) {
			Util.ChangeSpawn( TEAM.ALLIES, 3 );
		}

		Util.MapDebugPrint( "Allied_Command_Post_Built" );
	},

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

		Map.Command_Post_Status = 1;

		// Allied Goals
		SetAvailableMapGoals( TEAM.ALLIES, false, Map.Build_Command_Post );
		SetAvailableMapGoals( TEAM.ALLIES, true, Map.Plant_Command_Post );

		// Axis Goals
		SetAvailableMapGoals( TEAM.AXIS, false, Map.Built_Command_Post );
		SetAvailableMapGoals( TEAM.AXIS, false, Map.Plant_Command_Post );

		if ( Map.Tank_Near_Barrier_2) {
			Util.ChangeSpawn( TEAM.AXIS, 4 );
		}

		Util.MapDebugPrint( "Axis_Command_Post_Built" );
	},

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

		// Allied Goals
		if ( Map.Tank_Near_BunkerDoor ) {
			SetAvailableMapGoals( TEAM.ALLIES, true, Map.Plant_Field_Radio );
		}

		// Axis Goals
		SetAvailableMapGoals( TEAM.AXIS, false, Map.Build_Field_Radio );
		if ( Map.Safe_Destroyed ) {
			SetAvailableMapGoals( TEAM.AXIS, true, Map.Cappoint_FieldRadio );
		}

		Util.MapDebugPrint( "Field_Radio_Built" );
	},

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

		// Axis Goals
		SetAvailableMapGoals( TEAM.AXIS, false, Map.Build_Tank );
		SetAvailableMapGoals( TEAM.AXIS, true, "ESCORT_Tank" );

		Util.MapDebugPrint( "Tank_Built" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, true, Map.Build_Tank_Barrier_1 );

		Util.MapDebugPrint( "Axis_Driving_Tank" );
	},

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

		Map.Tank_Barrier_1 = 1;

		// Allied Goals
		SetAvailableMapGoals( TEAM.ALLIES, false, Map.Build_Tank_Barrier_1 );

		// Axis Goals
		if ( Map.Tank_Near_BarrierOne ) {
			SetAvailableMapGoals( TEAM.AXIS, true, Map.Plant_Tank_Barrier_1 );
		}

		Util.MapDebugPrint( "Tank_Barrier_1_Built" );
	},

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

		Map.Tank_Barrier_2 = 1;

		// Allied Goals
		SetAvailableMapGoals( TEAM.ALLIES, false, Map.Build_Tank_Barrier_2 );

		// Axis Goals
		if ( Map.Tank_Near_BarrierTwo ) {
			SetAvailableMapGoals( TEAM.AXIS, true, Map.Plant_Tank_Barrier_2 );
		}

		Util.MapDebugPrint( "Tank_Barrier_2_Built" );
	},

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

		Map.Allied_MG_Dyno += 1;

		Util.MapDebugPrintt( "Allied_MG_Planted" );
	},

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

		Map.Command_Post_Dyno += 1;

		Util.MapDebugPrint( "Command_Post_Planted" );
	},

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

		Map.Field_Radio_Dyno += 1;

		Util.MapDebugPrint( "Field_Radio_Planted" );
	},

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

		Map.Safe_Dyno += 1;

		Util.MapDebugPrint( "Safe_Planted" );
	},

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

		Map.Tank_Barrier_1_Dyno += 1;

		Util.MapDebugPrint( "Tank_Barrier_1_Planted" );
	},

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

		Map.Tank_Barrier_2_Dyno += 1;

		Util.MapDebugPrint( "Tank_Barrier_2_Planted" );
	},

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

		Util.MapDebugPrint( "Allied_MG_Defused" );
	},

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

		Map.Command_Post_Dyno -= 1;

		Util.MapDebugPrint( "Command_Post_Defused" );
	},

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

		Map.Field_Radio_Dyno -= 1;

		Util.MapDebugPrint( "Field_Radio_Defused" );
	},

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

		Map.Safe_Dyno -= 1;

		Util.MapDebugPrint( "Safe_Defused" );
	},

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

		Map.Tank_Barrier_1_Dyno -= 1;

		Util.MapDebugPrint( "Tank_Barrier_1_Defused" );
	},

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

		Map.Tank_Barrier_2_Dyno -= 1;

		Util.MapDebugPrint( "Tank_Barrier_2_Defused" );
	},

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

		SetAvailableMapGoals( TEAM.ALLIES, true, Map.Build_Allied_MG );

		Util.MapDebugPrint( "Allied_MG_Destroyed" );
	},

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

		// Allied Goals
		SetAvailableMapGoals ( TEAM.ALLIES, true, Map.Build_Command_Post);

		// Axis Goals
		SetAvailableMapGoals( TEAM.AXIS, true, Map.Build_Command_Post );
		SetAvailableMapGoals( TEAM.AXIS, false, Map.Plant_Command_Post );

		Util.MapDebugPrint( "Allied_Command_Post_Destroyed" );
	},

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

		// Allied Goals
		SetAvailableMapGoals( TEAM.ALLIES, true, Map.Build_Command_Post );
		SetAvailableMapGoals( TEAM.ALLIES, false, Map.Plant_Command_Post);

		// Axis goals
		SetAvailableMapGoals( TEAM.AXIS, true, Map.Build_Command_Post);

		Util.MapDebugPrint( "Axis_Command_Post_Destroyed" );
	},

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

		Map.FieldRadio_Destroyed = true;

		// Allied Goals
		SetAvailableMapGoals( TEAM.ALLIES, false, Map.Plant_Field_Radio );

		// Axis Goals
		SetAvailableMapGoals( TEAM.AXIS, false, Map.Cappoint_FieldRadio );
		SetAvailableMapGoals( TEAM.AXIS, false, Map.Build_Field_Radio );
		if ( Map.Safe_Destroyed ) {
			SetAvailableMapGoals( TEAM.AXIS, true, Map.Build_Field_Radio );
		}

		Util.MapDebugPrint( "Field_Radio_Destroyed" );
	},

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

		Map.Safe_Destroyed = true;

		// Allied Goals
		SetAvailableMapGoals( TEAM.ALLIES, true, Map.Plant_Field_Radio );

		// Axis Goals
		SetAvailableMapGoals( TEAM.AXIS, true, Map.Flag_Das_Kochrezept );
		SetAvailableMapGoals( TEAM.AXIS, true, Map.Cappoint_FieldRadio );

		Util.MapDebugPrint( "Safe_Destroyed" );
	},

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

		Util.SetPositionGoal( Map.Build_Tank, Map.Mover_tank );

		if ( !Map.Tank_Near_BunkerDoor ) {
			SetAvailableMapGoals( TEAM.AXIS, true, Map.Build_Tank );
		}

		Util.MapDebugPrint( "Tank_Destroyed" );
	},

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

		Map.Tank_Barrier_1 = 0;

		SetAvailableMapGoals( TEAM.ALLIES, true, Map.Build_Tank_Barrier_1 );

		SetAvailableMapGoals( TEAM.AXIS, false, Map.Plant_Tank_Barrier_1 );

		Util.MapDebugPrint( "Tank_Barrier_1_Destroyed" );
	},

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

		Map.Tank_Barrier_2 = 0;

		SetAvailableMapGoals( TEAM.ALLIES, true, Map.Build_Tank_Barrier_2 );

		SetAvailableMapGoals( TEAM.AXIS, false, Map.Plant_Tank_Barrier_2 );

		Util.MapDebugPrint( "Tank_Barrier_2_Destroyed" );
	},

	Tank_At_Barrier_1 = function ()
	{
		if ( TestMap )
			{ return; }

		Map.Tank_Near_BarrierOne = true;

		SetAvailableMapGoals( TEAM.ALLIES, false, ".*Allies_Ambush.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allies_BarrierOne.*" );

		if ( Map.Tank_Barrier_1 == 1 ) {
			SetAvailableMapGoals( TEAM.AXIS, true, Map.Plant_Tank_Barrier_1 );
		}

		Util.MapDebugPrint( "Tank_At_Barrier_1" );
	},

	Tank_At_Barrier_2 = function ()
	{
		if ( TestMap )
			{ return; }

		Map.Tank_Near_BarrierTwo = true;

		if ( Map.Tank_Barrier_2 == 1 ) {
			SetAvailableMapGoals( TEAM.AXIS, true, Map.Plant_Tank_Barrier_2 );
		}

		Util.MapDebugPrint( "Tank_At_Barrier_2" );
	},

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

		Util.ChangeSpawn( TEAM.ALLIES, 6 );

		// Allied Goals
		SetAvailableMapGoals( TEAM.ALLIES, false, Map.Build_Tank_Barrier_1 );
		SetAvailableMapGoals( TEAM.ALLIES, false, Map.Build_Allied_MG );
		SetAvailableMapGoals( TEAM.ALLIES, false, ".*_Allies_BarrierOne.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, Map.Build_Tank_Barrier_2 );
		SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allies_BarrierTwo.*" );

		// Axis Goals
		SetAvailableMapGoals( TEAM.AXIS, false, Map.Plant_Allied_MG );
		SetAvailableMapGoals( TEAM.AXIS, true, Map.Plant_Tank_Barrier_1 );
		SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_BarrierOne.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, Map.Plant_Tank_Barrier_2 );
		SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_BarrierTwo.*" );

		Util.MapDebugPrint( "Tank_Barrier_1_Lost" );
	},

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

		// Allied Goals
		SetAvailableMapGoals( TEAM.ALLIES, false, Map.Build_Tank_Barrier_2 );
		SetAvailableMapGoals( TEAM.ALLIES, true, Map.Build_Command_Post );

		// Axis Goals
		SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_BarrierTwo.*" );

		Util.MapDebugPrint( "Tank_Barrier_2_Lost" );
	},

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

		Map.Tank_Near_BunkerDoor = true;

		// Allied Goals
		SetAvailableMapGoals( TEAM.ALLIES, false, ".*_Allies_BarrierTwo.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allies_Guard.*" );

		// Axis Goals
		SetAvailableMapGoals( TEAM.AXIS, true, Map.Build_Command_Post );
		SetAvailableMapGoals( TEAM.AXIS, true, Map.Build_Field_Radio );

		Util.MapDebugPrint( "Tank_Near_Bunker_Door" );
	},

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

		Map.Bunker_Door_Destroyed = true;

		ETUtil.SwitchWeapon(WEAPON.FLAMETHROWER);

		// Allied Goals
		SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allies_Safe.*" );
		if ( !Map.FieldRadio_Destroyed ) {
			SetAvailableMapGoals( TEAM.ALLIES, true, Map.Plant_Field_Radio);
		}


		// Axis Goals
		SetAvailableMapGoals( TEAM.AXIS, false, Map.Build_Tank );
		SetAvailableMapGoals( TEAM.AXIS, false, "ESCORT_Tank" );
		if ( Map.FieldRadio_Destroyed ) {
			SetAvailableMapGoals( TEAM.AXIS, true, Map.Build_Field_Radio);
		}
		SetAvailableMapGoals( TEAM.AXIS, true, Map.Plant_Safe );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Allies_Safe.*" ); // Let them fight for it

		Util.MapDebugPrint( "Bunker_Door_Destroyed" );
	},

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

		// Allied Goals
		SetAvailableMapGoals( TEAM.ALLIES, false, ".*_Allies_Guard.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, ".*_Allies_Safe.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allies_FieldRadio.*" );

		// Axis Goals
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Allies_Safe.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_Axis_FieldRadio" );

		Util.MapDebugPrint( "Das_Kochrezept_Taken" );
	},

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

		// Allied Goals
		SetAvailableMapGoals( TEAM.ALLIES, false, ".*_Allies_FieldRadio.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allies_Guard.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allies_Safe.*" );

		// Axis Goals
		SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_Axis_FieldRadio" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Allies_Safe.*" );

		Util.MapDebugPrint( "Das_Kochrezept_Returned" );
	},

	Das_Kochrezept_Secured = function( trigger ) // Game Over
	{
		if ( TestMap )
			{ return; }

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

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

	// Register callback functions
	OnTrigger( "^3Allied MG nest constructed!", Map.Allied_MG_Built );
	OnTrigger( "Allied Command Post constructed. Charge speed increased!^3 CP Spawn act", Map.Allied_Command_Post_Built );
	OnTrigger( "Axis Command Post constructed. Charge speed increased!^3 CP Spawn activ", Map.Axis_Command_Post_Built );
	OnTrigger( "^3The Axis Field Radio has been constructed.", Map.Field_Radio_Built );
	OnTrigger( "^3The Tank has been repaired!", Map.Tank_Built );
	OnTrigger( "Axis team are driving with the Tank !", Map.Axis_Driving_Tank );
	OnTrigger( "^3The Tank has been damaged!", Map.Tank_Destroyed );
	OnTrigger( "^3Tank Barrier #1 has been constructed.", Map.Tank_Barrier_1_Built );
	OnTrigger( "^3Tank Barrier #2 has been constructed.", Map.Tank_Barrier_2_Built );
	OnTrigger( "Planted at the Allied MG.", Map.Allied_MG_Planted );
	OnTrigger( "Planted at the Command Post.", Map.Command_Post_Planted );
	OnTrigger( "Planted at the Field Radio.", Map.Field_Radio_Planted );
	OnTrigger( "Planted at the Safe.", Map.Safe_Planted );
	OnTrigger( "Planted at Tank Barrier #1.", Map.Tank_Barrier_1_Planted );
	OnTrigger( "Planted at Tank Barrier #2.", Map.Tank_Barrier_2_Planted );
	OnTrigger( "Defused at the Allied MG.", Map.Allied_MG_Defused );
	OnTrigger( "Defused at the Command Post.", Map.Command_Post_Defused );
	OnTrigger( "Defused at the Field Radio.", Map.Field_Radio_Defused );
	OnTrigger( "Defused at the Safe.", Map.Safe_Defused );
	OnTrigger( "Defused at Tank Barrier #1.", Map.Tank_Barrier_1_Defused );
	OnTrigger( "Defused at Tank Barrier #2.", Map.Tank_Barrier_2_Defused );
	OnTrigger( "^3Axis team has destroyed the Allied MG nest!", Map.Allied_MG_Destroyed );
	OnTrigger( "Axis team has destroyed the Allied Command Post!", Map.Allied_Command_Post_Destroyed );
	OnTrigger( "Allied team has destroyed the Axis Command Post!", Map.Axis_Command_Post_Destroyed );
	OnTrigger( "^3Allies have destroyed the Axis Field Radio.", Map.Field_Radio_Destroyed );
	OnTrigger( "Axis have destroyed the ^3Safe Door^1 !", Map.Safe_Destroyed );
	OnTrigger( "^3Tank Barrier #1 has been destroyed.", Map.Tank_Barrier_1_Destroyed );
	OnTrigger( "^3Tank Barrier #2 has been destroyed.", Map.Tank_Barrier_2_Destroyed );
	OnTrigger( "^3The Tank is past the first Barrier!", Map.Tank_Barrier_1_Lost );
	OnTrigger( "^3The Tank is past the second Barrier!", Map.Tank_Barrier_2_Lost );
	OnTrigger( "^3 Axis have Destroyed the Bunker Door !", Map.Bunker_Door_Destroyed );
	OnTrigger( "Axis have taken Das Kochrezept!", Map.Das_Kochrezept_Taken );
	OnTrigger( "Allies have returned Das Kochrezept!", Map.Das_Kochrezept_Returned );
	OnTrigger( "axis_cap", Map.Das_Kochrezept_Secured );

	//~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} );


	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;
};
