//==========================================================================================
//
//	fueldump.gm
//
//	Who      	When		What
//------------------------------------------------------------------------------------------
// Qiki     12.12.2014	Improved: ways, defends, attacks, escort, triggers for Nitmod, DisableBotPush regions, more artillery and airstrikes,
//                    	SWITCH_Garage_Door, path to allied command post garage roof,
//                    	ESCORT_tank is disabled after depot gates are destroyed, MOUNT_tank is enabled after side wall is destroyed
// palota   29.12.2014	BUILD_East_Axis_Base_Fortification is enabled (but has low priority), Allies can destroy damaged Axis_Base_Fortification,
//                    	fixed goal availability when bridge is destroyed/damaged or build/reinforced,
//                    	commented out empty functions, optimized routes
//
//==========================================================================================
//

global Map =
{
	Debug = 0,

	DispenseHealthTime = 10.0,
	DispenseAmmoTime = 1.0,
	DefendingTeam = TEAM.AXIS, //needed for IntrusionWarning

	Tank_Pass_Tunnel = false,
	Tunnel_Doors = true,
	Depot_Gates = true,
	Tank_Over_Bridge = false,
	Front_Dump = false,
	Rear_Dump = false,
	FuelDumpDyno = 0,
	Garage_Door_1_Closed = false,
	Garage_Door_2_Closed = false,
	//TankStatus = 1, //tank is repaired by default
	BridgeStatus = 0, //not built
	FootBridgeStatus = 0,

	Navigation =
	{
		// /bot waypoint_setproperty paththrough Navigation_PT:jump
		jump =
		{
			navigate = function()
			{
				this.Bot.HoldButton(BTN.JUMP, 0.55);
				sleep(0.55);
			},
		},

		//    /bot waypoint_setproperty paththrough Navigation_PT:ladder_1
		ladder_1 =
		{
			navigate = function()
			{
				wpTable = {};
				Wp.GetWaypointByName("Ladder_1", wpTable);
				if ( this.Goto(wpTable.position) == EVENT.PATH_SUCCESS )
				{
					this.AddAimRequest(Priority.VeryHigh, "facing", wpTable.facing);
					sleep(0.25);
					this.Bot.HoldButton(BTN.BACKWARD, 0.7);
					this.Bot.HoldButton(BTN.WALK, 0.7);
					sleep(0.7);
					this.Bot.HoldButton(BTN.FORWARD, 1.4);
					sleep(1.4);
				}
			},
		},

		//    /bot waypoint_setproperty paththrough Navigation_PT:ladder_2
		ladder_2 =
		{
			navigate = function()
			{
				wpTable = {};
				Wp.GetWaypointByName("Ladder_2", wpTable);
				if ( this.Goto(wpTable.position) == EVENT.PATH_SUCCESS )
				{
					this.AddAimRequest(Priority.VeryHigh, "facing", wpTable.facing);
					sleep(0.1);
					this.Bot.HoldButton(BTN.FORWARD, 0.5);
					sleep(0.5);
					this.AddAimRequest(Priority.VeryHigh, "facing", Vector3(0.547, -0.003, -0.837));
					sleep(0.1);
					this.Bot.HoldButton(BTN.FORWARD, 2);
					sleep(2);
				}
			},
		},
		//    /bot waypoint_setproperty paththrough Navigation_PT:jumptoroof
		jumptoroof =
		{
			navigate = function()
			{
				wpTable = {};
				Wp.GetWaypointByName("jumptoroof", wpTable);
				if ( this.Goto(wpTable.position) == EVENT.PATH_SUCCESS )
				{
					this.AddAimRequest(Priority.VeryHigh, "facing", wpTable.facing);
					sleep(0.3);
					this.Bot.HoldButton(BTN.FORWARD, 0.6);
					sleep(0.1);
					this.Bot.HoldButton(BTN.JUMP, 0.5);
					this.Bot.HoldButton(BTN.SPRINT, 0.5);
					this.Bot.HoldButton(BTN.FORWARD, 2.4);
					sleep(0.5);
					this.Bot.HoldButton(BTN.FORWARD, 2);
					this.Bot.HoldButton(BTN.SPRINT, 2);
					this.Bot.HoldButton(BTN.STRAFE_L, 0.55);
					sleep(0.6);
					this.Bot.HoldButton(BTN.JUMP, 0.55);
					sleep(1);
				}
			},
		},
	},

	// some dedicated defenders for tunnel grate breach
	Roles =
	{
		AXIS =
		{
			DEFENDER1 =
			{
				numbots = 3,
			},
		},
	},

	// spawn a few axis bots back when a disguised covert op gets through the tunnel grate
	AxisFallBack =
	{
		Name = "AxisFallBack",
		TriggerOnClass = CLASS.COVERTOPS,
		OnEnter = function(ent)
		{
			// only for allied covert ops in disguise
			if ( !GetEntFlags(ent, ENTFLAG.DISGUISED) || GetEntTeam(ent) != TEAM.ALLIES ) {
				return;
			}

			// NOTE: they will not shift forward after they do this since it's highly likely
			// that humans will keep trying to exploit it. the special camps will be disabled
			// on tunnel door breach.

			// spawn the axis engineers back to defend
			ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.ENGINEER );

			// disable the bridge plant for them
			SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Bridge" );

			// and defend the depot
			SetAvailableMapGoals( TEAM.AXIS, true, {
				"BUILD_West_Axis_Base_Fortification",
				"PLANTMINE_rGate.*",
				"DEFEND_rTeamDoor.*",
			});

			DeleteTriggerRegion("AxisFallBack");
		},
	},

	DepotRoof =
	{
		Name = "DepotRoof",
		TriggerOnClass = CLASS.ANYPLAYER,
		playerList = {},
		OnEnter = function(ent)
		{
			if ( GetEntTeam(ent) == TEAM.ALLIES ) {
				Map.DepotRoof.playerList[ent] = true;
				if ( tableCount(Map.DepotRoof.playerList) == 1 ) {
					// enable axis CAMP goals if there are any allied players on the roof
					Util.EnableGroup( "depotroof", TEAM.AXIS );
				}
			}
		},
		OnExit = function(ent)
		{
			if (Map.DepotRoof.playerList[ent])
			{
				Map.DepotRoof.playerList[ent] = null;
				if ( tableCount(Map.DepotRoof.playerList) == 0 ) {
					// the roof is clear
					Util.DisableGroup( "depotroof", TEAM.AXIS );
				}
			};
		},
	},

	Bridge_Built = function()
	{
		Map.BridgeStatus = 1;

		Wp.CheckBlockable();

		if ( Map.Tunnel_Doors )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, {
				"ATTACK_Bridge_.*",
				"CALLARTILLERY_bTowerHill.*",
			});
			SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_Tunnel_Doors.*" );
			SetAvailableMapGoals( TEAM.AXIS, false, "MOBILEMORTAR_rBridge.*" );
		}
		Util.EnableGoal( "ROUTE_mainbridgeRoute3" );

		Util.MapDebugPrint( "Bridge_Built" );
	},

	Bridge_Reinforced = function()
	{
		Map.BridgeStatus = 2;

		if ( Map.Tunnel_Doors )
		{
			SetGoalPriority( "BUILD_Tank", 0.92 );
			SetAvailableMapGoals( TEAM.ALLIES, false, "SMOKEBOMB_allies_bridge.*" );
			SetAvailableMapGoals( TEAM.AXIS, false, "CALLARTILLERY_arty_bridge_cons.*" );
		}

		Util.MapDebugPrint( "Bridge_Reinforced" );
	},

	Bridge_Planted = function()
	{
		if ( Map.BridgeStatus <= 1 )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "DEFUSE_Bridge.*" );
		}

		Util.MapDebugPrint( "Bridge_Planted" );
	},

	Bridge_Damaged = function()
	{
		Map.BridgeStatus = 1;

		if ( Map.Tunnel_Doors )
		{
			SetGoalPriority( "BUILD_Tank", 0.7 );
			SetAvailableMapGoals( TEAM.ALLIES, true, "SMOKEBOMB_allies_bridge.*" );
			SetAvailableMapGoals( TEAM.AXIS, true, "CALLARTILLERY_arty_bridge_cons.*" );
		}

		Util.MapDebugPrint( "Bridge_Damaged" );
	},

	Bridge_Destroyed = function()
	{
		Map.BridgeStatus = 0;

		if ( Map.Tunnel_Doors )
		{
			if ( Map.FootBridgeStatus == 0 )
			{
				SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_Tunnel_Doors.*" );
				SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_Bridge_.*" );
				if ( !Map.Tank_Over_Bridge ){
					SetAvailableMapGoals( TEAM.ALLIES, true, "CALLARTILLERY_bTowerHill.*" );
				}
			}

			SetAvailableMapGoals( TEAM.AXIS, true, "MOBILEMORTAR_rBridge.*" );
		}
		Util.DisableGoal( "ROUTE_mainbridgeRoute3" );

		Util.MapDebugPrint( "Bridge_Destroyed" );
	},

	East_Axis_Base_Fortification_Built = function()
	{
		Map.Front_Dump = true;

		if ( Map.Rear_Dump )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Fuel_Dump" );
			SetAvailableMapGoals( TEAM.AXIS, false, "ROUTE_FD_patrol" );
		}
		SetGoalPriority( "PLANT_East_Axis_Base_Fortification", 0.81);

		Util.MapDebugPrint( "East_Axis_Base_Fortification_Built" );
	},

	Fuel_Accessible = function()
	{
		if ( !Map.Depot_Gates )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_.*_Axis_Base_Fortification");
			Wp.CheckBlockable();
			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"PLANT_Fuel_Dump",
				"PLANT_.*_Axis_Base_Fortification",
			});
		}
		SetAvailableMapGoals( TEAM.AXIS, true, "ROUTE_FD_patrol" );
	},

	East_Axis_Base_Fortification_Damaged = function()
	{
		Map.Front_Dump = false;

		SetGoalPriority( "PLANT_East_Axis_Base_Fortification", 0.7);
		Map.Fuel_Accessible();

		Util.MapDebugPrint( "East_Axis_Base_Fortification_Damaged" );
	},

	//East_Axis_Base_Fortification_Destroyed = function()
	//{
	// Util.MapDebugPrint( "East_Axis_Base_Fortification_Destroyed" );
	//},

	West_Axis_Base_Fortification_Built = function()
	{
		Map.Rear_Dump = true;

		if ( Map.Front_Dump )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Fuel_Dump" );
			SetAvailableMapGoals( TEAM.AXIS, false, "ROUTE_FD_patrol" );
		}
		SetGoalPriority( "PLANT_West_Axis_Base_Fortification", 0.81);

		Util.MapDebugPrint( "West_Axis_Base_Fortification_Built" );
	},

	West_Axis_Base_Fortification_Damaged = function()
	{
		Map.Rear_Dump = false;

		SetGoalPriority( "PLANT_West_Axis_Base_Fortification", 0.7);
		Map.Fuel_Accessible();

		Util.MapDebugPrint( "West_Axis_Base_Fortification_Damaged" );
	},

	//West_Axis_Base_Fortification_Destroyed = function()
	//{
	// Util.MapDebugPrint( "West_Axis_Base_Fortification_Destroyed" );
	//},

	Foot_Bridge_Built = function()
	{
		Map.FootBridgeStatus = 1;

		Wp.CheckBlockable();

		if ( Map.Tunnel_Doors )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_Tunnel_Doors.*" );
			SetAvailableMapGoals( TEAM.ALLIES, false, {
				"ATTACK_Bridge_.*",
				"CALLARTILLERY_bTowerHill.*",
			});
		}

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

		Util.MapDebugPrint( "Foot_Bridge_Built" );
	},

	Foot_Bridge_Destroyed = function()
	{
		Map.FootBridgeStatus = 0;

		//make sure tunnel attack goals are off if both bridges aren't built
		if ( Map.BridgeStatus == 0 && Map.Tunnel_Doors )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_Tunnel_Doors.*");
			SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_Bridge_.*" );
			if ( !Map.Tank_Over_Bridge ){
				SetAvailableMapGoals( TEAM.ALLIES, true, "CALLARTILLERY_bTowerHill.*" );
			}
		}

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

		Util.MapDebugPrint( "Foot_Bridge_Destroyed" );
	},

	Allied_Side_MG_Built = function()
	{
		Wp.SetWaypointFlag( "Side_MG_WP_1", "closed", true );

		Util.MapDebugPrint( "Allied_Side_MG_Built" );
	},

	Allied_Side_MG_Destroyed = function()
	{
		Wp.SetWaypointFlag( "Side_MG_WP_1", "closed", false );

		Util.MapDebugPrint( "Allied_Side_MG_Destroyed" );
	},

	Axis_Side_MG_Built = function()
	{
		Wp.SetWaypointFlag( "Side_MG_WP_2", "closed", false );

		Util.MapDebugPrint( "Axis_Side_MG_Built" );
	},

	Axis_Side_MG_Destroyed = function()
	{
		Wp.SetWaypointFlag( "Side_MG_WP_2", "closed", true );

		Util.MapDebugPrint( "Axis_Side_MG_Destroyed" );
	},

	//Tank_Built = function()
	//{
	// Map.TankStatus = 1;
	//
	// Util.MapDebugPrint( "Tank_Built" );
	//},

	//Tank_Destroyed = function()
	//{
	// Map.TankStatus = 0;
	//
	// Util.MapDebugPrint( "Tank_Destroyed" );
	//},

	Fuel_Dump_Planted = function()
	{
		++Map.FuelDumpDyno;

		if ( Map.Depot_Gates )
		{
			return;
		}

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

		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Fuel_Dump.*" );
		Util.DisableGroup( "depotwall", TEAM.AXIS );
		sleep(0.5);
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Fuel_Dump.*" );
		Util.EnableGroup( "depotwall", TEAM.AXIS );

		Util.MapDebugPrint( "Fuel_Dump_Planted" );
	},

	Fuel_Dump_Defused = function()
	{
		--Map.FuelDumpDyno;

		if ( Map.FuelDumpDyno < 1 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "CAMP_fueldump.*" );
		}

		Util.MapDebugPrint( "Fuel_Dump_Defused" );
	},

	Fuel_Dump_Destroyed = function()
	{
		Util.MapDebugPrint( "Fuel_Dump_Destroyed" );
	},

	tunnelgrate_Destroyed = function()
	{
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Tunnel_Grate.*" );

		if (Map.BridgeStatus < 2)
		{
			SetGoalPriority( "BUILD_Tank", 0.7, TEAM.ALLIES);
		}

		Util.MapDebugPrint( "tunnelgrate_Destroyed" );
	},

	tunneldoors_Destroyed = function()
	{
		Map.Tunnel_Doors = false;

		// delete the cov ops trigger region
		DeleteTriggerRegion("AxisFallBack");

		Util.DisableGroup( "roadmg", TEAM.ALLIES );

		Wp.CheckBlockable();
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"BUILD_Bridge",
			"BUILD_Foot_Bridge",
			"SNIPE_bTowerMg.*",
			"MOBILEMORTAR_bBridge.*",
			"ATTACK_Tunnel_Doors.*",
			"HEALTHCAB_alliedhut_healthcabinet",
			"AMMOCAB_alliedhut_ammocabinet",
			"SMOKEBOMB_allies_bridge.*",
			"ATTACK_Bridge_.*",
		});
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"GRENADE_axis_base_mg",
			"ATTACK_Depot_Gates.*",
			"ATTACK_Tank_Bay.*",
			"BUILD_Side_MG",
			"MOUNTMG42_Side_MG_1",
			"REPAIRMG42_Side_MG_1",
			"BUILD_Allied_Command_Post",
			"PLANT_Tunnel_MG",
		});
		SetGoalPriority( "DEFUSE_Bridge.*", 0, TEAM.ALLIES, CLASS.ENGINEER, true );
		SetGoalPriority( "DEFUSE_Foot_Bridge.*", 0, TEAM.ALLIES, CLASS.ENGINEER, true );
		SetGoalPriority( "DEFUSE_Axis_Command_Post.*", 0, TEAM.AXIS, CLASS.ENGINEER, true );
		SetGoalPriority( "DEFUSE_Tunnel_MG.*", 0, TEAM.AXIS, CLASS.ENGINEER, true );
		SetGoalPriority( "DEFEND_Tunnel_Doors.*", 0.7, TEAM.AXIS );

		if ( Map.Garage_Door_1_Closed )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_Garage_Door_1" );
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_Garage_Door_1" );
		}

		if ( Map.Garage_Door_2_Closed )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_Garage_Door_2" );
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_Garage_Door_2" );
		}

		Util.DisableGroup( "tdoor", TEAM.AXIS );
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_rTeamDoor.*",
			"DEFEND_Tunnel_Grate.*",
			"ARTILLERY_S_bTowerHill3",
			"CALLARTILLERY_Tunnel_Doors_25",
			"AIRSTRIKE_Tunnel_Doors_26",
			".*_bridge_cons.*",
			"BUILD_Tunnel_MG",
			"BUILD_Axis_Command_Post",
			"PLANT_Foot_Bridge",
			"PLANT_Bridge",
			"PLANTMINE_Cave_Tunnel_Exit_.*",
			"MOUNTMG42_Tunnel_MG",
			"REPAIRMG42_Tunnel_MG",
			"CALLARTILLERY_arty_bridge_cons.*",
		});
		SetAvailableMapGoals( TEAM.AXIS, true, {
			"DEFEND_Tunnel_Doors.*",
			"DEFEND_Depot_Gates.*",
			"MOUNTMG42_axisbase_mg42",
			"REPAIRMG42_axisbase_mg42",
			".*_Side_MG",
			"PLANT_Allied_Command_Post",
			"PLANTMINE_CP_Door",
			"PLANTMINE_Cave_Door",
			"PLANTMINE_Cave_Exit_.*",
			"PLANTMINE_Hill_.*",
		});

		Util.MapDebugPrint( "tunneldoors_Destroyed" );
	},

	depotgates_Destroyed = function()
	{
		Map.Depot_Gates = false;

		SetGoalPriority( "MOUNT_tank", 0.5, TEAM.ALLIES );
		SetGoalPriority( "MOUNT_tank", 0.8, TEAM.ALLIES, CLASS.SOLDIER );

		Wp.CheckBlockable();
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"ATTACK_Depot_Gates.*",
			"ATTACK_Tank_Bay.*",
			"ESCORT_tank",
		});

		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"ATTACK_Fuel_Dump_.*",
			"ATTACK_Depot_Side_Wall.*",
			"PLANT_East_Axis_Base_Fortification",
			"PLANT_West_Axis_Base_Fortification",
			"AIRSTRIKE_Fuel_Dump_65",
			"CALLARTILLERY_Fuel_Dump_66",
			"ARTILLERY_S_Fuel_Dump_67",
		});

		if ( !Map.Front_Dump || !Map.Rear_Dump )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Fuel_Dump" );
		}

		Util.SetGoalRange( "BUILD_Allied_Command_Post", 1600);

		SetAvailableMapGoals( TEAM.AXIS, false, {
			"PLANTMINE_Depot_Gates_.*",
			"DEFEND_Depot_Gates.*", //depotwall group will be enabled again
			"BUILD_Side_MG",
			"MOUNTMG42_Side_MG",
			"REPAIRMG42_Side_MG",
		});
		Util.EnableGroup( "depotwall", TEAM.AXIS );
		SetAvailableMapGoals( TEAM.AXIS, true, {
			"DEFEND_Fuel_Dump_.*",
			"PLANTMINE_rGate.*",
		});
		SetGoalPriority( "DEFUSE_Side_MG.*", 0, TEAM.AXIS, CLASS.ENGINEER, true );

		Util.DisableGroup( "depotwallarty", TEAM.AXIS );
		Util.EnableGroup( "depotarty", TEAM.AXIS );

		OnTriggerRegion( AABB(-11668,-5740,161, -11469,-5512,393), RegionTrigger.IntrusionWarning );
		OnTriggerRegion( AABB(-9952,-5522,180, -9628,-5333,364), RegionTrigger.IntrusionWarning );
		OnTriggerRegion( AABB(-10136,-6699,146, -9994,-6608,367), RegionTrigger.IntrusionWarning );
		OnTriggerRegion( AABB(-11369,-7391,160, -11206,-6991,433), RegionTrigger.IntrusionWarning );
		OnTriggerRegion( AABB(-11184,-7426,178, -11106,-7005,410), RegionTrigger.IntrusionWarningEngObj );
		OnTriggerRegion( AABB(-11064,-7099,158, -10926,-6968,339), RegionTrigger.IntrusionWarningEngObj );
		OnTriggerRegion( AABB(-10580,-7450,158, -10445,-7011,397), RegionTrigger.IntrusionWarningEngObj );
		OnTriggerRegion( AABB(-10861,-7124,165, -10641,-6995,351), RegionTrigger.AllClear );

		Util.MapDebugPrint( "depotgates_Destroyed" );
	},

	depotsidewall_Destroyed = function()
	{
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"ATTACK_Depot_Side_Wall.*",
			"BUILD_Tank",
		});

		SetAvailableMapGoals( TEAM.AXIS, true, {
			"PLANTMINE_rWall.*",
			"BUILD_East_Axis_Base_Fortification",
		});

		ETUtil.SetAimModeForMount("MOUNT_tank",
		{
			Vec3(-11329.384, -7111.280, 177.898),
			Vec3(-11180.670, -6141.054, 176.125),
			Vec3(-9464.406, -6364.474, 282.736)
		});

		Util.MapDebugPrint( "depotsidewall_Destroyed" );
	},

	tbdoorone = function(trigger)
	{
		vel = ToVector(trigger.Action);

		if ( vel[2] < 0 )
		{
			Map.Garage_Door_1_Closed = true;

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

			Util.MapDebugPrint("Garege_Door_1_Closing");

			sleep(5);

			if ( !Map.Tunnel_Doors )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_Garage_Door_1" );
			}

			Util.MapDebugPrint("Garege_Door_1_Closed");
		}
		else if ( vel[2] > 0 )
		{
			Map.Garage_Door_1_Closed = false;

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

			Util.MapDebugPrint("Garege_Door_1_Opening");

			sleep(5);

			if ( !Map.Tunnel_Doors and !Map.Tank_Pass_Tunnel )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_Garage_Door_1" );
			}

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

	tbdoortwo = function(trigger)
	{
		vel = ToVector(trigger.Action);

		if ( vel[2] < 0 )
		{
			Map.Garage_Door_2_Closed = true;

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

			Util.MapDebugPrint("Garege_Door_2_Closing");

			sleep(5);

			if ( !Map.Tunnel_Doors )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_Garage_Door_2" );
			}

			Util.MapDebugPrint("Garege_Door_2_Closed");
		}
		else if ( vel[2] > 0 )
		{
			Map.Garage_Door_2_Closed = false;

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

			Util.MapDebugPrint("Garege_Door_2_Opening");

			sleep(5);

			if ( !Map.Tunnel_Doors and !Map.Tank_Pass_Tunnel )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_Garage_Door_2" );
			}

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

	tank_over_bridge = function()
	{
		Map.Tank_Over_Bridge = true;

		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"CALLARTILLERY_bTowerHill.*",
			"ARTILLERY_S_bTowerHill.*",
		});

		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_Bridge_.*",
			"PLANTMINE_Tunnel_Doors_.*",
			"PLANTMINE_rFootbridge.*",
			"MOBILEMORTAR_rBridge.*",
			"ARTILLERY_S_bridge_cons",
		});
		Util.EnableGroup( "tdoor", TEAM.AXIS );

		SetAvailableMapGoals( TEAM.AXIS, true, {
			"ARTILLERY_S_bTowerHill3",
			"CALLARTILLERY_Tunnel_Doors_25",
			"AIRSTRIKE_Tunnel_Doors_26",
			"PLANTMINE_Cave_Tunnel_Exit_.*",
		});

		Util.MapDebugPrint( "tank_over_bridge" );
	},

	tank_in_tunnel = function()
	{
		SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Tunnel_MG" );
		Util.EnableGroup( "tunnelexitarty", TEAM.AXIS );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Tunnel_Doors.*" );

		Util.MapDebugPrint( "tank_in_tunnel" );
	},

	tank_past_tunnel = function()
	{
		Map.Tank_Pass_Tunnel = true;

		Util.DisableGroup( "tunnelexitarty", TEAM.AXIS );
		Util.EnableGroup( "depotwallarty", TEAM.AXIS );
		Util.DisableGroup( "forwarddepot", TEAM.AXIS ); // disable camps inside tunnel

		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"PLANT_Side_MG",
			"MOUNTMG42_Side_MG_1",
			"REPAIRMG42_Side_MG_1",
		});

		SetAvailableMapGoals( TEAM.AXIS, false, {
			"PLANTMINE_CP_Door",
			"PLANTMINE_Cave_Door",
			"PLANTMINE_Cave_Exit_.*",
			"PLANTMINE_Hill_.*",
			"SWITCH_Garage_Door_1",
			"SWITCH_Garage_Door_2",
		});

		SetAvailableMapGoals( TEAM.AXIS, true, {
			".*_Side_MG",
			"BUILD_West_Axis_Base_Fortification",
			"PLANTMINE_Depot_Gates_.*",
		});

		Util.MapDebugPrint( "tank_past_tunnel" );
	},

	tank_at_location = function()
	{
		switch(Map.VehicleLocation)
		{
			case 2:
			{
				Map.tank_over_bridge();
			}
			case 3:
			{
				Map.tank_in_tunnel();
			}
			case 4:
			{
				Map.tank_past_tunnel();
			}
		}
		Util.MapDebugPrint("vehicle at location " + Map.VehicleLocation, true);
	},
};

