//==========================================================================================
//
//	field_hq_b4.gm
//
//	This map has a bug allowing documents to be capped at keycard cappoint instead at HQ cappoint
//
//	Who      	When		What
//------------------------------------------------------------------------------------------
//	Native12	12 May 2013	Initial Script
//	Native12	28.05.2013	Ready to test
//	Native12	02.06.2013	Added routes, Fixed stuckages, script bugs.....
//	Native12	03.06.2013	Added "OnTrigger" for ETnam
//
//==========================================================================================
//

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

	Allied_Command_Center_Dyno = 0,
	Command_Post_Dyno = 0,
	Main_Entrance_Dyno = 0,
	Side_Entrance_Dyno = 0,

	MainEntranceDestroyed = false,
	SideEntranceDestroyed = false,
	RoadbunkerAxis = true,
	RoadbunkerPermanentlyAllies = false,
	KeycardTaken = false,
	KeycardSecured = false,
	DocumentsTaken = false,
	Allies_Win = false,
	AlliedCommandCenterBuilt = false,
	AlliedCP_Built = false,
	AxisCP_Built = false,
	AlliesInside = 0,
	DoorsOpened = false,
	FirstEnter = true,

	DispenseAmmoTime = 27,

	Roles =
	{
		AXIS =
		{
			AllBots = true,
			DEFENDER =
			{
				numbots = 5,
				crucialClass = CLASS.ENGINEER,
			},
			DEFENDER1 =
			{
				numbots = 8,
				crucialClass = CLASS.ENGINEER,
			},
		},
		ALLIES =
		{
			AllBots = true,
			ATTACKER =
			{
				numbots = 5,
				crucialClass = CLASS.ENGINEER,
			},
			ATTACKER1 =
			{
				numbots = 8,
				crucialClass = CLASS.ENGINEER,
			},
		},
	},

	Allied_Command_Center_Built = function( trigger )
	{

		//wm_announce does not work, therefore
		//initialized in thread: testTraceLineThread

		SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Allied_Command_Center" );

		if ( Map.KeycardSecured )
		{
			if ( !Map.DocumentsTaken )
			{
				Util.SetMaxUsers( 1, "PLANT_Allied_Command_Center" );
			}
			else
			{
				Util.SetMaxUsers( 2, "PLANT_Allied_Command_Center" );
			}
		}

		SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Allied_Command_Center" );

		if ( Map.DocumentsTaken )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_Axis_SafePlace_.*" );

			SetAvailableMapGoals( TEAM.ALLIES, false, "CAPPOINT_Safe_place" );

			SetAvailableMapGoals( TEAM.ALLIES, true, "CAPPOINT_Transmitter" );
		}

		Util.MapDebugPrint( "^5Allied_Command_Center_Built" );
	},

	Allied_Command_Center_Planted = function( trigger )
	{

		Map.Allied_Command_Center_Dyno += 1;

		Util.MapDebugPrint( "^5Allied_Command_Center_Planted" );
	},

	Allied_Command_Center_Defused = function( trigger )
	{

		Map.Allied_Command_Center_Dyno -= 1;

		Util.MapDebugPrint( "^5Allied_Command_Center_Defused" );
	},

	Allied_Command_Center_Destroyed = function( trigger )
	{

		//wm_announce does not work, therefore
		//initialized in thread: testTraceLineThread

		Map.Allied_Command_Center_Dyno = 0;

		SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Allied_Command_Center" );

		if ( Map.MainEntranceDestroyed or Map.SideEntranceDestroyed )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Allied_Command_Center" );
		}

		if ( Map.DocumentsTaken )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "CAPPOINT_Transmitter" );

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

			SetAvailableMapGoals( TEAM.ALLIES, true, "CAPPOINT_Safe_place" );
		}

		Util.MapDebugPrint( "^5Allied_Command_Center_Destroyed" );
	},

	Axis_Command_Post_Built = function( trigger )
	{

		Map.AxisCP_Built = true;

		SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Command_Post" );

		SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Command_Post" );

		if ( Map.MainEntranceDestroyed or Map.SideEntranceDestroyed )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Command_Post" );
		}

		Util.MapDebugPrint( "^5Axis_Command_Post_Built" );
	},

	Allied_Command_Post_Built = function( trigger )
	{

		Map.AlliedCP_Built = true;

		SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Command_Post" );

		SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Command_Post" );

		SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Command_Post" );

		Util.MapDebugPrint( "^5Allied_Command_Post_Built" );
	},

	Command_Post_Planted = function( trigger )
	{

		Map.Command_Post_Dyno += 1;

		if ( Map.KeycardSecured and Map.AxisCP_Built )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "DEFUSE_Command_Post_.*" );
		}

		Util.MapDebugPrint( "^5Command_Post_Planted" );
	},

	Command_Post_Defused = function( trigger )
	{

		Map.Command_Post_Dyno -= 1;

		Util.MapDebugPrint( "^5Command_Post_Defused" );
	},

	Axis_Command_Post_Destroyed = function( trigger )
	{

		Map.Command_Post_Dyno = 0;
		Map.AxisCP_Built = false;

		SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Command_Post" );

		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" );

		if ( Map.MainEntranceDestroyed or Map.SideEntranceDestroyed )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
		}

		Util.MapDebugPrint( "^5Axis_Command_Post_Destroyed" );
	},

	Allied_Command_Post_Destroyed = function( trigger )
	{

		Map.Command_Post_Dyno = 0;
		Map.AlliedCP_Built = false;

		SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Command_Post" );

		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" );

		if ( Map.MainEntranceDestroyed or Map.SideEntranceDestroyed )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
		}

		Util.MapDebugPrint( "^5Allied_Command_Post_Destroyed" );
	},

	Main_Entrance_Planted = function( trigger )
	{

		Map.Main_Entrance_Dyno += 1;

		Util.MapDebugPrint( "^5Main_Entrance_Planted" );
	},

	Main_Entrance_Defused = function( trigger )
	{

		Map.Main_Entrance_Dyno -= 1;

		Util.MapDebugPrint( "^5Main_Entrance_Defused" );
	},

	Main_Entrance_Destroyed = function( trigger )
	{

		if ( Map.Main_Entrance_Dyno > 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "DEFUSE_Main_Entrance_.*" );
		}

		Map.Main_Entrance_Dyno = 0;
		Map.MainEntranceDestroyed = true;

		Util.EnableGoal("ROUTE_MainDoor_Way");

		Util.ClearRoleForGoals(".*_Axis_MainEntrance_.*", ROLE.DEFENDER1);

		SetAvailableMapGoals( TEAM.ALLIES, false, ".*_Allies_MainEntrance_.*" );

		SetGoalPriority( "FLAG_keycard", 0.8, TEAM.ALLIES, 0 );	//default value

		if ( !Map.SideEntranceDestroyed )
		{
			WeaponTable.SetWeaponTeamAvailability ( TEAM.AXIS, CLASS.SOLDIER, WEAPON.MOBILE_MG42, true );

			if ( ETUtil.CountClass( TEAM.AXIS, CLASS.SOLDIER ) > 1 )
			{
				WeaponTable.SetWeaponTeamAvailability ( TEAM.AXIS, CLASS.SOLDIER, WEAPON.PANZERFAUST, true );

				if( GetModName() == "noquarter" )
				{
					WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.STG44, true );
				}
			}
			else
			{
				WeaponTable.SetWeaponTeamAvailability ( TEAM.AXIS, CLASS.SOLDIER, WEAPON.PANZERFAUST, false );

				if( GetModName() == "noquarter" )
				{
					WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.STG44, false );
				}
			}

			SetAvailableMapGoals( TEAM.AXIS, false, {
				"DEFEND_Axis_MainEntrance_.*",
				".*_Axis_SideEntrance_.*",
			});

			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"AMMOCAB_south_ammocabinet",
				"HEALTHCAB_south_healthcabinet",
			});

			if ( Map.RoadbunkerAxis )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_roadbunker" );
			}

			if ( !Map.KeycardTaken )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					"DEFEND_Axis_SideWayToFlag_02",
					"DEFEND_Axis_SideEntrance_01",
					"DEFEND_Axis_SideEntrance_02",
					".*_Axis_KeyCard_.*",
				});

				SetAvailableMapGoals( TEAM.ALLIES, true, "FLAG_keycard" );
			}
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, false, {
				"DEFEND_Axis_SideWayToFlag_03",
				"DEFEND_Axis_SideWayToFlag_04",
				"DEFEND_Axis_MainEntrance_.*",
			});

			if ( !Map.KeycardSecured )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "PLANTMINE_Axis_SecurContr_.*" );
			}

			if ( !Map.AxisCP_Built and !Map.AlliedCP_Built)
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
			}

			if ( Map.AxisCP_Built )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Command_Post" );
			}

			if ( !Map.AlliedCommandCenterBuilt )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Allied_Command_Center" );
			}

			if ( !Map.KeycardTaken )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_KeyCard_.*" );
			}
		}

		Util.MapDebugPrint( "^5Main_Entrance_Destroyed" );

		foreach ( id and bot in BotTable )
		{
			if ( bot.GetTeam() == TEAM.AXIS )
			{
				if ( bot.GetClass() == CLASS.SOLDIER )
				{
					if( GetModName() == "noquarter" )
					{
						if ( bot.HasWeapon(WEAPON.FLAMETHROWER) or bot.HasWeapon(WEAPON.MORTAR) or bot.HasWeapon(WEAPON.PANZERFAUST) or bot.HasWeapon(WEAPON.STG44) )
						{
							b = bot.GetReinforceTime();

							while ( b > 2)
							{
								sleep(1);
								b -= 1;
							}

							bot.ExecCommand( "kill" );

							Util.MapDebugPrint( "^5I have wrong weapon" );
						}
					}
					else
					{
						if ( bot.HasWeapon(WEAPON.FLAMETHROWER) or bot.HasWeapon(WEAPON.MORTAR) or bot.HasWeapon(WEAPON.PANZERFAUST) )
						{
							b = bot.GetReinforceTime();

							while ( b > 2)
							{
								sleep(1);
								b -= 1;
							}

							bot.ExecCommand( "kill" );

							Util.MapDebugPrint( "^5I have wrong weapon" );
						}
					}
				}
			}
		}
	},

	Side_Entrance_Planted = function( trigger )
	{

		Map.Side_Entrance_Dyno += 1;

		Util.MapDebugPrint( "^5Side_Entrance_Planted" );
	},

	Side_Entrance_Defused = function( trigger )
	{

		Map.Side_Entrance_Dyno -= 1;

		Util.MapDebugPrint( "^5Side_Entrance_Defused" );
	},

	Side_Entrance_Destroyed = function( trigger )
	{

		if ( Map.Side_Entrance_Dyno > 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "DEFUSE_Side_Entrance_.*" );
		}

		Map.Side_Entrance_Dyno = 0;
		Map.SideEntranceDestroyed = true;

		Util.EnableGoal("ROUTE_SideDoor_Way");

		Util.ClearRoleForGoals("DEFEND_Axis_SideEntrance_.*", ROLE.DEFENDER);
		SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_SideEntrance_.*" );

		SetAvailableMapGoals( TEAM.ALLIES, false, ".*_Allies_SideEntrance_.*" );

		if ( !Map.MainEntranceDestroyed )
		{
			WeaponTable.SetWeaponTeamAvailability ( TEAM.AXIS, CLASS.SOLDIER, WEAPON.MOBILE_MG42, true );

			if ( ETUtil.CountClass( TEAM.AXIS, CLASS.SOLDIER ) > 1 )
			{
				WeaponTable.SetWeaponTeamAvailability ( TEAM.AXIS, CLASS.SOLDIER, WEAPON.PANZERFAUST, true );

				if( GetModName() == "noquarter" )
				{
					WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.STG44, true );
				}
			}
			else
			{
				WeaponTable.SetWeaponTeamAvailability ( TEAM.AXIS, CLASS.SOLDIER, WEAPON.PANZERFAUST, false );

				if( GetModName() == "noquarter" )
				{
					WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.STG44, false );
				}
			}

			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"AMMOCAB_south_ammocabinet",
				"HEALTHCAB_south_healthcabinet",
			});

			if ( Map.RoadbunkerAxis )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_roadbunker" );
			}

			if ( !Map.KeycardTaken )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					"MOBILEMG42_Axis_KeyCard_.*",
					"DEFEND_Axis_SideWayToFlag_.*",
				});

				SetAvailableMapGoals( TEAM.ALLIES, true, "FLAG_keycard" );
			}
		}
		else
		{
			if ( !Map.KeycardSecured )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					"PLANTMINE_Axis_SecurContr_.*",
					"DEFEND_Axis_SideWayToFlag_01",
					"DEFEND_Axis_SideWayToFlag_02",
				});
			}

			if ( !Map.AxisCP_Built and !Map.AlliedCP_Built)
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
			}

			if ( Map.AxisCP_Built )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Command_Post" );
			}

			if ( !Map.AlliedCommandCenterBuilt )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Allied_Command_Center" );
			}
		}

		Util.MapDebugPrint( "^5Side_Entrance_Destroyed" );

		foreach ( id and bot in BotTable )
		{
			if ( bot.GetTeam() == TEAM.AXIS )
			{
				if ( bot.GetClass() == CLASS.SOLDIER )
				{
					if( GetModName() == "noquarter" )
					{
						if ( bot.HasWeapon(WEAPON.FLAMETHROWER) or bot.HasWeapon(WEAPON.MORTAR) or bot.HasWeapon(WEAPON.PANZERFAUST) or bot.HasWeapon(WEAPON.STG44) )
						{
							b = bot.GetReinforceTime();

							while ( b > 2)
							{
								sleep(1);
								b -= 1;
							}

							bot.ExecCommand( "kill" );

							Util.MapDebugPrint( "^5I have wrong weapon" );
						}
					}
					else
					{
						if ( bot.HasWeapon(WEAPON.FLAMETHROWER) or bot.HasWeapon(WEAPON.MORTAR) or bot.HasWeapon(WEAPON.PANZERFAUST) )
						{
							b = bot.GetReinforceTime();

							while ( b > 2)
							{
								sleep(1);
								b -= 1;
							}

							bot.ExecCommand( "kill" );

							Util.MapDebugPrint( "^5I have wrong weapon" );
						}
					}
				}
			}
		}
	},

	roadbunker_Axis_Captured = function( trigger )
	{

		Map.RoadbunkerAxis = true;

		if ( Map.DocumentsTaken )
		{
			Util.ChangeSpawn( TEAM.AXIS, 2 );	//Forward bunker
		}
		else if ( Map.KeycardSecured and !Map.DocumentsTaken )
		{
			if ( Map.AlliesInside == 0 )
			{
				Util.ChangeSpawn( TEAM.AXIS, 2 );	//Forward bunker
			}
			else
			{
				Util.ChangeSpawn( TEAM.AXIS, 1 );	//Barracks
			}
		}
		else
		{
			Util.ChangeSpawn( TEAM.AXIS, 0 );	//default by game
		}

		SetAvailableMapGoals( TEAM.AXIS, false, "CHECKPOINT_roadbunker" );

		if ( !Map.KeycardTaken )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, {
				"CALLARTILLERY_Axis_MainEntrance_.*",
				"ARTILLERY_S_Axis_MainEntrance_.*",
			});
		}

		if ( Map.MainEntranceDestroyed or Map.SideEntranceDestroyed )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_roadbunker" );
		}

		Util.MapDebugPrint( "^5roadbunker_Axis_Captured" );
	},

	roadbunker_Allies_Captured = function( trigger )
	{

		Map.RoadbunkerAxis = false;

		SetAvailableMapGoals( TEAM.ALLIES, false, "CHECKPOINT_roadbunker" );

		if ( !Map.KeycardTaken )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, {
				"CALLARTILLERY_Axis_MainEntrance_.*",
				"ARTILLERY_S_Axis_MainEntrance_.*",
			});
		}

		if ( !Map.RoadbunkerPermanentlyAllies )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_roadbunker" );
		}

		Util.MapDebugPrint( "^5roadbunker_Allies_Captured" );
	},

	keycard_Taken = function( trigger )
	{

		Map.KeycardTaken = true;

		SetAvailableMapGoals( TEAM.AXIS, false, {
			".*_Axis_KeyCard_.*",
			".*_Axis_MainEntrance_.*",
		});

		SetAvailableMapGoals( TEAM.ALLIES, false, "FLAG_keycard" );

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

		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"CAPPOINT_Security_Controls",
			".*_Allies_SecurContr_.*",
		});

		Util.MapDebugPrint( "^5keycard_Taken" );
	},

	keycard_Returned = function( trigger )
	{

		Map.KeycardTaken = false;

		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_Axis_SecurContr_.*",
			"MOBILEMG42_Axis_SecurContr_.*",
		});

		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"CAPPOINT_Security_Controls",
			".*_Allies_SecurContr_.*",
		});

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

		if ( Map.RoadbunkerAxis )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, {
				".*_Axis_MainEntrance_03",
				".*_Axis_MainEntrance_04",
			});
		}

		SetAvailableMapGoals( TEAM.ALLIES, true, "FLAG_keycard" );

		Util.MapDebugPrint( "^5keycard_Returned" );
	},

	keycard_Secured = function( trigger )
	{

		Map.KeycardSecured = true;

		Util.ChangeSpawn( TEAM.AXIS, 1 );	//Barracks

		SetGoalPriority( "PLANT_Allied_Command_Center", 0.81, TEAM.AXIS, CLASS.ENGINEER );	//default

		if ( Map.AlliedCommandCenterBuilt )
		{
			Map.RoadbunkerAxis = false;
			Map.RoadbunkerPermanentlyAllies = true;	//Allies have permanently Forward Bunker
		}
		else
		{
			Util.SetMaxUsers( 1, "CHECKPOINT_roadbunker" );
		}

		Ally_Inside_1 = OnTriggerRegion(AABB(1156.917,278.753,-58.875,4776.875,3188.212,444.242), Map.Allies_Inside);
		Ally_Inside_2 = OnTriggerRegion(AABB(3327.126,-264.414,118.547,3670.036,240.049,314.875), Map.Allies_Inside);

		Util.ClearRoleForGoals("DEFEND_Axis_SideWayToFlag_.*", ROLE.DEFENDER);

		Util.EnableGoal( "ROUTE_MainDoorToDocs_Way" );
		Util.EnableGoal( "ROUTE_SideWayToDocs" );
		Util.EnableGoal( "ROUTE_SideDoorToDocs_Way" );

		SetAvailableMapGoals( TEAM.ALLIES, false, "CAPPOINT_Security_Controls" );

		if ( Map.AlliedCommandCenterBuilt )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Allied_Command_Center" );
		}

		if ( !Map.AxisCP_Built and !Map.AlliedCP_Built and ( Map.MainEntranceDestroyed or Map.SideEntranceDestroyed ) )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
		}

		if ( Map.AxisCP_Built and ( Map.MainEntranceDestroyed or Map.SideEntranceDestroyed ) )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Command_Post" );
		}

		Util.MapDebugPrint( "^5keycard_Secured" );
	},

	Documents_door_opening = function( trigger )
	{

		Util.MapDebugPrint( "^5Documents_door_opening" );

		sleep(1.8);

		Util.MapDebugPrint( "^5Documents_door_is_open" );

		Util.DisableGoal( ".*", true ); // all but routes

		yield();

		SetGoalPriority( "PLANT_Allied_Command_Center", 0.83, TEAM.AXIS, CLASS.COVERTOPS );

		if ( Map.AlliedCommandCenterBuilt )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Allied_Command_Center" );
		}
		else
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Allied_Command_Center" );
		}

		if ( !Map.AxisCP_Built and !Map.AlliedCP_Built )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" );
		}

		if ( !Map.AxisCP_Built and !Map.AlliedCP_Built and ( Map.MainEntranceDestroyed or Map.SideEntranceDestroyed ) )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
		}

		if ( Map.AxisCP_Built and ( Map.MainEntranceDestroyed or Map.SideEntranceDestroyed ) )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Command_Post" );
		}

		if ( Map.AlliedCP_Built )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Command_Post" );
		}

		if ( !Map.RoadbunkerAxis and !Map.RoadbunkerPermanentlyAllies )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_roadbunker" );
		}

		if ( Map.RoadbunkerAxis )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_roadbunker" );
		}

		if ( !Map.MainEntranceDestroyed )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Main_Entrance" );
		}

		if ( !Map.SideEntranceDestroyed )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Side_Entrance" );
		}

		Map.DoorsOpened = true;
	},

	Allies_Inside =
	{
		Name = "Allies_Inside",
		TriggerOnClass = CLASS.ANYPLAYER,
		OnEnter = function(ent)
		{
			if ( GetEntTeam(ent) == TEAM.ALLIES )
			{
				Map.AlliesInside += 1;
				yield();
				Util.MapDebugPrint( "^5Number of allies inside: "  + Map.AlliesInside );

				if ( Map.AlliesInside == 1 )
				{
					Util.BotChat( TEAM.AXIS, "sayteam", "^1One ally is inside! Defend documents!", 1 );
				}
				else
				{
					Util.BotChat( TEAM.AXIS, "sayteam", "^1" + Map.AlliesInside + " of allies are inside! Defend documents!", 1 );
				}

				while ( !Map.DoorsOpened )
				{
					yield();
				}

				if ( Map.FirstEnter )	//it will run only once after keycard secured
				{			//next time will be allowed in the trigger documents_Returned
					SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_Documents_.*" );

					SetAvailableMapGoals( TEAM.ALLIES, true, "FLAG_documents" );

					yield();

					if ( !Map.RoadbunkerAxis and !Map.RoadbunkerPermanentlyAllies )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_roadbunker" );
					}

					if ( Map.RoadbunkerAxis )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_roadbunker" );
					}

					Map.FirstEnter = false;

					Util.MapDebugPrint( "^5Move action next" );
				}

				if ( !Map.DocumentsTaken )
				{
					if ( Map.RoadbunkerAxis )
					{
						Util.ChangeSpawn( TEAM.AXIS, 1 );	//Barracks

						SetAvailableMapGoals( TEAM.AXIS, false, {
							".*_Axis_CPWay_.*",
							".*_Axis_MainWay_.*",
						});

						SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_Documents_.*" );
					}
				}
			}
		},
		OnExit = function(ent)
		{
			if ( GetEntTeam(ent) == TEAM.ALLIES )
			{
				Map.AlliesInside -= 1;

				yield();
				Util.MapDebugPrint( "^5Number of allies inside: "  + Map.AlliesInside );

				if ( Map.AlliesInside > 1 )
				{
					Util.BotChat( TEAM.AXIS, "sayteam", "^1Still " + Map.AlliesInside + " of allies are inside!", 1 );
				}
				if ( Map.AlliesInside == 1 )
				{

					Util.BotChat( TEAM.AXIS, "sayteam", "^1Still one ally is inside!", 1 );
				}

				if ( Map.AlliesInside == 0 )
				{
					Util.MapDebugPrint( "^5Allies left the complex" );

					Util.BotChat( TEAM.AXIS, "sayteam", "^2Allies left the complex! Documents are safe.", 1 );

					if ( !Map.DocumentsTaken )
					{
						if ( Map.RoadbunkerAxis )
						{
							Util.ChangeSpawn( TEAM.AXIS, 2 );	//Forward bunker

							SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_Documents_.*" );

							SetAvailableMapGoals( TEAM.AXIS, true, {
								".*_Axis_CPWay_.*",
								".*_Axis_MainWay_.*",
							});
						}
						else
						{
							SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_Documents_.*" );
						}
					}
				}
			}
		},
	},

	documents_Taken = function( trigger )
	{

		Map.DocumentsTaken = true;

		if ( Map.RoadbunkerAxis )
		{
			Util.ChangeSpawn( TEAM.AXIS, 2 );	//Forward bunker
		}

		WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.MOBILE_MG42, false );

		if( GetModName() == "noquarter" )
		{
			WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.STG44, true );
		}

		WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.PANZERFAUST, true );

		SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_Documents_.*" );

		SetAvailableMapGoals( TEAM.ALLIES, false, "FLAG_documents" );

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

		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_Both_ACC_.*" );

		if ( Map.AlliedCommandCenterBuilt )
		{
			Util.SetMaxUsers( 2, "PLANT_Allied_Command_Center" );

			SetAvailableMapGoals( TEAM.ALLIES, true, "CAPPOINT_Transmitter" );
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_Axis_SafePlace_.*" );

			SetAvailableMapGoals( TEAM.ALLIES, true, "CAPPOINT_Safe_place" );
		}

		Util.MapDebugPrint( "^5documents_Taken" );
	},

	documents_Returned = function( trigger )
	{

		Map.DocumentsTaken = false;

		WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.MOBILE_MG42, true );

		if( GetModName() == "noquarter" )
		{
			if ( ETUtil.CountClass( TEAM.AXIS, CLASS.SOLDIER ) < 2 )
			{
				WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.STG44, false );
			}
			else
			{
				WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.STG44, true );
			}
		}

		if ( ETUtil.CountClass( TEAM.AXIS, CLASS.SOLDIER ) < 2 )
		{
			WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.PANZERFAUST, false );
		}
		else
		{
			WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.PANZERFAUST, true );
		}

		if ( Map.AlliedCommandCenterBuilt )
		{
			Util.SetMaxUsers( 1, "PLANT_Allied_Command_Center" );
		}

		if ( Map.AlliedCommandCenterBuilt )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "CAPPOINT_Transmitter" );
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_Axis_SafePlace_.*" );

			SetAvailableMapGoals( TEAM.ALLIES, false, "CAPPOINT_Safe_place" );
		}

		if ( Map.MainEntranceDestroyed or Map.SideEntranceDestroyed )
		{	//Allied infiltrator could take the documents, before the doors were destroyed (maybe impossible :o) )

			SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_Both_ACC_.*" );

			SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_Both_ACC_.*" );

			SetAvailableMapGoals( TEAM.ALLIES, true, "FLAG_documents" );

			if ( !Map.RoadbunkerAxis )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_Documents_.*" );
			}
			else
			{
				if ( Map.AlliesInside == 0 )
				{
					Util.ChangeSpawn( TEAM.AXIS, 2 );	//Forward bunker

					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*_Axis_CPWay_.*",
						".*_Axis_MainWay_.*",
					});
				}
				else
				{
					Util.ChangeSpawn( TEAM.AXIS, 1 );	//Barracks

					SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_Documents_.*" );
				}
			}

		}


		Util.MapDebugPrint( "^5documents_Returned" );
	},

	documents_Secured = function( trigger )
	{

		Util.MapDebugPrint( "^5Allies_Win" );

		Map.Allies_Win = true;
		sleep(1);
		ETUtil.WinningChat( TEAM.ALLIES );
		sleep(1.5);
		ETUtil.LosingChat( TEAM.AXIS );

		Util.MapDebugPrint( "^5documents_Secured" );
	},

	Thirty_second = function( trigger )
	{

		Util.MapDebugPrint( "^5Thirty_second" );

		sleep(30);

		if ( !Map.Allies_Win )
		{
			Util.MapDebugPrint( "^5Axis_Win" );

			sleep(1);
			ETUtil.WinningChat( TEAM.AXIS );
			sleep(1.5);
			ETUtil.LosingChat( TEAM.ALLIES );
		}
	},

	testTraceLineThread = function()
	{
		// two map coordinates:
		start = Vector3(-858, -1576, 296);
		end = Vector3(-1193, -1573, 296);
		Util.MapDebugPrint("^5Allied Command center thread started", true);
		while (1)
		{
			tr = TraceLine(start, end, null, TRACE.SHOT, 0, false);
			// The tr.fraction value tells us of a collision or not.
			// If it's 1, there was no  collision. If less than 1 there was a collision.
			if(tr.fraction < 1)
			{
				if ( !Map.AlliedCommandCenterBuilt )
				{
					Map.Allied_Command_Center_Built();
				}
				Map.AlliedCommandCenterBuilt = true;
				//DrawDebugLine(start, end, COLOR.RED, 2);
			}
			else
			{
				if ( Map.AlliedCommandCenterBuilt )
				{
					Map.Allied_Command_Center_Destroyed();
				}
				Map.AlliedCommandCenterBuilt = false;
				//DrawDebugLine(start, end, COLOR.GREEN, 2);
			}
			sleep(1);
		}
	},

};

