global Map =
{
	Ammo_Cabinet_lms_ammocabinet = "AMMOCAB_lms_ammocabinet",
	Ammo_Cabinet_tankbay_ammocabinet = "AMMOCAB_tankbay_ammocabinet",
	Ammo_Cabinet_alliedhut_ammocabinet = "AMMOCAB_alliedhut_ammocabinet",
	Health_Cabinet_alliedhut_healthcabinet = "HEALTHCAB_alliedhut_healthcabinet",
	Health_Cabinet_lms_healthcabinet = "HEALTHCAB_lms_healthcabinet",
	Health_Cabinet_tankbay_healthcabinet = "HEALTHCAB_tankbay_healthcabinet",
	Build_Allied_Command_Post = "BUILD_Allied_Command_Post",
	Build_Axis_Command_Post = "BUILD_Axis_Command_Post",
	Build_Bridge = "BUILD_Bridge",
	Build_East_Axis_Base_Fortification = "BUILD_East_Axis_Base_Fortification",
	Build_Foot_Bridge = "BUILD_Foot_Bridge",
	Build_Road_MG = "BUILD_Road_MG",
	Build_Side_MG = "BUILD_Side_MG",
	Build_Tank = "BUILD_Tank",
	Build_Tunnel_MG = "BUILD_Tunnel_MG",
	Build_West_Axis_Base_Fortification = "BUILD_West_Axis_Base_Fortification",
	Plant_Allied_Command_Post = "PLANT_Allied_Command_Post",
	Plant_Axis_Command_Post = "PLANT_Axis_Command_Post",
	Plant_Bridge = "PLANT_Bridge",
	Plant_East_Axis_Base_Fortification = "PLANT_East_Axis_Base_Fortification",
	Plant_Foot_Bridge = "PLANT_Foot_Bridge",
	Plant_Fuel_Dump = "PLANT_Fuel_Dump",
	Plant_Road_MG = "PLANT_Road_MG",
	Plant_Side_MG = "PLANT_Side_MG",
	Plant_Tunnel_MG = "PLANT_Tunnel_MG",
	Plant_West_Axis_Base_Fortification = "PLANT_West_Axis_Base_Fortification",
	Mount_Road_MG = "MOUNTMG42_Road_MG",
	Mount_Side_MG = "MOUNTMG42_Side_MG",
	Mount_Side_MG_1 = "MOUNTMG42_Side_MG_1",
	Mount_Tunnel_MG = "MOUNTMG42_Tunnel_MG",
	Mount_alliedtunnel_mg42 = "MOUNTMG42_alliedtunnel_mg42",
	Mount_axisbase_mg42 = "MOUNTMG42_axisbase_mg42",
	Repair_Road_MG = "REPAIRMG42_Road_MG",
	Repair_Side_MG = "REPAIRMG42_Side_MG",
	Repair_Side_MG_1 = "REPAIRMG42_Side_MG_1",
	Repair_Tunnel_MG = "REPAIRMG42_Tunnel_MG",
	Repair_alliedtunnel_mg42 = "REPAIRMG42_alliedtunnel_mg42",
	Repair_axisbase_mg42 = "REPAIRMG42_axisbase_mg42",
	Mover_tank = "MOVER_tank",

	DispenseHealthTime = 10.0,
	DispenseAmmoTime = 1.0,
	DefendingTeam = TEAM.AXIS,

	Tunnel_Doors = true,
	Depot_Gates = true,
	Tank_Over_Bridge = false,
	Tank_Near_Bridge = false,
	Front_Dump = false,
	Rear_Dump = false,
	FuelDumpDyno = 0,

	tbdoorOne = true, //open
	tbdoorTwo = true,

	TankStatus = 1, //tank is repaired by default
	BridgeStatus = 0, //not built
	FootBridgeStatus = 0,

	// allied covert op on depot roof will always be detected
	// key = position, value = radius
	CovertDetectionSpots =
	{
		{ Vector3(-10829, -6607, 640), 500 },
	},

	Switches =
	{
		tbdoorOne =
		{
			WaypointName = "tbdoor1",
			LimitTeam = 0,
			LimitClass = (1<<CLASS.COVERTOPS) | (1<<CLASS.FIELDOPS) | (1<<CLASS.SOLDIER),
			LimitBots = 1,
			Priority = 0, // leave for paththrough
		},

		tbdoorTwo =
		{
			WaypointName = "tbdoor2",
			LimitTeam = 0,
			LimitClass = (1<<CLASS.COVERTOPS) | (1<<CLASS.FIELDOPS) | (1<<CLASS.SOLDIER),
			LimitBots = 1,
			Priority = 0, // leave for paththrough
		},
	},

	// 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
	FallbackTriggered = false,
	AxisFallBack =
	{
		Name = "AxisFallBack",
		TriggerOnClass = CLASS.COVERTOPS,
		OnEnter = function(ent)
		{
			// only for allied covert ops in disguise
			if ( Map.FallbackTriggered || !GetEntFlags(ent, ENTFLAG.DISGUISED) || GetEntTeam(ent) != TEAM.ALLIES ) {
				return;
			}

			Map.FallbackTriggered = true;

			// 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, {
				Map.Build_West_Axis_Base_Fortification,
				"PLANTMINE_rGate.*",
				"DEFEND_rTeamDoor.*",
			});
		},
	},

	DepotRoofCounter = 0,
	DepotRoof =
	{
		Name = "DepotRoof",
		TriggerOnClass = CLASS.ANYPLAYER,
		OnEnter = function(ent)
		{
			// only for allied players
			if ( GetEntTeam(ent) != TEAM.ALLIES ) {
				return;
			}

			Map.DepotRoofCounter += 1;

			// don't do anything if depot hasn't been breached
			if ( Map.Depot_Gates ) {
				return;
			}

			// some goals to clear out the roof
			Util.EnableGroup( "depotroof", TEAM.AXIS );
		},
		OnExit = function(ent)
		{
			// only for allied players
			if ( GetEntTeam(ent) != TEAM.ALLIES ) {
				return;
			}

			Map.DepotRoofCounter -= 1;

			// is the roof clear?
			if ( Map.DepotRoofCounter < 1 ) {
				Util.DisableGroup( "depotroof", TEAM.AXIS );
			}
		},
	},

	Allied_Command_Post_Built = function( trigger )
	{
		Util.SetMaxUsersInProgress( 9, Map.Plant_Fuel_Dump);
		Util.MapDebugPrint( "Allied_Command_Post_Built" );
	},

	Allied_Command_Post_Destroyed = function( trigger )
	{
		Util.SetMaxUsersInProgress( 1, Map.Plant_Fuel_Dump);
		Util.MapDebugPrint( "Allied_Command_Post_Destroyed" );
	},

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

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

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

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

		// engineers should focus on bridge first
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			Map.Build_Tank,
			"ROUTE_mainbridgeRoute3",
		});
		SetAvailableMapGoals( TEAM.ALLIES, false, "SMOKEBOMB_allies_bridge.*" );

		SetAvailableMapGoals( TEAM.AXIS, false, {
			"CALLARTILLERY_arty_bridge_cons1",
			"CALLARTILLERY_arty_bridge_cons2",
			"MOBILEMORTAR_rBridge.*",
		});

		Util.MapDebugPrint( "Bridge_Built" );
	},

	Bridge_Damaged = function( trigger )
	{
		Map.BridgeStatus = 0;

		// Allied goals
		if ( Map.Tunnel_Doors )
		{
			if ( Map.FootBridgeStatus == 0 )
			{
				SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_Tunnel_Doors.*" );
			}

			SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_Bridge_.*" );
			SetAvailableMapGoals( TEAM.ALLIES, false, Map.Build_Tank );

			SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Tunnel_Doors.*" );
			SetAvailableMapGoals( TEAM.AXIS, true, {
				"DEFEND_Bridge_.*",
				"CALLARTILLERY_arty_bridge_cons1",
				"CALLARTILLERY_arty_bridge_cons2",
			});
		}

		if ( Map.FootBridgeStatus == 1 )
		{
			//turn this off so there is still a balanced attack
			SetAvailableMapGoals( TEAM.ALLIES, false, "ROUTE_footbridgeRoute" );
		}

		if ( !Map.Tank_Over_Bridge )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "SMOKEBOMB_allies_bridge.*" );
			SetAvailableMapGoals( TEAM.AXIS, true, "MOBILEMORTAR_rBridge.*" );
		}

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

		Util.MapDebugPrint( "Bridge_Damaged" );
	},

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

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

		// Allied goals
		// cs: allied bots shouldn't worry about this as it hurts axis chances of defusing
		// SetAvailableMapGoals( TEAM.ALLIES, true, Map.Plant_East_Axis_Base_Fortification );

		if ( Map.Rear_Dump && !Map.Depot_Gates )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, Map.Plant_Fuel_Dump );
			SetAvailableMapGoals( TEAM.AXIS, false, "ROUTE_FD_patrol" );
		}

		// Axis goals
		SetAvailableMapGoals( TEAM.AXIS, false, Map.Build_East_Axis_Base_Fortification );

		Util.MapDebugPrint( "East_Axis_Base_Fortification_Built" );
	},

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

		// Allied goals
		SetAvailableMapGoals( TEAM.ALLIES, false, Map.Plant_East_Axis_Base_Fortification );

		if ( !Map.Depot_Gates )
			{ SetAvailableMapGoals( TEAM.ALLIES, true, Map.Plant_Fuel_Dump ); }

		// Axis goals
		// cs: axis bots shouldn't build this. makes it harder to defuse
		//SetAvailableMapGoals( TEAM.AXIS, true, Map.Build_East_Axis_Base_Fortification );
		SetAvailableMapGoals( TEAM.AXIS, true, "ROUTE_FD_patrol" );

		Util.MapDebugPrint( "East_Axis_Base_Fortification_Damaged" );
	},

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

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

		// Allied goals
		SetAvailableMapGoals( TEAM.ALLIES, true, Map.Plant_West_Axis_Base_Fortification );

		if ( Map.Front_Dump && !Map.Depot_Gates )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, Map.Plant_Fuel_Dump );
			SetAvailableMapGoals( TEAM.AXIS, false, "ROUTE_FD_patrol" );
		}

		// Axis goals
		SetAvailableMapGoals( TEAM.AXIS, false, Map.Build_West_Axis_Base_Fortification );

		Util.MapDebugPrint( "West_Axis_Base_Fortification_Built" );
	},

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

		// Allied goals
		SetAvailableMapGoals( TEAM.ALLIES, false, Map.Plant_West_Axis_Base_Fortification );

		if ( !Map.Depot_Gates )
			{ SetAvailableMapGoals( TEAM.ALLIES, true, Map.Plant_Fuel_Dump ); }

		// Axis goals
		SetAvailableMapGoals( TEAM.AXIS, true, {
			Map.Build_West_Axis_Base_Fortification,
			"ROUTE_FD_patrol",
		});

		Util.MapDebugPrint( "West_Axis_Base_Fortification_Damaged" );
	},

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

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

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

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

		Util.MapDebugPrint( "Foot_Bridge_Built" );
	},

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

		//route some allies by the footbridge to provide some cover for engineers
		SetAvailableMapGoals( TEAM.ALLIES, true, "ROUTE_footbridgeRoute" );

		//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_.*" );
			SetAvailableMapGoals( TEAM.ALLIES, false, Map.Build_Tank );

			SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Tunnel_Doors.*" );
			SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Bridge_.*" );
		}

		if ( Map.Tunnel_Doors )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, Map.Build_Road_MG );
		}

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

		Util.MapDebugPrint( "Foot_Bridge_Destroyed" );
	},

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

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

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

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

	Tank_Built = function( trigger )
	{
		Map.TankStatus = 1;

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

		Util.MapDebugPrint( "Tank_Built" );
	},

	Tank_Destroyed = function( trigger )
	{
		Map.TankStatus = 0;

		//keep them focused on the tank
		SetAvailableMapGoals( TEAM.ALLIES, false, Map.Build_Allied_Command_Post );

		Util.MapDebugPrint( "Tank_Destroyed" );
	},

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

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

	Fuel_Dump_Planted = function( trigger )
	{
		// don't have everyone shift if cov ops assisted an eng through the door
		if ( TestMap || Map.Depot_Gates )
			{ return; }

		Map.FuelDumpDyno += 1;

		// focus on the defuse
		SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_.*" );

		// and have teammates help
		SetAvailableMapGoals( TEAM.AXIS, true, "CAMP_fueldump.*" );
		Map.FuelDumpShifted = true;

		//toggle these for immediate shift
		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 );

		// randomize plant goal position
		rand = RandInt( 1,4 );
		if ( rand == 1 )
			{ Util.SetGoalPosition( -10840,-7310,450, Map.Plant_Fuel_Dump ); }
		else if ( rand == 2 )
			{ Util.SetGoalPosition( -10830,-7570,250, Map.Plant_Fuel_Dump ); }
		else if ( rand == 3 )
			{ Util.SetGoalPosition( -10890,-7430,250, Map.Plant_Fuel_Dump ); }
		else
			{ Util.SetGoalPosition( -10750,-7423,250, Map.Plant_Fuel_Dump ); }

		Util.MapDebugPrint( "Fuel_Dump_Planted" );
	},

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

		// no more dyno. allow building of west gate. and don't worry about any other build goals
		if ( Map.FuelDumpDyno < 1 ) {
			SetAvailableMapGoals( TEAM.AXIS, true, Map.Build_West_Axis_Base_Fortification );
			SetAvailableMapGoals( TEAM.AXIS, false, "CAMP_fueldump.*" );
			Map.FuelDumpShifted = false;
		}
	},

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

	tunnelgrate_Destroyed = function( trigger )
	{
		// Allied goals
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			Map.Mount_Tunnel_MG,
			Map.Repair_Tunnel_MG,
		});

		// Axis goals
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Tunnel_Grate.*" );

		Util.MapDebugPrint( "tunnelgrate_Destroyed" );
	},

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

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

		// Allied goals
		sleep( 2 );
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			Map.Build_Bridge,
			"BUILD_Foot_Bridge",
			"SNIPE_bTowerMg.*",
			"GRENADE_tunnel_mg",
			"MOBILEMORTAR_bBridge.*",
		});
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"GRENADE_axis_base_mg",
			"ATTACK_Depot_Gates.*",
			"ATTACK_Tank_Bay.*",
			Map.Build_Side_MG,
			Map.Mount_Side_MG_1,
			Map.Repair_Side_MG_1,
			Map.Build_Allied_Command_Post,
			Map.Plant_Tunnel_MG,
		});
		SetGoalPriority( "DEFUSE_Bridge.*", 0.0, TEAM.ALLIES, CLASS.ENGINEER, true );
		SetGoalPriority( "DEFUSE_Foot_Bridge.*", 0.0, TEAM.ALLIES, CLASS.ENGINEER, true );

		// Axis goals
		Util.DisableGroup( "tdoor", TEAM.AXIS );
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_rTeamDoor.*",
			"DEFEND_Tunnel_Grate.*",
			"MOBILEMORTAR_rBridge.*",
		});
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Depot_Gates.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, {
			Map.Build_Tunnel_MG,
			Map.Build_Axis_Command_Post,
			Map.Plant_Foot_Bridge,
			Map.Plant_Bridge,
			Map.Mount_Tunnel_MG,
		});
		SetAvailableMapGoals( TEAM.AXIS, true, Map.Mount_axisbase_mg42 );
		SetAvailableMapGoals( TEAM.AXIS, false, Map.Repair_Tunnel_MG );
		SetAvailableMapGoals( TEAM.AXIS, true, {
			Map.Repair_axisbase_mg42,
			Map.Build_Side_MG,
		});
		//SetAvailableMapGoals( TEAM.AXIS, true, Map.Build_East_Axis_Base_Fortification );
		SetAvailableMapGoals( TEAM.AXIS, true, {
			Map.Build_West_Axis_Base_Fortification,
			Map.Plant_Side_MG,
			Map.Plant_Allied_Command_Post,
			Map.Mount_Side_MG,
			Map.Repair_Side_MG,
		});
		SetGoalPriority( "DEFUSE_Axis_Command_Post.*", 0.0, TEAM.AXIS, CLASS.ENGINEER, true );
		SetGoalPriority( "DEFUSE_Axis_Tunnel_MG.*", 0.0, TEAM.AXIS, CLASS.ENGINEER, true );

		if ( Map.tbdoorOne )
			{ Map.Switches.tbdoorOne.LimitTeam = (1<<TEAM.AXIS); }
		else
			{ Map.Switches.tbdoorOne.LimitTeam = (1<<TEAM.ALLIES); }

		if ( Map.tbdoorTwo )
			{ Map.Switches.tbdoorTwo.LimitTeam = (1<<TEAM.AXIS); }
		else
			{ Map.Switches.tbdoorTwo.LimitTeam = (1<<TEAM.ALLIES); }

		Util.MapDebugPrint( "tunneldoors_Destroyed" );
	},

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

		// Allied goals
		sleep( 2 );
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"ATTACK_Depot_Gates.*",
			"ATTACK_Tank_Bay.*",
		});
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"ATTACK_Fuel_Dump_[123]",
			"ATTACK_Depot_Side_Wall.*",
		});

		if ( !Map.Front_Dump )
			{ SetAvailableMapGoals( TEAM.ALLIES, true, Map.Plant_Fuel_Dump ); }

		// Axis goals
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_Depot_Gates.*",
			Map.Build_Side_MG,
		});
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Fuel_Dump_.*" );
		Util.EnableGroup( "depotwall", TEAM.AXIS );
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANTMINE_rGate.*" );
		SetGoalPriority( "DEFUSE_Side_MG.*", 0.0, TEAM.AXIS, CLASS.ENGINEER, true );

		// did a cov ops sneak through and up on the roof early?
		if ( Map.DepotRoofCounter > 0 ) {
			Util.EnableGroup( "depotroof", TEAM.AXIS );
		}

		// call arty from further back now
		Util.DisableGroup( "depotwallarty", TEAM.AXIS );
		Util.EnableGroup( "depotarty", TEAM.AXIS );

		// set up some bot chat warnings about incoming enemies based on region triggers
		iw1 = OnTriggerRegion( AABB(-11668,-5740,161, -11469,-5512,393), RegionTrigger.IntrusionWarning );
		iw2 = OnTriggerRegion( AABB(-9952,-5522,180, -9628,-5333,364), RegionTrigger.IntrusionWarning );
		iw3 = OnTriggerRegion( AABB(-10136,-6699,146, -9994,-6608,367), RegionTrigger.IntrusionWarning );
		iw4 = OnTriggerRegion( AABB(-11369,-7391,160, -11206,-6991,433), RegionTrigger.IntrusionWarning );
		io1 = OnTriggerRegion( AABB(-11184,-7426,178, -11106,-7005,410), RegionTrigger.IntrusionWarningEngObj );
		io2 = OnTriggerRegion( AABB(-11064,-7099,158, -10926,-6968,339), RegionTrigger.IntrusionWarningEngObj );
		io3 = OnTriggerRegion( AABB(-10580,-7450,158, -10445,-7011,397), RegionTrigger.IntrusionWarningEngObj );
		ac1 = OnTriggerRegion( AABB(-10861,-7124,165, -10641,-6995,351), RegionTrigger.AllClear );

		Util.MapDebugPrint( "depotgates_Destroyed" );
	},

	depotsidewall_Destroyed = function( trigger )
	{
		// Allied goals
		sleep( 2 );
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"ATTACK_Depot_Side_Wall.*",
			"MOUNT_tank",
			"ESCORT_tank",
			"BUILD_Tank",
		});
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"ATTACK_Fuel_Dump_[45]",
			Map.Plant_West_Axis_Base_Fortification,
		});

		// Axis goals
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANTMINE_rWall.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, Map.Build_Side_MG );

		Util.MapDebugPrint( "depotsidewall_Destroyed" );
	},

	tbdoorone = function( trigger )
	{
		if ( !Map.Tunnel_Doors )
		{
			vel = ToVector(trigger.Action);

			if ( vel[2] < 0 )
			{
				Map.Switches.tbdoorOne.LimitTeam = (1<<TEAM.ALLIES);
				Util.LimitToTeam( TEAM.ALLIES, "SWITCH_tbdoor1" );
				Util.MapDebugPrint("tbdoor1 closing", true);
			}
			else if ( vel[2] > 0 )
			{
				if ( Map.Depot_Gates )
				{
					Map.Switches.tbdoorOne.LimitTeam = (1<<TEAM.AXIS);
					Util.LimitToTeam( TEAM.AXIS, "SWITCH_tbdoor1" );
				}
				else
				{
					Map.Switches.tbdoorOne.LimitTeam = 0;
					SetAvailableMapGoals( 0, false, "SWITCH_tbdoor1" );
				}

				Util.MapDebugPrint("tbdoor1 opening", true);
			}
		}

		Util.MapDebugPrint("tbdoor1");
	},

	tbdoortwo = function( trigger )
	{
		if ( !Map.Tunnel_Doors )
		{
			vel = ToVector(trigger.Action);

			if ( vel[2] < 0 )
			{
				Map.Switches.tbdoorTwo.LimitTeam = (1<<TEAM.ALLIES);
				Util.LimitToTeam( TEAM.ALLIES, "SWITCH_tbdoor2" );
				Util.MapDebugPrint("tbdoor2 closing", true);
			}
			else if ( vel[2] > 0 )
			{
				if ( Map.Depot_Gates )
				{
					Map.Switches.tbdoorTwo.LimitTeam = (1<<TEAM.AXIS);
					Util.LimitToTeam( TEAM.AXIS, "SWITCH_tbdoor2" );
				}
				else
				{
					Map.Switches.tbdoorTwo.LimitTeam = 0;
					SetAvailableMapGoals( 0, false, "SWITCH_tbdoor2" );
				}

				Util.MapDebugPrint("tbdoor2 opening", true);
			}
		}

		Util.MapDebugPrint("tbdoor2");
	},

	tank_near_bridge = function()
	{
		Map.Tank_Near_Bridge = true;

		Util.MapDebugPrint( "tank_near_bridge" );
	},

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

		// Allied goals
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"SMOKEBOMB_allies_bridge.*",
			Map.Ammo_Cabinet_alliedhut_ammocabinet,
			"ATTACK_Bridge_.*",
		});
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_Tunnel_Doors.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			Map.Health_Cabinet_alliedhut_healthcabinet,
			"CALLARTILLERY_bTowerHill.*",
			"ARTILLERY_S_bTowerHill2.*",
		});
		Util.DisableGroup( "roadmg", TEAM.ALLIES );

		// Axis goals
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Bridge_.*" );
		Util.EnableGroup( "tdoor", TEAM.AXIS );
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"PLANTMINE_rFootbridge.*",
			"MOBILEMORTAR_rBridge.*",
		});

		Util.MapDebugPrint( "tank_over_bridge" );
	},

	tank_in_tunnel = function()
	{
		// keep these active until it's in tunnel so humans cant just hang back and keep
		// tank from moving
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"ATTACK_Tunnel_Doors.*",
			"PLANT_Tunnel_MG",
		});
		SetAvailableMapGoals( TEAM.ALLIES, true, Map.Build_Side_MG );
		Util.EnableGroup( "tunnelexitarty", TEAM.AXIS );

		Util.MapDebugPrint( "tank_in_tunnel" );
	},

	tank_past_tunnel = function()
	{
		Util.DisableGroup( "tunnelexitarty", TEAM.AXIS );
		Util.EnableGroup( "depotwallarty", TEAM.AXIS );
		Util.DisableGroup( "forwarddepot", TEAM.AXIS ); // disable camps inside tunnel
		Util.MapDebugPrint( "tank_past_tunnel" );
	},

	tank_at_location = function( trigger )
	{
		switch(Map.VehicleLocation)
		{
			case 1:
			{
				Map.tank_near_bridge();
			}
			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( -10850.705,-7440.844,264.125, Map.Plant_Fuel_Dump );
	Util.SetGoalPosition( -3712.607,-4382.545,248.125, Map.Plant_Bridge );
	Util.SetGoalPosition( -1218.925,-3095.991,408.092, Map.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_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.Side_MG_Built );
	OnTrigger( "Axis team has constructed the Side MG Nest!", Map.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( "Defused at the Fuel Dump.", Map.Fuel_Dump_Defused );
	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.Side_MG_Destroyed );
	OnTrigger( "Axis team has destroyed the Side MG Nest!", Map.Side_MG_Destroyed );
	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
	nearbridge = OnTriggerRegion(AABB(-3337.337,-6550.084,207.125,-3016.404,-6386.294,284.880), RegionTrigger.VehicleTrigger);
	overbridge = OnTriggerRegion(AABB(-3810.875,-4750.004,211.125,-3611.125,-4491.826,291.954), RegionTrigger.VehicleTrigger);
	intunnel = OnTriggerRegion(AABB(-5693.422,-2970.203,209.125,-5602.288,-2678.854,291.125), RegionTrigger.VehicleTrigger);
	exittunnel = OnTriggerRegion(AABB(-7926.541,-2944.875,209.125,-7809.442,-2687.126,283.125), RegionTrigger.VehicleTrigger);

	// disable push and combat movement around the first tower mg, fuel tank ladder and depot wall for better pathing
	cm = OnTriggerRegion(AABB(-3733.483,-2051.376,652.817,-3449.874,-1751.765,1083.265), RegionTrigger.DisableBotPush);
	wall = OnTriggerRegion(AABB(-10136.874,-5462.146,441.125,-8755.125,-5162.832,523.125), RegionTrigger.DisableBotPush);
	fueltankladder = OnTriggerRegion(AABB(-10908.676,-7287.709,182.167,-10720.402,-7071.353,566.530), RegionTrigger.DisableBotPush);

	// detect covert ops sneaking through tunnel grate
	fallback = OnTriggerRegion(AABB(-6720.574,-1895.911,321.125,-6626.926,-1558.944,403.125), Map.AxisFallBack);

	// detect allies on the depot roof
	depotroof = OnTriggerRegion(AABB(-11424.124,-6971.128,537.125,-10310.962,-6210.208,944.180), Map.DepotRoof);

	// Max users per goal
	Util.SetMaxUsersInProgress( 2, "ATTACK_.*" );
	Util.SetMaxUsers( 1, "DEFEND_.*" );
	Util.SetMaxUsers( 1, "CAMP_.*" );
	Util.SetMaxUsers( 1, "MOUNTMG42.*" );
	Util.SetMaxUsersInProgress( 2, "MOUNT_tank" );
	Util.SetMaxUsersInUse( 1, "ESCORT_tank" );
	Util.SetMaxUsersInProgress( 2, "ESCORT_tank" );
	Util.SetMaxUsers( 1, "SMOKEBOMB_.*" );
	Util.SetMaxUsers( 1, "GRENADE_.*" );
	Util.SetMaxUsers( 1, "BUILD_Road_MG" );
	Util.SetMaxUsers( 1, "REPAIRMG.*" );

	SetMapGoalProperties( "ATTACK_.*", {MinCampTime=10, MaxCampTime=30} );
	SetMapGoalProperties( "DEFEND_.*", {MinCampTime=10, MaxCampTime=15} );
	SetMapGoalProperties( "CAMP_.*", {MinCampTime=15, MaxCampTime=30} );
	SetMapGoalProperties( "BUILD_.*", {ignoretarget=true} );
	SetMapGoalProperties( "MOUNTMG42_.*", {MinCampTime=45, MaxCampTime=90} );
	SetMapGoalProperties( "MOBILEMG42_.*", {MinCampTime=120, MaxCampTime=180} );
	SetMapGoalProperties( "SNIPE_.*", {MinCampTime=120, MaxCampTime=180} );

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

	SetGoalPriority( "GRENADE_.*", 0.7 );
	SetGoalPriority( "MOUNTMG42_.*", 0.0, 0, CLASS.MEDIC );
	SetGoalPriority( "MOUNTMG42_.*", 0.0, 0, CLASS.ENGINEER );
	SetGoalPriority( "SMOKEBOMB_allies_bridge.*", 0.8, 0, CLASS.COVERTOPS );
	SetGoalPriority( Map.Plant_Side_MG, 0.0, 0, CLASS.ENGINEER );

	// Allied goals
	SetGoalPriority( Map.Plant_Axis_Command_Post, 0.0, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( Map.Plant_Tunnel_MG, 0.0, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( Map.Plant_Fuel_Dump, 0.85, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "BUILD_Road_MG", 0.91, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "DEFUSE_Road_MG.*", 0.0, TEAM.ALLIES, CLASS.ENGINEER, true );

	// Axis goals
	SetGoalPriority( Map.Plant_Allied_Command_Post, 0.0, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( Map.Plant_Foot_Bridge, 0.0, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( Map.Plant_Road_MG, 0.0, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "HEALTHCAB_.*", 0.0, TEAM.AXIS );
	SetGoalPriority( "CAMP_fueldump.*", 0.75, TEAM.AXIS );
	SetGoalPriority( "CAMP_roofclear.*", 0.76, TEAM.AXIS );
	SetGoalPriority( "AIRSTRIKE_roofclear.*", 0.85, TEAM.AXIS, CLASS.FIELDOPS );
	SetGoalPriority( "DEFEND_rTeamDoor.*", 0.75, TEAM.AXIS );
	Util.LimitToClass( "DEFEND_rTeamDoor.*", TEAM.AXIS, CLASS.ENGINEER );

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

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

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

	Util.SetMaxUsersInProgress( 1, "BUILD_Allied_Command_Post");
	Util.SetMaxUsersInProgress( 1, Map.Plant_Fuel_Dump);
	SetGoalPriority("BUILD_Allied_Command_Post", 0.85);

	//set up some routing
	MapRoutes =
	{
		ATTACK_Bridge_1 =
		{
			ROUTE_AllySpawn =
			{
				ROUTE_mainbridgeRoute1 = {},
				ROUTE_mainbridge4 =
				{
					ROUTE_mainbridge5 =
					{
						ROUTE_mainbridgeRoute2 = {}
					},
				},
			},
			ROUTE_AllySpawn2 =
			{
				ROUTE_mainbridgeRoute1 = {},
				ROUTE_mainbridge4 =
				{
					ROUTE_mainbridge5 =
					{
						ROUTE_mainbridgeRoute2 = {}
					},
				},
			},
			ROUTE_AllySpawn3 =
			{
				ROUTE_mainbridgeRoute1 = {},
				ROUTE_mainbridge4 =
				{
					ROUTE_mainbridge5 =
					{
						ROUTE_mainbridgeRoute2 = {}
					},
				},
			},
		},
		BUILD_Bridge =
		{
			ROUTE_AllySpawn =
			{
				ROUTE_mainbridgeRoute1 = {},
				ROUTE_mainbridge4 =
				{
					ROUTE_mainbridge5 =
					{
						ROUTE_mainbridgeRoute2 = {}
					},
				},
			},
			ROUTE_AllySpawn2 =
			{
				ROUTE_mainbridgeRoute1 = {},
				ROUTE_mainbridge4 =
				{
					ROUTE_mainbridge5 =
					{
						ROUTE_mainbridgeRoute2 = {}
					},
				},
			},
			ROUTE_AllySpawn3 =
			{
				ROUTE_mainbridgeRoute1 = {},
				ROUTE_mainbridge4 =
				{
					ROUTE_mainbridge5 =
					{
						ROUTE_mainbridgeRoute2 = {}
					},
				},
			},
		},
		ATTACK_Tunnel_Doors_1 =
		{
			ROUTE_AllySpawn =
			{
				ROUTE_footbridgeRoute2 = {Weight = 2,},
				ROUTE_mainbridgeRoute1 = {},
				ROUTE_mainbridge4 =
				{
					ROUTE_mainbridge5 =
					{
						ROUTE_mainbridgeRoute2 = {}
					},
				},
			},
			ROUTE_AllySpawn2 =
			{
				ROUTE_footbridgeRoute2 = {Weight = 2,},
				ROUTE_mainbridgeRoute1 = {},
				ROUTE_mainbridge4 =
				{
					ROUTE_mainbridge5 =
					{
						ROUTE_mainbridgeRoute2 = {}
					},
				},
			},
			ROUTE_AllySpawn3 =
			{
				ROUTE_footbridgeRoute2 = {Weight = 2,},
				ROUTE_mainbridgeRoute1 = {},
				ROUTE_mainbridge4 =
				{
					ROUTE_mainbridge5 =
					{
						ROUTE_mainbridgeRoute2 = {}
					},
				},
			},
		},
		BUILD_Allied_Command_Post =
		{
			ROUTE_TunnelSpawn1 =
			{
				ROUTE_northtunnel =
				{
					ROUTE_cphill = {},
					ROUTE_cpflank = {},
				},
			},
			ROUTE_TunnelSpawn2 =
			{
				ROUTE_northtunnel =
				{
					ROUTE_cphill = {},
					ROUTE_cpflank = {},
				},
			},
		},
		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 = {},
				},
			},
			ROUTE_TunnelSpawn2 =
			{
				ROUTE_maintunnel =
				{
					ROUTE_eTankPath1 = { ROUTE_eTankPath2 = {}, },
					ROUTE_wTankPath1 = { ROUTE_wTankPath2 = {}, },
				},
				ROUTE_northtunnel =
				{
					ROUTE_cphill = {},
					ROUTE_cpflank = {},
				},
				ROUTE_southtunnel =
				{
					Weight = 2,
					ROUTE_southtunnel2 = {},
				},
			},
		},
		ATTACK_Fuel_Dump_1 =
		{
			ROUTE_TunnelSpawn1 =
			{
				ROUTE_maintunnel =
				{
					ROUTE_eTankPath1 = { ROUTE_eTankPath2 = {}, },
					ROUTE_wTankPath1 = { ROUTE_wTankPath2 = {}, },
					ROUTE_cphill =
					{
						ROUTE_depotgate = {},
						ROUTE_sidewall = { ROUTE_sidewall2 = {}, },
					},
				},
				ROUTE_northtunnel =
				{
					ROUTE_cphill = {},
					ROUTE_cpflank =
					{
						ROUTE_sidewall = { ROUTE_sidewall2 = {}, },
					},
				},
				ROUTE_southtunnel =
				{
					Weight = 2,
					ROUTE_southtunnel2 = {},
				},
			},
			ROUTE_TunnelSpawn2 =
			{
				ROUTE_maintunnel =
				{
					ROUTE_eTankPath1 = { ROUTE_eTankPath2 = {}, },
					ROUTE_wTankPath1 = { ROUTE_wTankPath2 = {}, },
					ROUTE_cphill =
					{
						ROUTE_depotgate = {},
						ROUTE_sidewall = { ROUTE_sidewall2 = {}, },
					},
				},
				ROUTE_northtunnel =
				{
					ROUTE_cphill = {},
					ROUTE_cpflank =
					{
						ROUTE_sidewall = { ROUTE_sidewall2 = {}, },
					},
				},
				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 = {}, }
			},
			ROUTE_FuelDumpSpawn2 =
			{
				ROUTE_cphill2 = { Weight = 2, },
				ROUTE_sidewall2 = { ROUTE_sidewall = {}, }
			},
		},
		DEFEND_Fuel_Dump_6 =
		{
			ROUTE_FuelDumpSpawn1 =
			{
				ROUTE_FD_stairs = {},
				ROUTE_FD_back =
				{
					ROUTE_FD_weststairs = {},
					ROUTE_FD_opengate = {},
				},
				ROUTE_FD_patrol = { Weight = 2, },
			},
			ROUTE_FuelDumpSpawn2 =
			{
				ROUTE_FD_stairs = {},
				ROUTE_FD_back =
				{
					ROUTE_FD_weststairs = {},
					ROUTE_FD_opengate = {},
				},
				ROUTE_FD_patrol = { Weight = 2, },
			},
		},
		PLANTMINE_rGate1 =
		{
			ROUTE_FuelDumpSpawn1 =
			{
				ROUTE_FD_back = {},
				ROUTE_FD_patrol = { Weight = 2, },
			},
			ROUTE_FuelDumpSpawn2 =
			{
				ROUTE_FD_back = {},
				ROUTE_FD_patrol = { Weight = 2, },
			},
		},
		GRENADE_axis_base_mg =
		{
			ROUTE_TunnelSpawn1 =
			{
				ROUTE_southtunnel =
				{
					Weight = 2,
					ROUTE_southtunnel2 = {},
				},
			},
			ROUTE_TunnelSpawn2 =
			{
				ROUTE_southtunnel =
				{
					Weight = 2,
					ROUTE_southtunnel2 = {},
				},
			},
		},
	};

	//copy some routes
	MapRoutes.ATTACK_Bridge_2 = MapRoutes.ATTACK_Bridge_1;
	MapRoutes.ATTACK_Bridge_3 = MapRoutes.ATTACK_Bridge_1;
	MapRoutes.ATTACK_Bridge_5 = MapRoutes.ATTACK_Bridge_1;
	MapRoutes.ATTACK_Tunnel_Doors_2 = MapRoutes.ATTACK_Tunnel_Doors_1;
	MapRoutes.ATTACK_Tunnel_Doors_3 = MapRoutes.ATTACK_Tunnel_Doors_1;
	MapRoutes.ATTACK_Tunnel_Doors_4 = MapRoutes.ATTACK_Tunnel_Doors_1;
	MapRoutes.ATTACK_Tunnel_Doors_5 = MapRoutes.ATTACK_Tunnel_Doors_1;
	MapRoutes.ATTACK_Depot_Gates_2 = MapRoutes.ATTACK_Depot_Gates_1;
	MapRoutes.ATTACK_Depot_Gates_3 = MapRoutes.ATTACK_Depot_Gates_1;
	MapRoutes.ATTACK_Tank_Bay_1 = MapRoutes.ATTACK_Depot_Gates_1;
	MapRoutes.ATTACK_Tank_Bay_2 = MapRoutes.ATTACK_Depot_Gates_1;
	MapRoutes.PLANT_Tunnel_MG = MapRoutes.BUILD_Allied_Command_Post;
	MapRoutes.MOUNTMG42_alliedtunnel_mg42 = MapRoutes.BUILD_Allied_Command_Post;
	MapRoutes.REPAIRMG42_alliedtunnel_mg42 = MapRoutes.BUILD_Allied_Command_Post;
	MapRoutes.ATTACK_Fuel_Dump_2 = MapRoutes.ATTACK_Fuel_Dump_1;
	MapRoutes.ATTACK_Fuel_Dump_3 = MapRoutes.ATTACK_Fuel_Dump_1;
	MapRoutes.ATTACK_Fuel_Dump_4 = MapRoutes.ATTACK_Fuel_Dump_1;
	MapRoutes.ATTACK_Fuel_Dump_5 = MapRoutes.ATTACK_Fuel_Dump_1;
	MapRoutes.ATTACK_Fuel_Dump_6 = MapRoutes.ATTACK_Fuel_Dump_1;
	MapRoutes.ATTACK_Fuel_Dump_7 = MapRoutes.ATTACK_Fuel_Dump_1;
	MapRoutes.ATTACK_Fuel_Dump_8 = MapRoutes.ATTACK_Fuel_Dump_1;
	MapRoutes.ATTACK_Fuel_Dump_9 = MapRoutes.ATTACK_Fuel_Dump_1;
	MapRoutes.PLANT_Fuel_Dump = MapRoutes.ATTACK_Fuel_Dump_1;
	MapRoutes.DEFEND_Depot_Gates_7 = MapRoutes.DEFEND_Depot_Gates_6;
	MapRoutes.DEFEND_Depot_Gates_8 = MapRoutes.DEFEND_Depot_Gates_6;
	MapRoutes.DEFEND_Depot_Gates_9 = MapRoutes.DEFEND_Depot_Gates_6;
	MapRoutes.DEFEND_Depot_Gates_10 = MapRoutes.DEFEND_Depot_Gates_6;
	MapRoutes.DEFEND_Depot_Gates_11 = MapRoutes.DEFEND_Depot_Gates_6;
	MapRoutes.DEFEND_Depot_Gates_12 = MapRoutes.DEFEND_Depot_Gates_6;
	MapRoutes.DEFEND_Depot_Gates_13 = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes.DEFEND_Depot_Gates_14 = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes.DEFEND_Depot_Gates_15 = MapRoutes.DEFEND_Fuel_Dump_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_7 = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes.DEFEND_Fuel_Dump_8 = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes.DEFEND_Fuel_Dump_9 = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes.DEFEND_Fuel_Dump_10 = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes.DEFEND_Fuel_Dump_11 = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes.DEFEND_Fuel_Dump_12 = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes.DEFEND_Fuel_Dump_13 = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes.DEFEND_Fuel_Dump_14 = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes.CALLARTILLERY_rDepotWall1 = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes.CALLARTILLERY_rDepotWall2 = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes.CALLARTILLERY_rTunnelExit1 = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes.CALLARTILLERY_rTunnelExit2 = MapRoutes.DEFEND_Fuel_Dump_6;
	MapRoutes.PLANTMINE_rGate2 = MapRoutes.PLANTMINE_rGate1;
	MapRoutes.PLANTMINE_rGate3 = MapRoutes.PLANTMINE_rGate1;
	MapRoutes.PLANTMINE_rGate4 = MapRoutes.PLANTMINE_rGate1;
	MapRoutes.PLANTMINE_rGate5 = MapRoutes.PLANTMINE_rGate1;
	MapRoutes.PLANTMINE_rGate6 = MapRoutes.PLANTMINE_rGate1;
	MapRoutes.PLANTMINE_rWall1 = MapRoutes.PLANTMINE_rGate1;
	MapRoutes.PLANTMINE_rWall2 = MapRoutes.PLANTMINE_rGate1;
	MapRoutes.PLANTMINE_rWall3 = MapRoutes.PLANTMINE_rGate1;
	MapRoutes.PLANTMINE_rWall4 = MapRoutes.PLANTMINE_rGate1;
	MapRoutes.CAMP_fueldump1 = MapRoutes.PLANTMINE_rGate1;
	MapRoutes.CAMP_fueldump2 = MapRoutes.PLANTMINE_rGate1;
	MapRoutes.CAMP_fueldump3 = MapRoutes.PLANTMINE_rGate1;
	MapRoutes.CAMP_fueldump4 = MapRoutes.PLANTMINE_rGate1;

	Util.Routes(MapRoutes);
	Util.UpdateSwitchData();
	Util.MapDebugPrint( "OnMapLoad" );
};

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