global OnMapLoad = function()
{
	Util.SetGoalPosition( -3860.965820, -4226.477051, 232.133408, "PLANT_Bridge" );
	Util.SetGoalPosition( -1218.925,-3095.991,408.092, "PLANT_Foot_Bridge" );

	//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( "Allied team has reinforced the Bridge!", Map.Bridge_Reinforced );
	OnTrigger( "Allied team has constructed the bridge!", Map.Bridge_Built );
	OnTrigger( "Axis team has constructed the East Axis Base Fortification!", Map.East_Axis_Base_Fortification_Built );
	OnTrigger( "Allied team has constructed the Foot Bridge!", Map.Foot_Bridge_Built );
	//OnTrigger( "Allied team has constructed the Road MG Nest!", Map.Road_MG_Built );
	OnTrigger( "Allied team has constructed the Side MG Nest!", Map.Allied_Side_MG_Built );
	OnTrigger( "Axis team has constructed the Side MG Nest!", Map.Axis_Side_MG_Built );
	//OnTrigger( "The Tank has been repaired", Map.Tank_Built );
	//OnTrigger( "Axis team has constructed the Tunnel MG!", Map.Tunnel_MG_Built );
	OnTrigger( "Axis team has constructed the West Axis Base Fortification!", Map.West_Axis_Base_Fortification_Built );
	//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( "Axis team has damaged the Bridge!",  Map.Bridge_Damaged );
	OnTrigger( "Axis team has destroyed the Bridge!", Map.Bridge_Destroyed );
	OnTrigger( "Allied team has damaged the East Axis Base Fortification!", Map.East_Axis_Base_Fortification_Damaged );
	//OnTrigger( "Allied team has destroyed the East Axis Base Fortification!", Map.East_Axis_Base_Fortification_Destroyed );
	OnTrigger( "Axis team has destroyed the Foot Bridge!", Map.Foot_Bridge_Destroyed );
	OnTrigger( "Planted at the Fuel Dump.", Map.Fuel_Dump_Planted );
	OnTrigger( "Planted at Fuel Dump.", Map.Fuel_Dump_Planted );   //Nitmod
	OnTrigger( "Defused at the Fuel Dump.", Map.Fuel_Dump_Defused );
	OnTrigger( "Defused at Fuel Dump.", Map.Fuel_Dump_Defused );   //Nitmod
	OnTrigger( "Allied team has destroyed the Axis Fuel Dump!", Map.Fuel_Dump_Destroyed );
	//OnTrigger( "Axis team has destroyed the Road MG Nest!", Map.Road_MG_Destroyed );
	OnTrigger( "Allied team has destroyed the Side MG Nest!", Map.Axis_Side_MG_Destroyed );
	OnTrigger( "Axis team has destroyed the Side MG Nest!", Map.Allied_Side_MG_Destroyed );
	OnTrigger( "Planted at the Bridge.", Map.Bridge_Planted );
	OnTrigger( "Planted at Bridge.", Map.Bridge_Planted );   //Nitmod
	//OnTrigger( "Allied team has destroyed the Tunnel MG!", Map.Tunnel_MG_Destroyed );
	OnTrigger( "Allied team has damaged the West Axis Base Fortification!", Map.West_Axis_Base_Fortification_Damaged );
	//OnTrigger( "Allied team has destroyed the West Axis Base Fortification!", Map.West_Axis_Base_Fortification_Destroyed );
	//OnTrigger( "The Tank has been damaged", Map.Tank_Destroyed );
	OnTrigger( "Allied team has breached the Tunnel Grate!", Map.tunnelgrate_Destroyed );
	OnTrigger( "Allied team has breached the Tunnel Doors!", Map.tunneldoors_Destroyed );
	OnTrigger( "Allied team has breached the Depot Gates!", Map.depotgates_Destroyed );
	OnTrigger( "Allied team has breached the Depot Side Wall!", Map.depotsidewall_Destroyed );
	OnTrigger( "tbdoor1_lever1_goto", Map.tbdoorone );
	OnTrigger( "tbdoor2_lever1_goto", Map.tbdoortwo );
	OnTrigger( "tank at location", Map.tank_at_location );

	// tank positions
	OnTriggerRegion(AABB(-3337.337,-6550.084,207.125,-3016.404,-6386.294,284.880), RegionTrigger.VehicleTrigger); //near bridge
	OnTriggerRegion(AABB(-3810.875,-4750.004,211.125,-3611.125,-4491.826,291.954), RegionTrigger.VehicleTrigger); //over bridge
	OnTriggerRegion(AABB(-5693.422,-2970.203,209.125,-5602.288,-2678.854,291.125), RegionTrigger.VehicleTrigger); //in tunnel
	OnTriggerRegion(AABB(-7926.541,-2944.875,209.125,-7809.442,-2687.126,283.125), RegionTrigger.VehicleTrigger); //exit tunnel

	OnTriggerRegion(AABB(-3733.483,-2051.376,652.817,-3449.874,-1751.765,1083.265), RegionTrigger.DisableBotPush);
	OnTriggerRegion(AABB(-9999.171,-5791.996,177.340,-9894.374,-5449.106,515.125), RegionTrigger.DisableBotPush);
	OnTriggerRegion(AABB(-10538.093,-5582.775,441.125,-10443.125,-5535.007,557.906), RegionTrigger.DisableBotPush);
	OnTriggerRegion(AABB(-11316.018,-6832.875,183.449,-11055.125,-6732.373,259.345), RegionTrigger.DisableBotPush);
	OnTriggerRegion(AABB(-12552.428,-6052.649,393.125,-11996.329,-5993.180,510.034), RegionTrigger.DisableBotPush);
	OnTriggerRegion(AABB(-10503.335,-5846.517,305.125,-10184.176,-5702.019,395.125), RegionTrigger.DisableBotPush);
	OnTriggerRegion(AABB(-11064.850,-7650.512,181.125,-10600.443,-7080.235,604.782), RegionTrigger.DisableBotPush);
	OnTriggerRegion(AABB(-3696.232,-4825.550,65.127,-3523.531,-4510.127,279.254), RegionTrigger.DisableBotPush);
	OnTriggerRegion(AABB(-9427.145,-1285.650,1163.742,-9228.191,-1172.881,1285.031), RegionTrigger.DisableBotPush);
	OnTriggerRegion(AABB(-2831.975,-8336.546,348.482,-2711.256,-8153.473,450.134), RegionTrigger.DisableBotPush);
	OnTriggerRegion(AABB(-11332.472,-6914.470,537.132,-10380.936,-6283.438,687.614), RegionTrigger.DisableBotPush);
	OnTriggerRegion(AABB(-3074.798,-8210.986,389.125,-2946.725,-8119.135,517.481), RegionTrigger.DisableBotPush);
	OnTriggerRegion(AABB(-10136.874,-5462.146,441.125,-8755.125,-5162.832,523.125), RegionTrigger.DisableBotPush);  //wall
	OnTriggerRegion(AABB(-10908.676,-7287.709,182.167,-10720.402,-7071.353,566.530), RegionTrigger.DisableBotPush); //fueltankladder
	OnTriggerRegion(AABB(-12016.875,-6135.739,177.170,-11803.087,-5745.805,464.596), RegionTrigger.DisableBotPush); //fueltankladder

	OnTriggerRegion(AABB(-9999.171,-5791.996,177.340,-9894.374,-5449.106,515.125), RegionTrigger.DisableCombatMovement);
	OnTriggerRegion(AABB(-12016.875,-6135.739,177.170,-11803.087,-5745.805,464.596), RegionTrigger.DisableCombatMovement);
	OnTriggerRegion(AABB(-10538.093,-5582.775,441.125,-10443.125,-5535.007,557.906), RegionTrigger.DisableCombatMovement);
	OnTriggerRegion(AABB(-11316.018,-6832.875,183.449,-11055.125,-6732.373,259.345), RegionTrigger.DisableCombatMovement);
	OnTriggerRegion(AABB(-12552.428,-6052.649,393.125,-11996.329,-5993.180,510.034), RegionTrigger.DisableCombatMovement);
	OnTriggerRegion(AABB(-10503.335,-5846.517,305.125,-10184.176,-5702.019,395.125), RegionTrigger.DisableCombatMovement);
	OnTriggerRegion(AABB(-11064.850,-7650.512,181.125,-10600.443,-7080.235,604.782), RegionTrigger.DisableCombatMovement);
	OnTriggerRegion(AABB(-3696.232,-4825.550,65.127,-3523.531,-4510.127,279.254), RegionTrigger.DisableCombatMovement);
	OnTriggerRegion(AABB(-5376.875,-3173.627,234.605,-4943.194,-2917.311,608.047), RegionTrigger.DisableCombatMovement);
	OnTriggerRegion(AABB(-10781.831,-5526.875,313.125,-10448.712,-5255.125,515.125), RegionTrigger.DisableCombatMovement);
	OnTriggerRegion(AABB(-11332.472,-6914.470,537.132,-10380.936,-6283.438,687.614), RegionTrigger.DisableCombatMovement);

	OnTriggerRegion(AABB(-3500,-8290,389,-2940,-7800,517), RegionTrigger.BreakableDistance); //allied hut window for sniper
	RegionTrigger.BreakableDistance.MaxBreakableDist = 250;
	RegionTrigger.BreakableDistance.MinBreakableDist = 0;

	// detect covert ops sneaking through tunnel grate
	OnTriggerRegion(AABB(-6720.574,-1895.911,321.125,-6626.926,-1558.944,403.125), Map.AxisFallBack);
	// detect allies on the depot roof
	OnTriggerRegion(AABB(-11424.124,-6971.128,537.125,-10310.962,-6210.208,944.180), Map.DepotRoof);

	// Max users per goal
	Util.SetMaxUsers( 1, {"ATTACK.*", "DEFEND.*", "CAMP.*", "SWITCH.*", "MOUNT.*", "GRENADE.*", "PLANT.*", "BUILD.*"} );
	Util.SetMaxUsers( 2, "PLANT_Fuel_Dump" );
	Util.SetMaxUsers( 4, {"PLANT_West_Axis_Base_Fortification", "PLANT_East_Axis_Base_Fortification"} );
	Util.SetMaxUsers( 3, {"BUILD_Tank", "BUILD_Bridge"} );

	// set some preferred positions to start from for vehicle goals
	ETUtil.SetStartIndex("MOUNT_tank", 0);
	ETUtil.SetStartIndex("ESCORT_tank", 0);
	ETUtil.SetStartIndex("BUILD_Tank", 0);
	ETUtil.SetAimModeForMount("MOUNT_tank", "velocity");

	SetGoalPriority( "GRENADE_.*", 0.7 );
	SetGoalPriority( "SWITCH_.*", 0.6 );
	SetGoalPriority( "PLANT_Side_MG", 0.5, 0, CLASS.ENGINEER );

	// Allied goals
	SetGoalPriority( "PLANT_Axis_Command_Post", 0.5, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_Tunnel_MG", 0.5, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_Fuel_Dump", 0.85, TEAM.ALLIES );
	SetGoalPriority( "BUILD_Side_MG", 0.81, TEAM.ALLIES);
	SetGoalPriority( "BUILD_Allied_Command_Post", 0.86, TEAM.ALLIES);
	SetGoalPriority( "BUILD_Tank", 0.92, TEAM.ALLIES );
	SetGoalPriority( "DEFUSE_Road_MG.*", 0, TEAM.ALLIES, CLASS.ENGINEER, true );
	SetGoalPriority( "PLANT_Axis_Command_Post", 0.79, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "PLANT_Tunnel_MG", 0.79, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "SNIPE.*", 0.8, TEAM.ALLIES );
	SetGoalPriority( "PLANT_West_Axis_Base_Fortification", 0.7, TEAM.ALLIES);
	SetGoalPriority( "PLANT_East_Axis_Base_Fortification", 0.7, TEAM.ALLIES);

	// Axis goals
	SetGoalPriority( "BUILD_East_Axis_Base_Fortification", 0.5, TEAM.AXIS );
	SetGoalPriority( "PLANT_Allied_Command_Post", 0, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_Foot_Bridge", 0.5, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_Road_MG", 0, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "CAMP_fueldump.*", 0.66, TEAM.AXIS );
	SetGoalPriority( "CAMP_roofclear.*", 0.67, TEAM.AXIS );
	SetGoalPriority( "DEFEND_rTeamDoor.*", 0.75, TEAM.AXIS );
	SetGoalPriority( "DEFUSE_Fuel_Dump_.*", 1.20, TEAM.AXIS, CLASS.ENGINEER, true );
	SetGoalPriority( "DEFEND_Depot_Gates_17", 0.51, TEAM.AXIS );

	Util.LimitToClass( "DEFEND_rTeamDoor.*", TEAM.AXIS, CLASS.ENGINEER );

	Util.DisableGoal( ".*", true );
	Util.DisableGoal( "ROUTE_footbridgeRoute2" );
	Util.DisableGoal( "ROUTE_mainbridgeRoute3" );

	SetAvailableMapGoals( TEAM.ALLIES, true, {
		"BUILD_Tank",
		"SMOKEBOMB_allies_bridge.*",
		"HEALTHCAB_alliedhut_healthcabinet",
		"AMMOCAB_alliedhut_ammocabinet",
		"BUILD_Bridge",
		"BUILD_Foot_Bridge",
		"MOUNT_tank",
		"ESCORT_tank",
		"PLANT_Axis_Command_Post",
		"PLANT_Tunnel_MG",
		"ATTACK_Bridge_.*",
		"CALLARTILLERY_bTowerHill.*",
		"ARTILLERY_S_bTowerHill.*",
		"SNIPE_bTowerMg.*",
		"MOBILEMORTAR_bBridge.*",
	});
	Util.EnableGroup( "roadmg", TEAM.ALLIES ); // build, mountmg, repair for Road_MG

	SetAvailableMapGoals( TEAM.AXIS, true, {
		"PLANT_Bridge",
		"ARTILLERY_S_bridge_cons",
		"REPAIRMG42_Tunnel_MG",
		"BUILD_Tunnel_MG",
		"BUILD_Axis_Command_Post",
		"PLANT_Foot_Bridge",
		"CALLARTILLERY_arty_bridge_cons.*",
		"MOUNTMG42_Tunnel_MG",
		"DEFEND_Bridge_.*",
		"MOBILEMORTAR_rBridge.*",
		"PLANTMINE_rFootbridge.*",
		"PLANTMINE_Tunnel_Doors_.*",
	});

	Util.SetGoalRange( "BUILD_Allied_Command_Post", 0);

	Wp.SetWaypointFlag( "Side_MG_WP_1", "closed", false );
	Wp.SetWaypointFlag( "Side_MG_WP_2", "closed", true );

	Util.AddUseWp( "MOUNTMG42_Side_MG_1", "Side_MG_WP_3" );
	Util.AddUseWp( "REPAIRMG42_Side_MG_1", "Side_MG_WP_3" );
	Util.AddUseWp( "PLANT_Side_MG", "Side_MG_WP_3" );

	Util.AddUsePoint( "PLANT_Tunnel_MG", Vec3(-3506.156, -1856.850, 724.274));
	// randomize plant goal position
	Util.AddUsePoint( "PLANT_Fuel_Dump", { Vec3(-10840,-7310,450), Vec3(-10830,-7570,250), Vec3(-10890,-7430,250),  Vec3(-10750,-7423,250) });

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

global OnBotJoin = function( bot )
{
	bot.MaxViewDistance = 5000;
};

global InitializeRoutes = function()
{
	MapRoutes =
	{
		BUILD_Bridge =
		{
			ROUTE_AllySpawn =
			{
				ROUTE_mainbridgeRoute1 = {},
				ROUTE_mainbridge4 =
				{
					ROUTE_mainbridge5 =
					{
						ROUTE_mainbridgeRoute2 = {}
					},
				},
			},
		},
		ATTACK_Tunnel_Doors_1 =
		{
			ROUTE_AllySpawn =
			{
				ROUTE_footbridgeRoute2 = {},
				ROUTE_mainbridgeRoute3 = {},
			},
		},
		BUILD_Allied_Command_Post =
		{
			ROUTE_TunnelSpawn1 =
			{
				ROUTE_northtunnel =
				{
					ROUTE_cphill = {},
					ROUTE_cpflank = { Weight = 2 },
				},
			},
		},
		ATTACK_Depot_Gates_1 =
		{
			ROUTE_TunnelSpawn1 =
			{
				ROUTE_maintunnel =
				{
					ROUTE_eTankPath1 = { ROUTE_eTankPath2 = {}, },
					ROUTE_wTankPath1 = { ROUTE_wTankPath2 = {}, },
				},
				ROUTE_northtunnel =
				{
					ROUTE_cphill = {},
					ROUTE_cpflank = {},
				},
				ROUTE_southtunnel =
				{
					Weight = 2,
					ROUTE_southtunnel2 = {},
				},
			},
		},
		PLANT_Fuel_Dump =
		{
			ROUTE_TunnelSpawn1 =
			{
				ROUTE_maintunnel =
				{
					ROUTE_eTankPath1 = { ROUTE_eTankPath2 = {}, },
					ROUTE_wTankPath1 = { ROUTE_wTankPath2 = {}, },
					ROUTE_cphill =
					{
						ROUTE_depotgate = {},
						ROUTE_sidewall = { ROUTE_sidewall2 = {}, },
					},
				},
				ROUTE_northtunnel =
				{
					Weight = 3,
					ROUTE_cphill = {},
					ROUTE_cpflank =
					{
						Weight = 2,
						ROUTE_sidewall = {},
					},
				},
				ROUTE_southtunnel =
				{
					//Weight = 2,
					ROUTE_southtunnel2 = {},
				},
			},
			//add route support for et pro scripted cp spawns
			ROUTE_CpSpawn =
			{
				ROUTE_depotgate = {},
				ROUTE_sidewall2 = {},
			},
		},
		DEFEND_Depot_Gates_6 =
		{
			ROUTE_FuelDumpSpawn1 =
			{
				ROUTE_cphill2 = { Weight = 2, },
				ROUTE_sidewall2 = { ROUTE_sidewall = {}, }
			},
		},
		DEFEND_Fuel_Dump_6 =
		{
			ROUTE_FuelDumpSpawn1 =
			{
				ROUTE_FD_stairs = {},
				ROUTE_FD_back =
				{
					Weight = 2,
					ROUTE_FD_weststairs = {},
					ROUTE_FD_opengate = {},
				},
				ROUTE_FD_patrol = { Weight = 2, },
			},
		},
		PLANTMINE_rGate1 =
		{
			ROUTE_FuelDumpSpawn1 =
			{
				ROUTE_FD_back = {},
				ROUTE_FD_patrol = { Weight = 2, },
			},
		},
		GRENADE_axis_base_mg =
		{
			ROUTE_TunnelSpawn1 =
			{
				ROUTE_southtunnel =
				{
					ROUTE_southtunnel2 = {},
				},
			},
		},
	};

	//copy some routes
	MapRoutes.DEFEND_Depot_Gates_6.ROUTE_FuelDumpSpawn2 = MapRoutes.DEFEND_Depot_Gates_6.ROUTE_FuelDumpSpawn1;
	MapRoutes.DEFEND_Fuel_Dump_6.ROUTE_FuelDumpSpawn2 = MapRoutes.DEFEND_Fuel_Dump_6.ROUTE_FuelDumpSpawn1;
	MapRoutes.PLANTMINE_rGate1.ROUTE_FuelDumpSpawn2 = MapRoutes.PLANTMINE_rGate1.ROUTE_FuelDumpSpawn1;
	MapRoutes["ATTACK_Bridge_[12356]"] = MapRoutes.BUILD_Bridge;
	MapRoutes["ATTACK_Tunnel_Doors.*"] = MapRoutes.ATTACK_Tunnel_Doors_1;
	MapRoutes["ATTACK_Depot_Gates_[2345]"] = MapRoutes.ATTACK_Depot_Gates_1;
	MapRoutes["ATTACK_Tank_Bay.*"] = MapRoutes.ATTACK_Depot_Gates_1;
	MapRoutes.PLANT_Side_MG = MapRoutes.BUILD_Allied_Command_Post;
	MapRoutes.MOUNTMG42_Side_MG_1 = MapRoutes.BUILD_Allied_Command_Post;
	MapRoutes.REPAIRMG42_Side_MG_1 = MapRoutes.BUILD_Allied_Command_Post;
	MapRoutes["ATTACK_Fuel_Dump_.*"] = MapRoutes.PLANT_Fuel_Dump;
	MapRoutes.PLANT_East_Axis_Base_Fortification = MapRoutes.PLANT_Fuel_Dump;
	MapRoutes.PLANT_West_Axis_Base_Fortification = MapRoutes.PLANT_Fuel_Dump;
	MapRoutes.DEFEND_Depot_Gates_8 = MapRoutes.DEFEND_Depot_Gates_6;
	MapRoutes["DEFEND_Depot_Gates_1[27]"] = MapRoutes.DEFEND_Depot_Gates_6;
	MapRoutes.REPAIRMG42_Side_MG = MapRoutes.DEFEND_Depot_Gates_6;
	MapRoutes.MOUNTMG42_Side_MG = MapRoutes.DEFEND_Depot_Gates_6;
	MapRoutes.PLANT_Allied_Command_Post = MapRoutes.DEFEND_Depot_Gates_6;
	MapRoutes["DEFEND_Fuel_Dump.*"] = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes["CALLARTILLERY_rDepotWall.*"] = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes["PLANTMINE_rGate.*"] = MapRoutes.PLANTMINE_rGate1;
	MapRoutes["PLANTMINE_rWall.*"] = MapRoutes.PLANTMINE_rGate1;

	Util.Routes(MapRoutes);
};