global OnMapLoad = function()
{

	// Register callback functions
	//OnTrigger( "The Allies have setup a Field HQ", Map.Allied_Command_Center_Built );	//doesn´t work; initialized
																						//in thread: testTraceLineThread
	OnTrigger( "Planted at the Allied Command Center.", Map.Allied_Command_Center_Planted );
	OnTrigger( "Planted at Allied Command Center.", Map.Allied_Command_Center_Planted );	//Nitmod
	OnTrigger( "Defused at the Allied Command Center.", Map.Allied_Command_Center_Defused );
	OnTrigger( "Defused at Allied Command Center.", Map.Allied_Command_Center_Defused );	//Nitmod
	//OnTrigger( "The Axis have destroyed the Allied Field HQ.", Map.Allied_Command_Center_Destroyed );	//doesn´t work; initialized
																										//in thread: testTraceLineThread

	OnTrigger( "Planted at the Main Entrance.", Map.Main_Entrance_Planted );
	OnTrigger( "Planted at Main Entrance.", Map.Main_Entrance_Planted );	//Nitmod
	OnTrigger( "Defused at the Main Entrance.", Map.Main_Entrance_Defused );
	OnTrigger( "Defused at Main Entrance.", Map.Main_Entrance_Defused );	//Nitmod
	OnTrigger( "Allies have breached the Main Entrance", Map.Main_Entrance_Destroyed );

	OnTrigger( "Planted at the Side Entrance.", Map.Side_Entrance_Planted );
	OnTrigger( "Planted at Side Entrance.", Map.Side_Entrance_Planted );	//Nitmod
	OnTrigger( "Defused at the Side Entrance.", Map.Side_Entrance_Defused );
	OnTrigger( "Defused at Side Entrance.", Map.Side_Entrance_Defused );	//Nitmod
	OnTrigger( "Allies have breached the Side Entrance!", Map.Side_Entrance_Destroyed );

	OnTrigger( "Axis reclaim the Forward Bunker!", Map.roadbunker_Axis_Captured );
	OnTrigger( "Allies capture the Forward Bunker!", Map.roadbunker_Allies_Captured );

	OnTrigger( "Allied Command Post constructed. Charge speed increased!", Map.Allied_Command_Post_Built );
	OnTrigger( "Axis Command Post constructed. Charge speed increased!", Map.Axis_Command_Post_Built );
	OnTrigger( "Planted at the Command Post.", Map.Command_Post_Planted );
	OnTrigger( "Planted at Command Post.", Map.Command_Post_Planted );	//Nitmod
	OnTrigger( "Defused at the Command Post.", Map.Command_Post_Defused );
	OnTrigger( "Defused at Command Post.", Map.Command_Post_Defused );	//Nitmod
	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( "Allies have stolen the Key Card!", Map.keycard_Taken );
	OnTrigger( "USA have stolen the Key Card!", Map.keycard_Taken );	//ETnam
	OnTrigger( "Flag returned keycard!", Map.keycard_Returned );
	OnTrigger( "Allies have gained access to the War Room!", Map.keycard_Secured );

	OnTrigger( "Allies have stolen the Secret Documents!", Map.documents_Taken );
	OnTrigger( "USA have stolen the Secret Documents!", Map.documents_Taken );	//ETnam
	OnTrigger( "Flag returned documents!", Map.documents_Returned );
	OnTrigger( "Allies captured documents_exitpoint", Map.documents_Secured );

	OnTrigger( "door4_Moving", Map.Documents_door_opening );

	OnTrigger( "thirty second warning.", Map.Thirty_second );

	Util.DisableGoal( ".*", true ); // all but routes

	SetAvailableMapGoals( TEAM.AXIS, true, {
		".*_Axis_SideEntrance_.*",
		".*_Axis_MainEntrance_.*",
		"BUILD_Command_Post",
		"AMMOCAB_south_ammocabinet",
		"HEALTHCAB_south_healthcabinet",
	});

	SetAvailableMapGoals( TEAM.ALLIES, true, {
		"PLANT_Main_Entrance",
		"PLANT_Side_Entrance",
		".*_Allies_SideEntrance_.*",
		".*_Allies_MainEntrance_.*",
	});

	SetGoalPriority( "CHECKPOINT_roadbunker", 0.8, 0, 0 );

	SetGoalPriority( "PLANT_Allied_Command_Center", 0.82, TEAM.AXIS, CLASS.COVERTOPS );
	SetGoalPriority( "PLANT_Allied_Command_Center", 0.78, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "AIRSTRIKE_Axis_MainEntrance_13", 0.81, TEAM.AXIS, CLASS.FIELDOPS );
	SetGoalPriority( "MOBILEMG42_Axis_KeyCard_13", 1.01, TEAM.AXIS, CLASS.SOLDIER );
	SetGoalPriority( "ATTACK_Axis_SafePlace_.*", 0.52, TEAM.AXIS, 0 );

	SetGoalPriority( "FLAG_keycard", 0.5, TEAM.ALLIES, 0 );

	Util.ChangeSpawn( TEAM.AXIS, 0 );	//default by game

	// Max users per goal
	Util.SetMaxUsers( 1, "DEFEND_.*" );
	Util.SetMaxUsers( 1, "GRENADE_.*" );
	Util.SetMaxUsers( 1, "MOUNTMG42_.*" );
	Util.SetMaxUsers( 1, "BUILD_Command_Post" );
	Util.SetMaxUsers( 2, "CHECKPOINT_roadbunker" );
	Util.SetMaxUsers( 2, "PLANT_Allied_Command_Center" );

	Util.SetRoleForGoals("DEFEND_Axis_SideEntrance_.*", ROLE.DEFENDER);
	Util.SetRoleForGoals("DEFEND_Axis_SideWayToFlag_.*", ROLE.DEFENDER);
	Util.SetRoleForGoals("DEFEND_Axis_CPWay_.*", ROLE.DEFENDER);
	Util.SetRoleForGoals(".*_Axis_MainEntrance_.*", ROLE.DEFENDER1);
	Util.SetRoleForGoals("DEFEND_Axis_MainWay_.*", ROLE.DEFENDER1);

	Util.SetRoleForGoals(".*_Allies_SideEntrance_.*", ROLE.ATTACKER);
	Util.SetRoleForGoals(".*_Allies_MainEntrance_.*", ROLE.ATTACKER1);

	Util.LimitToClass("PLANT_Command_Post", 0, CLASS.COVERTOPS);

	Util.AddUseWp( "BUILD_Allied_Command_Center", "WP_Build_ACC" );
	Util.AddUseWp( "PLANT_Allied_Command_Center", "WP_Build_ACC" );

	RegionTrigger.Create(AABB(-22.196,407.126,-54.875,156.206,484.536,64.826), "DisableCombatMovement", "Window_Side_Entrance");
	RegionTrigger.Create(AABB(-22.196,407.126,-54.875,156.206,484.536,64.826), "DisableBotPush", "");
	RegionTrigger.Create(AABB(2247.125,-838.332,337.125,2285.127,-520.456,433.678), "DisableCombatMovement", "Window_Main_Entrance");
	RegionTrigger.Create(AABB(2247.125,-838.332,337.125,2285.127,-520.456,433.678), "DisableBotPush", "");
	RegionTrigger.Create(AABB(2900.752,1303.268,-2.375,3065.440,1548.839,227.125), "DisableCombatMovement", "Boxes_Near_Controls");
	RegionTrigger.Create(AABB(2900.752,1303.268,-2.375,3065.440,1548.839,227.125), "DisableBotPush", "");
	RegionTrigger.Create(AABB(2589.215,688.950,153.128,3012.231,986.156,254.125), "DisableCombatMovement", "Above_Controls");
	RegionTrigger.Create(AABB(2589.215,688.950,153.128,3012.231,986.156,254.125), "DisableBotPush", "");
	RegionTrigger.Create(AABB(2662.861,775.119,-21.569,2968.921,975.990,87.125), "DisableCombatMovement", "In_front_of_Controls");
	RegionTrigger.Create(AABB(2662.861,775.119,-21.569,2968.921,975.990,87.125), "DisableBotPush", "");
	RegionTrigger.Create(AABB(3355.829,1005.916,62.986,3430.540,1105.237,185.166), "DisableCombatMovement", "Around_SecurContr_08");
	RegionTrigger.Create(AABB(3355.829,1005.916,62.986,3430.540,1105.237,185.166), "DisableBotPush", "");
	RegionTrigger.Create(AABB(2540.032,-534.754,129.125,2606.149,-463.209,203.125), "DisableBotPush", "Around_MainEntrance_13");
	RegionTrigger.Create(AABB(4356.125,591.061,126.125,4403.883,667.875,200.125), "DisableCombatMovement", "Around_Documents_02");
	RegionTrigger.Create(AABB(4356.125,591.061,126.125,4403.883,667.875,200.125), "DisableBotPush", "");
	RegionTrigger.Create(AABB(4545.167,583.125,127.125,4678.730,642.025,233.125), "DisableCombatMovement", "Around_Documents_08");
	RegionTrigger.Create(AABB(4545.167,583.125,127.125,4678.730,642.025,233.125), "DisableBotPush", "");
	RegionTrigger.Create(AABB(4344.125,1039.370,130.125,4459.423,1096.875,212.125), "DisableCombatMovement", "Around_Documents_11");
	RegionTrigger.Create(AABB(4344.125,1039.370,130.125,4459.423,1096.875,212.125), "DisableBotPush", "");
	RegionTrigger.Create(AABB(4103.125,583.125,97.125,4163.989,679.017,171.125), "DisableBotPush", "Around_Documents_01");
	RegionTrigger.Create(AABB(183.125,382.593,-62.875,248.968,449.668,11.125), "DisableBotPush", "Axis_Side_Entrance_01");
	RegionTrigger.Create(AABB(2625.368,-1040.124,177.125,2916.416,-878.584,447.979), "DisableCombatMovement", "Stairs_to_MainGate_Window");

	thread(Map.testTraceLineThread);

	Util.DisableGoal( "ROUTE_MainDoor_Way" );
	Util.DisableGoal( "ROUTE_SideDoor_Way" );
	Util.DisableGoal( "ROUTE_MainDoorToDocs_Way" );
	Util.DisableGoal( "ROUTE_SideWayToDocs" );
	Util.DisableGoal( "ROUTE_SideDoorToDocs_Way" );

	print( "^3Omni-bot map script by ^1n^2a^4t^8i^3v^5e12 ^3for " + GetMapName() + " executed." );

	sleep(25);

	SetAvailableMapGoals( TEAM.AXIS, false, "AIRSTRIKE_Axis_MainEntrance_13" );
};

global OnBotJoin = function( bot )
{
	WeaponTable.SetWeaponAvailability( CLASS.SOLDIER, WEAPON.FLAMETHROWER, false );
	WeaponTable.SetWeaponAvailability( CLASS.SOLDIER, WEAPON.MORTAR, false );
	WeaponTable.SetWeaponTeamAvailability( TEAM.ALLIES, CLASS.SOLDIER, WEAPON.MOBILE_MG42, false );

	if ( !Map.MainEntranceDestroyed and !Map.SideEntranceDestroyed )
	{
		WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.MOBILE_MG42, false );

		if ( bot.HasWeapon(WEAPON.FLAMETHROWER) or bot.HasWeapon(WEAPON.MORTAR) or bot.HasWeapon(WEAPON.MOBILE_MG42) )
		{
			bot.ExecCommand( "kill" );
		}
	}
	else
	{
		WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.MOBILE_MG42, true );

		if( GetModName() == "noquarter" )
		{
			if ( ETUtil.CountClass( TEAM.AXIS, CLASS.SOLDIER ) < 2 )
			{
				WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.STG44, false );
			}
			else
			{
				WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.STG44, true );
			}
		}

		if ( ETUtil.CountClass( TEAM.AXIS, CLASS.SOLDIER ) < 2 )
		{
			WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.PANZERFAUST, false );
		}
		else
		{
			WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.SOLDIER, WEAPON.PANZERFAUST, true );
		}

		if ( bot.HasWeapon(WEAPON.FLAMETHROWER) or bot.HasWeapon(WEAPON.MORTAR) )
		{
			bot.ExecCommand( "kill" );
		}

		if( bot.GetTeam() == TEAM.AXIS )
		{
			if ( ETUtil.CountClass( TEAM.AXIS, CLASS.SOLDIER ) < 2 and bot.HasWeapon(WEAPON.PANZERFAUST) )
			{
				bot.ExecCommand( "kill" );
			}

			if( GetModName() == "noquarter" )
			{
				if ( ETUtil.CountClass( TEAM.AXIS, CLASS.SOLDIER ) < 2 and bot.HasWeapon(WEAPON.STG44) )
				{
					bot.ExecCommand( "kill" );
				}
			}
		}
		else
		{
			if ( bot.HasWeapon(WEAPON.MOBILE_MG42) )
			{
				bot.ExecCommand( "kill" );
			}
		}
	}
};

global InitializeRoutes = function()
{
	MapRoutes =
	{
		BUILD_Command_Post =
		{
		},
		BUILD_Allied_Command_Center =
		{
		},
		PLANT_Allied_Command_Center =
		{
		},
		PLANT_Side_Entrance =
		{
			ROUTE_AlliedBarracks_Spawn =
			{
				ROUTE_ACC_Way =
				{
					ROUTE_ACC_Way2 =
					{

					},
				},
			},
		},
		PLANT_Main_Entrance =
		{
		},
		PLANT_Command_Post =
		{
		},
		FLAG_documents =
		{
			ROUTE_AlliedBarracks_Spawn =
			{
				ROUTE_SideWayToDocs =
				{
					ROUTE_SideDoorToDocs_Way =
					{

					},
				},
				ROUTE_MainDoorToDocs_Way =
				{

				},
			},
			ROUTE_ForwardBunker_Spawn1 =
			{
				ROUTE_SideWayToDocs =
				{
					ROUTE_SideDoorToDocs_Way =
					{

					},
				},
				ROUTE_MainDoorToDocs_Way =
				{

				},
			},
			ROUTE_ForwardBunker_Spawn2 =
			{
				ROUTE_SideWayToDocs =
				{
					ROUTE_SideDoorToDocs_Way =
					{

					},
				},
				ROUTE_MainDoorToDocs_Way =
				{

				},
			},
			ROUTE_CP_Spawn =
			{
				ROUTE_SideWayToDocs =
				{
					ROUTE_SideDoorToDocs_Way =
					{

					},
				},
				ROUTE_MainDoorToDocs_Way =
				{

				},
			},
		},
		CAPPOINT_Transmitter =
		{
			ROUTE_FlagDocumentsPlace =
			{
				ROUTE_MainDoor_Way =
				{
					ROUTE_AlliedBarracks_Way =
					{

					},
				},
			},
		},
		FLAG_keycard =
		{
		},
		CHECKPOINT_roadbunker =
		{
			ROUTE_AlliedBarracks_Spawn =
			{
				ROUTE_ACC_Way =
				{
					ROUTE_ACC_Way2 =
					{
						ROUTE_SideDoor_Way =
						{

						},
					},
				},
				ROUTE_MainDoor_Way =
				{

				},
			},
		},
	};

	MapRoutes[".*_Allies_SideEntrance_.*"] = MapRoutes.PLANT_Side_Entrance;

	Util.Routes(MapRoutes);
};
