//=================================================================================================
//
//	mlb_beach.gm
//
//	  Who              	When			                   What
//-------------------------------------------------------------------------------------------------
//	native12		19 November 2011	      Initial Script and more for fun beach final
//   [UJE]Captain	      24 may 2018	            reworked the final fun beach version of native12,
//                                              and adjusted for MLB beach
//
//=================================================================================================

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

	Assault_Ramp_Dyno = 0,
	Axis_staircase_access_doors_Dyno = 0,
	Command_Post_Dyno = 0,
	Front_Bunker_Door_Dyno = 0,
	Generator_Protection_Net_Dyno = 0,
	Lower_Bunker_Door_Dyno = 0,
	Metal_Staircase_Dyno = 0,
	Radar_base_MG_Nest_Dyno = 0,
	Ventialtion_Generator_Dyno = 0,
	main_base_wall_breach_Dyno = 0,
	Radar_door_Dyno = 0,
	radar_equipment_Dyno = 0,

	radar_equipment = true,
	Hatch_destroyed = false,
	WallBeachFence_destroyed = false,
	LowerFence_destroyed = false,
	flag_1_axis = true,
	Front_Bunker_Door = true,
	Lower_Bunker_Door = true,
	Main_base_wall_breach = true,
	Ally_CP = false,
	Axis_CP = false,
	Ventialtion_Generator = true,
	Assault_Ramp = false,
	Generator_Protection_Net = false,
	count_allies_in_underground = 0,
	count_engs_in_underground = 0,
	Hatch1_destroyed = false,
	Hatch2_destroyed = false,
	Hatch3_destroyed = false,
	Axis_staircase_access_doors = true,
	Metal_Staircase = false,
	flag2_Axis = true,
	Staircase_MG = false,
	Radar_base_MG = false,
	count_allied_engs_inside_protection = 0,
	count_allies_in_radarBaseTrigger = 0,
	count_engs_in_radarBaseTrigger = 0,
	count_allies_in_spawn = 0,
	count_engs_in_spawn = 0,
	liftupp = 0,
	KT1_insideProtectionNet = 0,

	Navigation =
	{
		//	/bot waypoint_setproperty paththrough Navigation_PT:hatch
		hatch =
		{
			gotowp = "CP_hatch", // waypoint for the bot to go to before doing anything else
			EvalFunc = function() // if this function returns false, navigation will not run
			{
				return !Map.Hatch_destroyed;
			},

			navigate = function(_this)
			{
				if ( Map.Hatch_destroyed )
				{
					yield();
					return;
				}

				_this.AddWeaponRequest(WEAPON.KNIFE);
				_this.AddAimRequest(Priority.High, "position", Vector3(2658.264160, 990.539124, 1160.125000));

				while( !Map.Hatch_destroyed )
				{
					_this.Bot.HoldButton(BTN.CROUCH, 1);
					_this.Bot.HoldButton(BTN.ATTACK1, 1);
					yield();
				}

				_this.ReleaseAimRequest();
				_this.ReleaseWeaponRequest();
			},
		},
		//	/bot waypoint_setproperty paththrough Navigation_PT:wallbeachfence
		wallbeachfence =
		{
			gotowp = "wall_beach_fence", // waypoint for the bot to go to before doing anything else
			EvalFunc = function() // if this function returns false, navigation will not run
			{
				return !Map.WallBeachFence_destroyed;
			},

			navigate = function(_this)
			{
				if ( Map.WallBeachFence_destroyed )
				{
					yield();
					return;
				}
				foreach ( id and bot in BotTable )
				{
					if ( bot.GetTeam() == TEAM.AXIS )
					{
						_this.AddWeaponRequest( WEAPON.AXIS_GRENADE);
					}
					else
					{
						_this.AddWeaponRequest( WEAPON.ALLY_GRENADE);
					}
				}
				_this.AddAimRequest(Priority.High, "facing", Vector3(0.886, -0.306, -0.347));

				while( !Map.WallBeachFence_destroyed )
				{
					_this.Bot.HoldButton(BTN.ATTACK1, 1);
					sleep(2);
				}

				_this.ReleaseAimRequest();
				_this.ReleaseWeaponRequest();
			},
		},
		//	/bot waypoint_setproperty paththrough Navigation_PT:lowerfence
		lowerfence =
		{
			gotowp = "lower_fence", // waypoint for the bot to go to before doing anything else
			EvalFunc = function() // if this function returns false, navigation will not run
			{
				return !Map.LowerFence_destroyed;
			},

			navigate = function(_this)
			{
				if ( Map.LowerFence_destroyed )
				{
					yield();
					return;
				}
				foreach ( id and bot in BotTable )
				{
					if ( bot.GetTeam() == TEAM.AXIS )
					{
						_this.AddWeaponRequest( WEAPON.AXIS_GRENADE);
					}
					else
					{
						_this.AddWeaponRequest( WEAPON.ALLY_GRENADE);
					}
				}

				_this.AddAimRequest(Priority.High, "facing", Vector3(0.742654,0.648859,0.165670));

				while( !Map.LowerFence_destroyed )
				{
					_this.Bot.HoldButton(BTN.ATTACK1, 1);
					sleep(4);
				}

				_this.ReleaseAimRequest();
				_this.ReleaseWeaponRequest();
			},
		},

		//	/bot waypoint_setproperty paththrough Navigation_PT:pipe1
		pipe1 =
		{
			navigate = function(_this)
			{
				_this.AddAimRequest(Priority.High, "facing", Vector3(-0.004775,0.036496,0.999322));
				_this.Bot.HoldButton(BTN.BACKWARD, 2);
				sleep(2);
			},
		},
		//	/bot waypoint_setproperty paththrough Navigation_PT:jump_to_CP
		jump_to_CP =
		{
			navigate = function(_this)
			{
				_this.AddAimRequest(Priority.High, "facing", Vector3(-0.076626,-0.990874,0.110889));
				_this.Bot.HoldButton(BTN.FORWARD, 1);
				_this.Bot.HoldButton(BTN.JUMP, 1);
				sleep(1);
			},
		},
		//	/bot waypoint_setproperty paththrough Navigation_PT:hatch1
		hatch1 =
		{
			EvalFunc = function() // if this function returns false, navigation will not run
			{
				return !Map.Hatch1_destroyed;
			},

			navigate = function(_this)
			{
				if ( Map.Hatch1_destroyed )
				{
					yield();
					return;
				}

				_this.AddWeaponRequest(WEAPON.KNIFE);
				_this.AddAimRequest(Priority.High, "facing", Vector3(-0.068, -0.200, -0.977));

				while( !Map.Hatch1_destroyed )
				{
					_this.Bot.HoldButton(BTN.CROUCH, 1);
					_this.Bot.HoldButton(BTN.ATTACK1, 1);
					yield();
				}

				_this.ReleaseAimRequest();
				_this.ReleaseWeaponRequest();
			},
		},
		//	/bot waypoint_setproperty paththrough Navigation_PT:hatch2
		hatch2 =
		{
			EvalFunc = function() // if this function returns false, navigation will not run
			{
				return !Map.Hatch2_destroyed;
			},

			navigate = function(_this)
			{
				if ( Map.Hatch2_destroyed )
				{
					yield();
					return;
				}

				_this.AddWeaponRequest(WEAPON.KNIFE);
				_this.AddAimRequest(Priority.High, "facing", Vector3(-0.003, -0.037, -0.999));

				while( !Map.Hatch2_destroyed )
				{
					_this.Bot.HoldButton(BTN.CROUCH, 1);
					_this.Bot.HoldButton(BTN.ATTACK1, 1);
					yield();
				}

				_this.ReleaseAimRequest();
				_this.ReleaseWeaponRequest();
			},
		},
		//	/bot waypoint_setproperty paththrough Navigation_PT:hatch3
		hatch3 =
		{
			EvalFunc = function() // if this function returns false, navigation will not run
			{
				return !Map.Hatch3_destroyed;
			},

			navigate = function(_this)
			{
				if ( Map.Hatch3_destroyed )
				{
					yield();
					return;
				}

				_this.AddWeaponRequest(WEAPON.KNIFE);
				_this.AddAimRequest(Priority.High, "facing", Vector3(0.004, -0.037, -0.999));

				while( !Map.Hatch3_destroyed )
				{
					_this.Bot.HoldButton(BTN.CROUCH, 1);
					_this.Bot.HoldButton(BTN.ATTACK1, 1);
					yield();
				}

				_this.ReleaseAimRequest();
				_this.ReleaseWeaponRequest();
			},
		},
		//	/bot waypoint_setproperty paththrough Navigation_PT:jump_assault_ramp
		jump_assault_ramp =
		{
			navigate = function(_this)
			{
				_this.AddAimRequest(Priority.High, "facing", Vector3(0.999201,-0.031336,-0.024829));
				_this.Bot.PressButton(BTN.JUMP);
				yield();
				_this.Bot.HoldButton(BTN.FORWARD, 1);
				_this.Bot.PressButton(BTN.JUMP);
				sleep(1);
			},
		},
		//	/bot waypoint_setproperty paththrough Navigation_PT:ladder_down
		ladder_down =
		{
			navigate = function(_this)
			{
				_this.AddAimRequest(Priority.High, "facing", Vector3(-0.876 ,-0.482 ,0.004));
				_this.Bot.HoldButton(BTN.BACKWARD, 4.5);
				sleep(4.5);
			},
		},
	},

	Switches =
	{
		//	/bot waypoint_setproperty paththrough UseSwitch_PT:liftlow1
		liftup =
		{
			Enabled = true,
			Priority = 0, //always set to 0 when using path through
			WaypointName = "liftup",
			LimitTeam = 0,
			LimitClass = Util.AllClasses,
			LimitBots = 1,
			Timeout = 1500,
			//AimPosition = Vector3(7906.013672, 27.294815, 472.319916),

			Wait = function() // optional. used to have the bot wait a bit for slow moving doors / elevators
			{
				if ( Map.liftupp == 1 )
				{
					sleep(12);

					return true;
				}
				else if ( Map.liftupp == 0 )
				{
					return true;
				}
				return false;
			},
		},
				//	/bot waypoint_setproperty paththrough UseSwitch_PT:liftlow1
		liftdown =
		{
			Enabled = true,
			Priority = 0, //always set to 0 when using path through
			WaypointName = "liftdown",
			LimitTeam = 0,
			LimitClass = Util.AllClasses,
			LimitBots = 1,
			Timeout = 1500,
			//AimPosition = Vector3(7906.013672, 27.294815, 472.319916),

			Wait = function() // optional. used to have the bot wait a bit for slow moving doors / elevators
			{
				if ( Map.liftupp == 0 )
				{
					sleep(12);

					return true;
				}
				else if ( Map.liftupp == 1 )
				{
					return true;
				}
				return false;
			},
		},
	},

	Lift_Moving = function ( trigger )
	{
		if ( trigger.Action == "0.00 0.00 16.00" )
		{
			Map.Switches.liftdown.Enabled = false;
			Map.Switches.liftup.Enabled = false;
			Util.MapDebugPrint( "^5lift is going up");

			sleep(11.5);

			Map.liftupp = 1;
                  SetAvailableMapGoals( TEAM.ALLIES, false, "RIDE_ride_lift" );
			Util.MapDebugPrint( "^5lift is up");

			Map.Switches.liftdown.Enabled = false;
			Map.Switches.liftup.Enabled = true;
		}
		else if ( trigger.Action == "0.00 0.00 -16.00" )
		{
		      Map.Switches.liftdown.Enabled = false;
			Map.Switches.liftup.Enabled = false;

			Util.MapDebugPrint( "^5lift is going down");

			sleep(11.5);

			Map.liftupp = 0;
                  SetAvailableMapGoals( TEAM.ALLIES, true, "RIDE_ride_lift" );
			Util.MapDebugPrint( "^5lift is down");

			Map.Switches.liftdown.Enabled = true;
			Map.Switches.liftup.Enabled = false;
		}
	},
	/*RideMovers =
	{
		//	/bot waypoint_setproperty paththrough RideMover_PT:lift_board
		lift_board =
		{
			Enabled = true,
			movergoal = "MOVER_base_gate1",
			rideposition = Vector3(-37.875, 4.863, -60.375),	// /bot sgn 100 o
			startwp = "liftrboardstartWP",
			exitwp = "liftboardexitWP",
			board = function(_this)
			{
				if ( Map.Map.liftupp = 1 )
				{
					return true;
				}
				return false;
			},
 			leave = function(_this)
			{
				if ( Map.liftupp  )
				{
					return true;
				}
				return false;
			},
		},
	},
	*/
	Front_Bunker_Door_Planted = function( trigger )
	{

		Map.Front_Bunker_Door_Dyno += 1;

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

	Front_Bunker_Door_Defused = function( trigger )
	{

		Map.Front_Bunker_Door_Dyno -= 1;

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

	Front_Bunker_Door_Destroyed = function( trigger )
	{

		if ( Map.Front_Bunker_Door_Dyno > 0)
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "DEFUSE_Front_Bunker_Door.*" );
		}
		Map.Front_Bunker_Door_Dyno = 0;
		Map.Front_Bunker_Door = false;

		Util.MapDebugPrint( "^5Front_Bunker_Door_Destroyed" );


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

		sleep(1.5);

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

		SetAvailableMapGoals( TEAM.AXIS, false, {
			".*Axis_Start_2",
			".*Axis_Start_4",
			".*Axis_Start_10",
			".*Axis_Start_5",
			".*Axis_Start_9",
			".*MG42_22.*",
		});

		if ( Map.Lower_Bunker_Door )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"PLANT_main_base_wall_breach",
				".*Allied_Courtyard.*",
			});
		}

		if ( Map.Main_base_wall_breach )
		{
			if ( !Map.Lower_Bunker_Door )
			{
				SetAvailableMapGoals( TEAM.AXIS, false, ".*Axis_Start.*" );
			}
			SetAvailableMapGoals( TEAM.AXIS, true, {
				"PLANTMINE_Axis_Start.*",
				".*Axis_Courtyard_7",
				".*Axis_Courtyard_8",
				".*Axis_Courtyard_9",
				".*Axis_Courtyard_10",
				".*Axis_Courtyard_11",
				".*Axis_Courtyard_12",
			});
		}
	},

	Lower_Bunker_Door_Planted = function( trigger )
	{
		Map.Lower_Bunker_Door_Dyno += 1;

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

	Lower_Bunker_Door_Defused = function( trigger )
	{
		Map.Lower_Bunker_Door_Dyno -= 1;

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

	Lower_Bunker_Door_Destroyed = function( trigger )
	{

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

		Map.Lower_Bunker_Door_Dyno = 0;
		Map.Lower_Bunker_Door = false;

		Util.MapDebugPrint( "^5Lower_Bunker_Door_Destroyed" );

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

		sleep(1.5);

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

		SetAvailableMapGoals( TEAM.AXIS, false, {
			".*Axis_Start_1",
			".*Axis_Start_2",
			".*Axis_Start_3",
			".*Axis_Start_4",
			".*Axis_Start_5",
			".*Axis_Start_9",
			".*CAB_north.*2",
		});
		SetAvailableMapGoals( TEAM.AXIS, false, {
			".*MG42_t381",
			".*MG42_t382",
		});


		if ( Map.Front_Bunker_Door )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"PLANT_main_base_wall_breach",
				".*Allied_Courtyard.*",
				"CHECKPOINT_flag1",
			});
		}
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			      ".*CAB_north.*2",
				".*MG42_t436",

			});
		if ( Map.Main_base_wall_breach )
		{
			if ( !Map.Front_Bunker_Door )
			{
				SetAvailableMapGoals( TEAM.AXIS, false, ".*Axis_Start.*" );
			}
			SetAvailableMapGoals( TEAM.AXIS, true, {
				"PLANTMINE_Axis_Start.*",
				".*Axis_Courtyard_1",
				".*Axis_Courtyard_2",
				".*Axis_Courtyard_3",
				".*Axis_Courtyard_4",
				".*Axis_Courtyard_5",
				".*Axis_Courtyard_6",
			});
		}
	},

	flag1_Allies_Captured = function( trigger )
	{

		Map.flag_1_axis = false;

		SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_flag1" );
		SetAvailableMapGoals( TEAM.AXIS, false, {
			".*MG42_t380",
			".*MG42_t364",
			".*MG42_t436",
		});

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

	flag1_Axis_Captured = function( trigger )
	{

		Map.flag_1_axis = true;

		SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_flag1" );
		SetAvailableMapGoals( TEAM.AXIS, true, {
			".*MG42_t380",
			".*MG42_t364",
			".*MG42_t436",
		});

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

	main_base_wall_breach_Planted = function( trigger )
	{
		Map.main_base_wall_breach_Dyno += 1;

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

	main_base_wall_breach_Defused = function( trigger )
	{
		Map.main_base_wall_breach_Dyno -= 1;

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

	main_base_wall_breach_Destroyed = function( trigger )
	{
		Util.MapDebugPrint( "^5main_base_wall_breach_Destroyed" );

		Wp.SetWaypointFlag( "Hatch_2", "closed", false );
		Wp.SetWaypointFlag( "Hatch_3", "closed", false );
		Wp.SetWaypointFlag( "Hatch_1", "closed", false );

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

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

		Map.main_base_wall_breach_Dyno = 0;

		Map.Main_base_wall_breach = false;
		Map.flag_1_axis = false;

		SetAvailableMapGoals( TEAM.AXIS, false, {
			//"CHECKPOINT_flag1",
			".*Axis_Start.*",
			".*Axis_Courtyard.*",
			".*MG42_t.*",
		});

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

		if ( Map.Ventialtion_Generator )
		{
			if ( !Map.Generator_Protection_Net )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Generator_Protection_Net" );
			}
		}

		sleep(1.5);

		SetAvailableMapGoals( TEAM.ALLIES, false, {
			//"CHECKPOINT_flag1",
			".*Allied_Courtyard.*",
			".*MG42_t.*",
			".*CAB_north.*2",
		});

		if ( Map.Front_Bunker_Door )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Front_Bunker_Door" );
		}

		if ( Map.Lower_Bunker_Door )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Lower_Bunker_Door" );
		}

		if ( Map.Axis_CP )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Command_Post" );
		}
		else
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
		}

		if ( !Map.Assault_Ramp )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Assault_Ramp" );
		}

		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"ATTACK_Allied_ProtectionNet.*",
			"HEALTHCAB_north.*1",
		});

		if ( Map.Generator_Protection_Net )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"PLANT_Generator_Protection_Net",
				"PLANT_Generator_Protection_Net_1",
			});
		}
		else
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Ventilation_Generator");
		}
	},

	Axis_Command_Post_Built = function( trigger )
	{

		Map.Axis_CP = true;

		if ( Map.Ventialtion_Generator )
		{
			if ( !Map.Main_base_wall_breach )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Command_Post" );
			}
			else
			{
				SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Command_Post" );
			}
		}
		else
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Command_Post" );
		}

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

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

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

	Allied_Command_Post_Built = function( trigger )
	{
		Wp.SetWaypointFlag( "CP_door_in", "axis", false );
		Wp.SetWaypointFlag( "CP_door_in", "door", false );
		Wp.SetWaypointFlag( "CP_door_out", "axis", false );
		Wp.SetWaypointFlag( "CP_door_out", "door", false );

		Map.Ally_CP = true;

		if ( Map.Ventialtion_Generator )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Command_Post" );
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Command_Post" );
		}
            SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Command_Post" );

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

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

	Command_Post_Planted = function( trigger )
	{
		Map.Command_Post_Dyno += 1;

		if ( Map.Ventialtion_Generator )
		{
			if ( Map.Axis_CP )
			{
				SetGoalPriority( "DEFUSE_Command_Post.*", 0.45, TEAM.AXIS, CLASS.ENGINEER );
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFUSE_Command_Post.*" );
			}
			else
			{
				SetGoalPriority( "DEFUSE_Command_Post.*", 0.45, TEAM.ALLIES, CLASS.ENGINEER );
				SetAvailableMapGoals( TEAM.ALLIES, true, "DEFUSE_Command_Post.*" );
			}
		}
		else
		{
			if ( Map.Axis_CP )
			{
				SetAvailableMapGoals( TEAM.AXIS, false, "DEFUSE_Command_Post.*" );
			}
			else
			{
				SetAvailableMapGoals( TEAM.ALLIES, 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 )
	{

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

		Map.Command_Post_Dyno = 0;

		Map.Axis_CP = false;

		if ( Map.Ventialtion_Generator )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" );

			if ( !Map.Main_base_wall_breach )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
			}
			else
			{
				SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Command_Post" );
			}
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Command_Post" );

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

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

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

	Allied_Command_Post_Destroyed = function( trigger )
	{

		if ( Map.Command_Post_Dyno > 0 )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "DEFUSE_Command_Post.*" );
		}

		Map.Command_Post_Dyno = 0;

		Wp.SetWaypointFlag( "CP_door_in", "axis", true );
		Wp.SetWaypointFlag( "CP_door_in", "door", true );
		Wp.SetWaypointFlag( "CP_door_out", "axis", true );
		Wp.SetWaypointFlag( "CP_door_out", "door", true );
		yield();
		Wp.SetWaypointFlag( "CP_door_in", "blockwall", false );
		Wp.SetWaypointFlag( "CP_door_out", "blockwall", false );

		Map.Ally_CP = false;

		if ( Map.Ventialtion_Generator )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" );

			if ( !Map.Main_base_wall_breach )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
			}
			else
			{
				SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Command_Post" );
			}
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Command_Post" );

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

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

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

	Assault_Ramp_Built = function( trigger )
	{

		Map.Assault_Ramp = true;

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

		if ( Map.Ventialtion_Generator )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Assault_Ramp" );

			if ( !Map.Generator_Protection_Net )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Generator_Protection_Net" );
			}
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Assault_Ramp" );
		}
		SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Assault_Ramp" );

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

	Assault_Ramp_Planted = function( trigger )
	{

		Map.Assault_Ramp_Dyno += 1;

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

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

	Assault_Ramp_Defused = function( trigger )
	{

		Map.Assault_Ramp_Dyno -= 1;

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

	Assault_Ramp_Destroyed = function( trigger )
	{

		Map.Assault_Ramp_Dyno = 0;

		Map.Assault_Ramp = false;

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

		if ( Map.Ventialtion_Generator )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Assault_Ramp" );
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Assault_Ramp" );
		}
            SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Assault_Ramp" );

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

	Allies_In_Underground =
	{
		Name = "AlliesInUnderground",
		TriggerOnClass = CLASS.ANYPLAYER,
		OnEnter = function(ent)
		{
			if ( Map.Ventialtion_Generator )
			{
				if( GetEntTeam(ent) == TEAM.ALLIES )
				{
					Map.count_allies_in_underground += 1;

					Util.BotChat(TEAM.AXIS, "sayteam", "allies entered into underground!", 1);

					Util.MapDebugPrint( "^5allies entered into underground" );

					if ( GetEntClass(ent) == CLASS.ENGINEER )
					{
						Map.count_engs_in_underground += 1;

						Util.BotChat(TEAM.AXIS, "sayteam", "allied engs entered into underground!!!", 2);

						Util.MapDebugPrint( "^5allied engs entered into underground" );
					}

					if ( Map.count_allies_in_underground < 4 )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							"DEFEND_Axis_ProtectionNet_1",
							"DEFEND_Axis_ProtectionNet_5",
							"DEFEND_Axis_ProtectionNet_6",
							"DEFEND_Axis_ProtectionNet_10",
						});
					}
					else
					{
						if ( Map.count_engs_in_underground == 0 )
						{
							SetAvailableMapGoals( TEAM.AXIS, true, {
								"DEFEND_Axis_ProtectionNet_7",
								"DEFEND_Axis_ProtectionNet_11",
								"DEFEND_Axis_ProtectionNet_12",
							});
						}
						else
						{
							SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Axis_BreachWall.*" );

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

					if ( GetEntClass(ent) == CLASS.ENGINEER )
					{
						Map.count_engs_in_underground -= 1;

						if ( Map.count_engs_in_underground == 0 )
						{
							Util.BotChat(TEAM.AXIS, "sayteam", "^2allied engs aren't in underground", 1);

							Util.MapDebugPrint( "^5allied engs aren't in underground" );
						}
					}

					if ( Map.count_allies_in_underground > 4 )
					{
						if ( Map.count_engs_in_underground == 0 )
						{
							SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Axis_ProtectionNet.*" );
							yield();
							SetAvailableMapGoals( TEAM.AXIS, true, {
								"DEFEND_Axis_ProtectionNet_1",
								"DEFEND_Axis_ProtectionNet_5",
								"DEFEND_Axis_ProtectionNet_6",
								"DEFEND_Axis_ProtectionNet_10",
								"DEFEND_Axis_ProtectionNet_7",
								"DEFEND_Axis_ProtectionNet_11",
								"DEFEND_Axis_ProtectionNet_12",
								"DEFEND_Axis_BreachWall.*",
							});
						}
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Axis_ProtectionNet.*" );
						yield();
						SetAvailableMapGoals( TEAM.AXIS, true, {
							"DEFEND_Axis_ProtectionNet_1",
							"DEFEND_Axis_ProtectionNet_5",
							"DEFEND_Axis_ProtectionNet_6",
							"DEFEND_Axis_ProtectionNet_10",
							"DEFEND_Axis_ProtectionNet_12",
							"DEFEND_Axis_BreachWall.*",
						});
					}

					if ( Map.count_allies_in_underground == 0 )
					{
						Util.BotChat(TEAM.AXIS, "sayteam", "^2underground is clean", 2);

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

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

						Util.MapDebugPrint( "^5underground is clean" );
					}
				}
			}
		},
	},

	Inside_Protection_Net =
	{
		Name = "InsideProtectionNet",
		TriggerOnClass = CLASS.ANYPLAYER,
		OnEnter = function(ent)
		{
			if( GetEntTeam(ent) == TEAM.ALLIES )
			{
				if ( GetEntClass(ent) == CLASS.ENGINEER )
				{
					Map.count_allied_engs_inside_protection += 1;

					Util.BotChat(TEAM.AXIS, "sayteam", "^1Allied engs are inside protection net!!!", 2);

					if ( Map.Ventialtion_Generator )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Ventilation_Generator" );

						if ( !Map.Generator_Protection_Net )
						{
							SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Generator_Protection_Net" );
						}
					}

					Util.MapDebugPrint( "^5allied engs entered into protection net trigger" );
				}
			}
		},
		OnExit = function(ent)
		{
			if( GetEntTeam(ent) == TEAM.ALLIES )
			{
				if ( GetEntClass(ent) == CLASS.ENGINEER )
				{
					Map.count_allied_engs_inside_protection -= 1;
				}

				if ( Map.count_allied_engs_inside_protection == 0 )
				{
					Util.BotChat(TEAM.AXIS, "sayteam", "^2Allied engs aren't inside protection net.", 1);

					if ( Map.Ventialtion_Generator )
					{
						if ( !Map.Generator_Protection_Net )
						{
							if ( Map.Ventialtion_Generator_Dyno == 0 )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Generator_Protection_Net" );
							}
						}
						else
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Ventilation_Generator" );
							Map.KT1_insideProtectionNet = OnTriggerRegion(AABB(3279.125,396.013,449.125,3712.875,752.873,587.125), RegionTrigger.KillTrigger );
							yield();
							DeleteTriggerRegion( Map.KT1_insideProtectionNet );

							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"PLANT_Generator_Protection_Net",
								"PLANT_Generator_Protection_Net_1",
							});
						}
					}

					Util.MapDebugPrint( "^5allied engs aren't inside protection net trigger" );
				}
			}
		},
	},

	Generator_Protection_Net_Built = function( trigger )
	{

		Map.Generator_Protection_Net = true;

		if ( Map.count_allied_engs_inside_protection == 0 )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Ventilation_Generator" );

			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"PLANT_Generator_Protection_Net",
				"PLANT_Generator_Protection_Net_1",
			});

			Map.KT1_insideProtectionNet = OnTriggerRegion(AABB(3279.125,396.013,449.125,3712.875,752.873,587.125), RegionTrigger.KillTrigger );
			yield();
			DeleteTriggerRegion( Map.KT1_insideProtectionNet );
		}
		else
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, {
				"PLANT_Generator_Protection_Net",
				"PLANT_Generator_Protection_Net_1",
			});

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

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

	Generator_Protection_Net_Planted = function( trigger )
	{

		Map.Generator_Protection_Net_Dyno += 1;

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

	Generator_Protection_Net_Defused = function( trigger )
	{

		Map.Generator_Protection_Net_Dyno -= 1;

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

	Generator_Protection_Net_Destroyed = function( trigger )
	{

		Map.Generator_Protection_Net_Dyno = 0;

		Map.Generator_Protection_Net = false;

		DeleteTriggerRegion( Map.KT1_insideProtectionNet );

		if ( Map.count_allied_engs_inside_protection == 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Generator_Protection_Net" );
		}

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

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

	Ventialtion_Generator_Planted = function( trigger )
	{

		Map.Ventialtion_Generator_Dyno += 1;

		if ( !Map.Generator_Protection_Net )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Generator_Protection_Net" );
		}

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

	Ventialtion_Generator_Defused = function( trigger )
	{

		Map.Ventialtion_Generator_Dyno -= 1;

		if ( Map.Ventialtion_Generator_Dyno == 0 )
		{
			if ( !Map.Generator_Protection_Net )
			{
				if ( Map.count_allied_engs_inside_protection == 0 )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Generator_Protection_Net" );
				}
			}
		}

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

	Ventialtion_Generator_Destroyed = function( trigger )
	{

		if ( Map.Ventialtion_Generator_Dyno > 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "DEFUSE_Ventialtion_Generator.*" );
		}
		Map.Ventialtion_Generator_Dyno = 0;

		Map.Ventialtion_Generator = false;

		Wp.SetWaypointFlag( "ventilator_1", "closed", false );
		Wp.SetWaypointFlag( "ventilator_2", "closed", false );
		Wp.SetWaypointFlag( "ventilator_3", "closed", false );
		Wp.SetWaypointFlag( "ventilator_4", "closed", false );
		Wp.SetWaypointFlag( "ventilator_5", "closed", false );
		Wp.SetWaypointFlag( "ventilator_6", "closed", false );
		Wp.SetWaypointFlag( "ventilator_7", "closed", false );
		Wp.SetWaypointFlag( "ventilator_8", "closed", false );

		Stairs_and_Spawn = OnTriggerRegion(AABB(5079.125,-256.875,449.125,8816.875,4784.874,1467.072), Map.Stairs_and_SpawnTrigger);
		Radar_Base = OnTriggerRegion(AABB(5079.129,1905.076,1144.551,8880.873,4784.875,1592.314), Map.Allies_In_RadarBaseTrigger);
		DCM_Radar_Base_Plantmine = OnTriggerRegion(AABB(7737.144,1408.845,1198.461,8569.859,1830.896,1291.125), RegionTrigger.DisableCombatMovement);
		NP_Radar_Base_Plantmine = OnTriggerRegion(AABB(7737.144,1408.845,1198.461,8569.859,1830.896,1291.125), RegionTrigger.DisableBotPush);

		Util.MapDebugPrint( "^5Ventialtion_Generator_Destroyed" );

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


		ETUtil.SuicideSpawn( TEAM.AXIS, 0, -1, 0 );	//Radar base spawn

		SetAvailableMapGoals( TEAM.AXIS, true, {
			"BUILD_Staircase_MG_Nest",
			"BUILD_Radar_base_MG_Nest",
			"AMMOs_north_ammocabinet_1",
			"HEALTHCAB_north_healthcabinet",
			"DEFEND_Axis_MetalStaircase.*",
			"PLANTMINE_Axis_RadarBase.*",
		});

		sleep(1.5);

		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"PLANT_Axis_staircase_access_doors",
			"BUILD_Metal_Staircase",
			"AMMOCAB_north_ammocabinet",
			"CAMP_Allied_MetalStaircase.*",
		});
	},

	Axis_staircase_access_doors_Planted = function( trigger )
	{

		Map.Axis_staircase_access_doors_Dyno += 1;

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

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

	Axis_staircase_access_doors_Defused = function( trigger )
	{

		Map.Axis_staircase_access_doors_Dyno -= 1;

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

	Axis_staircase_access_doors_Destroyed = function( trigger )
	{

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

		Map.Axis_staircase_access_doors_Dyno = 0;

		Map.Axis_staircase_access_doors = false;

		DeleteTriggerRegion("StairsAndSpawn");
		Map.count_allies_in_spawn = 0;
		Map.count_engs_in_spawn = 0;

		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"ROUTE_StaircaseDoor",
			"ROUTE_StaircaseMG42",
		});

		if ( Map.Staircase_MG )
		{
			if ( Map.flag2_Axis )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					"MOUNTMG42_stairmg_gun",
					"REPAIRMG42_stairmg_gun",
				});
			}
			else
			{
				SetAvailableMapGoals( TEAM.AXIS, false, {
					"MOUNTMG42_stairmg_gun",
					"REPAIRMG42_stairmg_gun",
				});
			}
		}

		sleep(1.5);

		if ( Map.Staircase_MG )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "GRENADE_staircaseMG42" );
		}

		if ( !Map.Metal_Staircase )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "CAMP_Allied_MetalStaircase.*" );

			if ( Map.flag2_Axis )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_flag2" );
			}

			if ( Map.Radar_base_MG )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Radar_base_MG_Nest" );
			}

			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"PLANT_radar_equipment",
				"ATTACK_Allied_RadarEquipment.*",
			});
		}

		if ( Map.count_allies_in_radarBaseTrigger == 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, {
				".*Axis_MetalStaircase.*",
				".*Axis_RadarEquipment.*",
				".*Axis_Flag2.*",
			});

			if ( Map.flag2_Axis )
			{
				if ( Map.Radar_base_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, false, "MOUNTMG42_Radar_base_MG_Nest" );
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Radar_base_MG_Nest" );
				}

				if ( !Map.Axis_staircase_access_doors and !Map.Metal_Staircase )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*Axis_MetalStaircase_7",
						".*Axis_MetalStaircase_8",
						".*Axis_MetalStaircase_9",
						".*Axis_MetalStaircase_10",
						".*Axis_MetalStaircase_11",
						".*Axis_Flag2.*",
					});

					if ( Map.Staircase_MG )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							"MOUNTMG42_stairmg_gun",
							"REPAIRMG42_stairmg_gun",
						});
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Staircase_MG_Nest" );
					}
				}
				else if ( !Map.Axis_staircase_access_doors and Map.Metal_Staircase )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*Axis_MetalStaircase_1",
						".*Axis_MetalStaircase_2",
						".*Axis_MetalStaircase_3",
						".*Axis_MetalStaircase_4",
						".*Axis_MetalStaircase_5",
						".*Axis_MetalStaircase_6",
						".*Axis_MetalStaircase_7",
						"DEFEND_Axis_Flag2.*",
					});

					if ( Map.Staircase_MG )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							"MOUNTMG42_stairmg_gun",
							"REPAIRMG42_stairmg_gun",
						});
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Staircase_MG_Nest" );
					}
				}
			}
			else
			{
				if ( Map.Staircase_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"MOUNTMG42_stairmg_gun",
						"REPAIRMG42_stairmg_gun",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
				}

				if ( Map.Radar_base_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						"MOUNTMG42_Radar_base_MG_Nest",
						"REPAIRMG42_Radar_base_MG_Nest",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Radar_base_MG_Nest" );
				}

				SetAvailableMapGoals( TEAM.AXIS, true, {
					"CHECKPOINT_flag2",
					".*Axis_Flag2.*",
					".*Axis_RadarEquipment.*",
				});
			}
		}

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

	Metal_Staircase_Built = function( trigger )
	{

		Map.Metal_Staircase = true;

		sleep(1.5);

		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"ROUTE_MetalStaircase",
			"ROUTE_Ladder",
			"ROUTE_NearFlag2",
			"ROUTE_LiftLow",
			"ROUTE_LiftUp",
		});

		if ( Map.Axis_staircase_access_doors )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "CAMP_Allied_MetalStaircase.*" );

			if ( Map.flag2_Axis )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_flag2" );
			}

			if ( Map.Radar_base_MG )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Radar_base_MG_Nest" );
			}

			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"PLANT_radar_door",
				"ATTACK_Allied_RadarEquipment.*",
			});
		}

		if ( Map.count_allies_in_radarBaseTrigger == 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, {
				".*Axis_MetalStaircase.*",
				".*Axis_RadarEquipment.*",
				".*Axis_Flag2.*",
			});

			if ( Map.flag2_Axis )
			{
				if ( Map.Radar_base_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, false, "MOUNTMG42_Radar_base_MG_Nest" );
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Radar_base_MG_Nest" );
				}

				if ( Map.Axis_staircase_access_doors and Map.Metal_Staircase )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*Axis_MetalStaircase_1",
						".*Axis_MetalStaircase_2",
						".*Axis_MetalStaircase_3",
						".*Axis_MetalStaircase_4",
						".*Axis_MetalStaircase_5",
						".*Axis_MetalStaircase_6",
						".*Axis_Flag2.*",
					});

					if ( Map.Staircase_MG )
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							"MOUNTMG42_stairmg_gun",
							"REPAIRMG42_stairmg_gun",
						});
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
					}
				}
				else if ( !Map.Axis_staircase_access_doors and Map.Metal_Staircase )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*Axis_MetalStaircase_1",
						".*Axis_MetalStaircase_2",
						".*Axis_MetalStaircase_3",
						".*Axis_MetalStaircase_4",
						".*Axis_MetalStaircase_5",
						".*Axis_MetalStaircase_6",
						".*Axis_MetalStaircase_7",
						"DEFEND_Axis_Flag2.*",
					});

					if ( Map.Staircase_MG )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							"MOUNTMG42_stairmg_gun",
							"REPAIRMG42_stairmg_gun",
						});
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Staircase_MG_Nest" );
					}
				}
			}
			else
			{
				if ( Map.Staircase_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"MOUNTMG42_stairmg_gun",
						"REPAIRMG42_stairmg_gun",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
				}

				if ( Map.Radar_base_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						"MOUNTMG42_Radar_base_MG_Nest",
						"REPAIRMG42_Radar_base_MG_Nest",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Radar_base_MG_Nest" );
				}

				SetAvailableMapGoals( TEAM.AXIS, true, {
					"CHECKPOINT_flag2",
					".*Axis_Flag2.*",
					".*Axis_RadarEquipment.*",
				});
			}
		}
            SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Metal_Staircase" );
		Util.MapDebugPrint( "^5Metal_Staircase_Built" );
	},

	Metal_Staircase_Planted = function( trigger )
	{

		Map.Metal_Staircase_Dyno += 1;

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

	Metal_Staircase_Defused = function( trigger )
	{

		Map.Metal_Staircase_Dyno -= 1;

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

	Metal_Staircase_Destroyed = function( trigger )
	{

		Map.Metal_Staircase_Dyno = 0;

		Map.Metal_Staircase = false;

		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"ROUTE_MetalStaircase",
			"ROUTE_Ladder",
			"ROUTE_NearFlag2",
			"ROUTE_LiftLow",
			"ROUTE_LiftUp",
		});

		if ( Map.flag2_Axis )
		{
			if ( Map.Axis_staircase_access_doors )
			{
				if ( Map.count_allies_in_spawn > 0 )
				{
					if ( Map.count_engs_in_spawn == 0 )
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_radar_equipment" );

						if ( Map.Radar_base_MG )
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Radar_base_MG_Nest" );
						}
					}
				}
				else
				{
					SetAvailableMapGoals( TEAM.ALLIES, false, {
						"ATTACK_Allied_RadarEquipment.*",
						"CHECKPOINT_flag2",
						"PLANT_radar_door",
					});

					if ( Map.Radar_base_MG )
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Radar_base_MG_Nest" );
					}

					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"CAMP_Allied_MetalStaircase.*",
						"BUILD_Metal_Staircase",
						"PLANT_Axis_staircase_access_doors",
					});
				}
			}
		}
		else
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Metal_Staircase" );
		}

		if ( Map.count_allies_in_radarBaseTrigger == 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, {
				".*Axis_MetalStaircase.*",
				".*Axis_RadarEquipment.*",
				".*Axis_Flag2.*",
			});

			if ( Map.flag2_Axis )
			{
				if ( Map.Radar_base_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, false, "MOUNTMG42_Radar_base_MG_Nest" );
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Radar_base_MG_Nest" );
				}

				if ( !Map.Axis_staircase_access_doors and !Map.Metal_Staircase )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*Axis_MetalStaircase_7",
						".*Axis_MetalStaircase_8",
						".*Axis_MetalStaircase_9",
						".*Axis_MetalStaircase_10",
						".*Axis_MetalStaircase_11",
						".*Axis_Flag2.*",
					});

					if ( Map.Staircase_MG )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							"MOUNTMG42_stairmg_gun",
							"REPAIRMG42_stairmg_gun",
						});
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Staircase_MG_Nest" );
					}
				}
				else if ( Map.Axis_staircase_access_doors and !Map.Metal_Staircase )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, ".*Axis_MetalStaircase.*" );

					if ( Map.Staircase_MG )
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							"MOUNTMG42_stairmg_gun",
							"REPAIRMG42_stairmg_gun",
						});
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
					}
				}
			}
			else
			{
				if ( Map.Staircase_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"MOUNTMG42_stairmg_gun",
						"REPAIRMG42_stairmg_gun",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
				}

				if ( Map.Radar_base_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						"MOUNTMG42_Radar_base_MG_Nest",
						"REPAIRMG42_Radar_base_MG_Nest",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Radar_base_MG_Nest" );
				}

				SetAvailableMapGoals( TEAM.AXIS, true, {
					"CHECKPOINT_flag2",
					".*Axis_Flag2.*",
					".*Axis_RadarEquipment.*",
				});
			}
		}

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

	Staircase_MG_Nest_Built = function( trigger )
	{

		Map.Staircase_MG = true;

		if ( !Map.Axis_staircase_access_doors )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "GRENADE_staircaseMG42" );

			if ( Map.flag2_Axis )
			{
				if ( Map.count_allies_in_radarBaseTrigger < 4 )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_stairmg_gun" );

					if ( Map.count_engs_in_radarBaseTrigger == 0 )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "REPAIRMG42_stairmg_gun" );
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, "REPAIRMG42_stairmg_gun" );
					}
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"MOUNTMG42_stairmg_gun",
						"REPAIRMG42_stairmg_gun",
					});
				}
			}
			else
			{
				SetAvailableMapGoals( TEAM.AXIS, false, {
					"MOUNTMG42_stairmg_gun",
					"REPAIRMG42_stairmg_gun",
				});
			}
		}

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

	Staircase_MG_Nest_Destroyed = function( trigger )
	{

		Map.Staircase_MG = false;

		if ( !Map.Axis_staircase_access_doors )
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "GRENADE_staircaseMG42" );

			if ( Map.flag2_Axis )
			{
				if ( Map.count_allies_in_radarBaseTrigger < 4 )
				{
					if ( Map.count_engs_in_radarBaseTrigger == 0 )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Staircase_MG_Nest" );
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
					}
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
				}
			}
			else
			{
				SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
			}
		}

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

	flag2_Axis_Captured = function( trigger )
	{

		Map.flag2_Axis = true;

		if ( Map.Axis_staircase_access_doors and !Map.Metal_Staircase )
		{
			if ( Map.count_allies_in_spawn > 0 )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_flag2" );

				if ( Map.count_engs_in_spawn == 0 )
				{
					SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_radar_equipment" );

					if ( Map.Radar_base_MG )
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Radar_base_MG_Nest" );
					}

					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"BUILD_Metal_Staircase",
						"PLANT_Axis_staircase_access_doors",
					});
				}
			}
			else
			{
				SetAvailableMapGoals( TEAM.ALLIES, false, {
					"CHECKPOINT_flag2",
					"ATTACK_Allied_RadarEquipment.*",
					"CHECKPOINT_flag2",
					"PLANT_radar_equipment",
				});

				if ( Map.Radar_base_MG )
				{
					SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Radar_base_MG_Nest" );
				}

				SetAvailableMapGoals( TEAM.ALLIES, true, {
					"BUILD_Metal_Staircase",
					"PLANT_Axis_staircase_access_doors",
					"CAMP_Allied_MetalStaircase.*",
				});
			}
		}
		else
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_flag2" );
		}

		if ( Map.count_allies_in_radarBaseTrigger == 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, {
				".*Axis_MetalStaircase.*",
				".*Axis_RadarEquipment.*",
				".*Axis_Flag2.*",
			});

			if ( Map.Radar_base_MG )
			{
				SetAvailableMapGoals( TEAM.AXIS, false, "MOUNTMG42_Radar_base_MG_Nest" );
			}
			else
			{
				SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Radar_base_MG_Nest" );
			}

			if ( !Map.Axis_staircase_access_doors and !Map.Metal_Staircase )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					".*Axis_MetalStaircase_7",
					".*Axis_MetalStaircase_8",
					".*Axis_MetalStaircase_9",
					".*Axis_MetalStaircase_10",
					".*Axis_MetalStaircase_11",
					".*Axis_Flag2.*",
				});

				if ( Map.Staircase_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						"MOUNTMG42_stairmg_gun",
						"REPAIRMG42_stairmg_gun",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Staircase_MG_Nest" );
				}
			}
			else if ( Map.Axis_staircase_access_doors and Map.Metal_Staircase )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					".*Axis_MetalStaircase_1",
					".*Axis_MetalStaircase_2",
					".*Axis_MetalStaircase_3",
					".*Axis_MetalStaircase_4",
					".*Axis_MetalStaircase_5",
					".*Axis_MetalStaircase_6",
					".*Axis_Flag2.*",
				});

				if ( Map.Staircase_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"MOUNTMG42_stairmg_gun",
						"REPAIRMG42_stairmg_gun",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
				}
			}
			else if ( !Map.Axis_staircase_access_doors and Map.Metal_Staircase )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					".*Axis_MetalStaircase_1",
					".*Axis_MetalStaircase_2",
					".*Axis_MetalStaircase_3",
					".*Axis_MetalStaircase_4",
					".*Axis_MetalStaircase_5",
					".*Axis_MetalStaircase_6",
					".*Axis_MetalStaircase_7",
					"DEFEND_Axis_Flag2.*",
				});

				if ( Map.Staircase_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						"MOUNTMG42_stairmg_gun",
						"REPAIRMG42_stairmg_gun",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Staircase_MG_Nest" );
				}
			}
			else
			{
				SetAvailableMapGoals( TEAM.AXIS, true, ".*Axis_MetalStaircase.*" );

				if ( Map.Staircase_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"MOUNTMG42_stairmg_gun",
						"REPAIRMG42_stairmg_gun",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
				}
			}
		}

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

	flag2_Allies_Captured = function( trigger )
	{

		Map.flag2_Axis = false;

		if ( Map.count_allies_in_radarBaseTrigger == 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, {
				".*Axis_RadarEquipment.*",
				"DEFEND_Axis_MetalStaircase.*",
			});

			if ( Map.Staircase_MG )
			{
				SetAvailableMapGoals( TEAM.AXIS, false, {
					"MOUNTMG42_stairmg_gun",
					"REPAIRMG42_stairmg_gun",
				});
			}
			else
			{
				SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
			}

			if ( Map.Radar_base_MG )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					"MOUNTMG42_Radar_base_MG_Nest",
					"REPAIRMG42_Radar_base_MG_Nest",
				});
			}
			else
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Radar_base_MG_Nest" );
			}

			SetAvailableMapGoals( TEAM.AXIS, true, {
				"CHECKPOINT_flag2",
				"ATTACK_Axis_Flag2.*",
				".*Axis_RadarEquipment.*",
			});
		}

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

	Radar_base_MG_Nest_Built = function( trigger )
	{

		Map.Radar_base_MG = true;

		if ( !Map.Axis_staircase_access_doors or Map.Metal_Staircase )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Radar_base_MG_Nest" );
		}

		if ( Map.count_allies_in_radarBaseTrigger > 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, {
				"MOUNTMG42_Radar_base_MG_Nest",
				"REPAIRMG42_Radar_base_MG_Nest",
			});
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, false, {
				"MOUNTMG42_Radar_base_MG_Nest",
				"REPAIRMG42_Radar_base_MG_Nest",
			});
		}

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

	Radar_base_MG_Nest_Planted = function( trigger )
	{

		Map.Radar_base_MG_Nest_Dyno += 1;

		if ( Map.radar_equipment_Dyno > 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "DEFUSE_Radar_base_MG_Nest.*" );
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "DEFUSE_Radar_base_MG_Nest.*" );
		}

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

	Radar_base_MG_Nest_Defused = function( trigger )
	{

		Map.Radar_base_MG_Nest_Dyno -= 1;

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

	Radar_base_MG_Nest_Destroyed = function( trigger )
	{

		Map.Radar_base_MG_Nest_Dyno = 0;

		Map.Radar_base_MG = false;

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

		if ( !Map.Axis_staircase_access_doors or Map.Metal_Staircase )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Radar_base_MG_Nest" );
		}

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

	radar_door_Planted = function( trigger )
	{

		Map.Radar_door_Dyno += 1;


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

	radar_door_Defused = function( trigger )
	{

		Map.Radar_door_Dyno -= 1;

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

	radar_door_Destroyed = function( trigger )
	{

		Map.Radar_door_Dyno = 0;

		SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_radar_equipment" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_radar_door" );

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

	Allies_In_RadarBaseTrigger =
	{
		Name = "AlliesInRadarBaseTrigger",
		TriggerOnClass = CLASS.ANYPLAYER,
		OnEnter = function(ent)
		{
			if( GetEntTeam(ent) == TEAM.ALLIES )
			{
				Map.count_allies_in_radarBaseTrigger += 1;

				Util.BotChat(TEAM.AXIS, "sayteam", "Allies are attacking to Radar equipment!", 1);

				Util.MapDebugPrint( "^5allies entered into trigger RadarBase" );

				if ( Map.Staircase_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"MOUNTMG42_stairmg_gun",
						"REPAIRMG42_stairmg_gun",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"BUILD_Staircase_MG_Nest",
						"MOUNTMG42_stairmg_gun",
						"REPAIRMG42_stairmg_gun",
					});
				}

				if ( Map.Radar_base_MG )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						"MOUNTMG42_Radar_base_MG_Nest",
						"REPAIRMG42_Radar_base_MG_Nest",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Radar_base_MG_Nest" );
				}

				if ( GetEntClass(ent) == CLASS.ENGINEER )
				{
					Map.count_engs_in_radarBaseTrigger += 1;

					Util.BotChat(TEAM.AXIS, "sayteam", "^1Allied engs go plant Radar equipment!!!", 2);

					Util.MapDebugPrint( "^5allied engs entered into trigger RadarBase" );
				}

				if ( Map.count_allies_in_radarBaseTrigger < 4 )
				{
					if ( Map.flag2_Axis )
					{
						SetAvailableMapGoals( TEAM.AXIS, false, ".*Axis_MetalStaircase.*" );

						if ( Map.count_engs_in_radarBaseTrigger == 0 )
						{
							if ( !Map.Axis_staircase_access_doors and !Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_7",
									".*Axis_MetalStaircase_8",
									".*Axis_MetalStaircase_9",
									".*Axis_MetalStaircase_10",
									".*Axis_MetalStaircase_11",
									"DEFEND_Axis_Flag2.*",
								});
							}
							else if ( Map.Axis_staircase_access_doors and Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_1",
									".*Axis_MetalStaircase_2",
									".*Axis_MetalStaircase_3",
									".*Axis_MetalStaircase_4",
									".*Axis_MetalStaircase_5",
									"DEFEND_Axis_Flag2.*",
								});
							}
							else if ( !Map.Axis_staircase_access_doors and Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_1",
									".*Axis_MetalStaircase_2",
									".*Axis_MetalStaircase_3",
									".*Axis_MetalStaircase_4",
									".*Axis_MetalStaircase_7",
									".*Axis_MetalStaircase_8",
									"DEFEND_Axis_Flag2.*",
								});
							}

							SetAvailableMapGoals( TEAM.AXIS, true, {
								".*Axis_RadarEquipment_1",
								".*Axis_RadarEquipment_2",
								".*Axis_RadarEquipment_3",
							});
						}
						else
						{
							if ( !Map.Axis_staircase_access_doors and !Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_7",
									".*Axis_MetalStaircase_8",
									".*Axis_MetalStaircase_9",
									".*Axis_MetalStaircase_11",
									"DEFEND_Axis_Flag2.*",
								});
							}
							else if ( Map.Axis_staircase_access_doors and Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_1",
									".*Axis_MetalStaircase_2",
									".*Axis_MetalStaircase_4",
									".*Axis_MetalStaircase_5",
									"DEFEND_Axis_Flag2.*",
								});
							}
							else if ( !Map.Axis_staircase_access_doors and Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_1",
									".*Axis_MetalStaircase_2",
									".*Axis_MetalStaircase_4",
									".*Axis_MetalStaircase_5",
									"DEFEND_Axis_Flag2.*",
								});
							}

							SetAvailableMapGoals( TEAM.AXIS, true, {
								".*Axis_RadarEquipment_1",
								".*Axis_RadarEquipment_2",
								".*Axis_RadarEquipment_3",
								".*Axis_RadarEquipment_4",
							});
						}
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, ".*Axis_MetalStaircase.*" );

						SetAvailableMapGoals( TEAM.AXIS, true, {
							"CHECKPOINT_flag2",
							"ATTACK_Axis_Flag2.*",
							".*Axis_RadarEquipment.*",
						});
					}
				}
				else
				{
					if ( Map.flag2_Axis )
					{
						SetAvailableMapGoals( TEAM.AXIS, false, ".*Axis_MetalStaircase.*" );

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

						if ( Map.count_engs_in_radarBaseTrigger == 0 )
						{
							if ( !Map.Axis_staircase_access_doors and !Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_7",
									".*Axis_MetalStaircase_8",
									"DEFEND_Axis_Flag2.*",
								});
							}
							else if ( Map.Axis_staircase_access_doors and Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_1",
									".*Axis_MetalStaircase_4",
									"DEFEND_Axis_Flag2.*",
								});
							}
							else if ( !Map.Axis_staircase_access_doors and Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_1",
									".*Axis_MetalStaircase_4",
									"DEFEND_Axis_Flag2.*",
								});
							}
						}
						else
						{
							SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Axis_Flag2.*" );
						}
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							".*Axis_MetalStaircase.*",
							".*Axis_Flag2.*",
						});

						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*Axis_RadarEquipment.*",
							"CHECKPOINT_flag2",
						});

						if ( Map.radar_equipment_Dyno > 0 )
						{
							SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Axis_RadarEquipment.*" );

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

							sleep(0.5);

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

				if ( GetEntClass(ent) == CLASS.ENGINEER )
				{
					Map.count_engs_in_radarBaseTrigger -= 1;

					if ( Map.count_engs_in_radarBaseTrigger == 0 )
					{
						Util.BotChat(TEAM.AXIS, "sayteam", "^2Allied engs aren't in Radar Base.", 1);

						Util.MapDebugPrint( "^5allied engs aren't in trigger RadarBase" );
					}
				}

				if ( Map.Staircase_MG )
				{
					if ( !Map.Axis_staircase_access_doors )
					{
						if ( Map.flag2_Axis )
						{
							if ( Map.count_allies_in_radarBaseTrigger > 0 and Map.count_allies_in_radarBaseTrigger < 4 )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_stairmg_gun" );

								if ( Map.count_engs_in_radarBaseTrigger == 0 )
								{
									SetAvailableMapGoals( TEAM.AXIS, true, "REPAIRMG42_stairmg_gun" );
								}
								else
								{
									SetAvailableMapGoals( TEAM.AXIS, false, "REPAIRMG42_stairmg_gun" );
								}
							}
							else
							{
								SetAvailableMapGoals( TEAM.AXIS, false, {
									"MOUNTMG42_stairmg_gun",
									"REPAIRMG42_stairmg_gun",
								});
							}
						}
						else
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								"MOUNTMG42_stairmg_gun",
								"REPAIRMG42_stairmg_gun",
							});
						}
					}
				}
				else
				{
					if ( !Map.Axis_staircase_access_doors )
					{
						if ( Map.flag2_Axis )
						{
							if ( Map.count_allies_in_radarBaseTrigger > 0 and Map.count_allies_in_radarBaseTrigger < 4 )
							{
								if ( Map.count_engs_in_radarBaseTrigger == 0 )
								{
									SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Staircase_MG_Nest" );
								}
								else
								{
									SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
								}
							}
							else
							{
								SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
							}
						}
						else
						{
							SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
						}
					}
				}

				if ( Map.count_allies_in_radarBaseTrigger > 3 )
				{
					if ( Map.flag2_Axis )
					{
						SetAvailableMapGoals( TEAM.AXIS, false, ".*Axis_MetalStaircase.*" );

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

						if ( Map.count_engs_in_radarBaseTrigger > 0 )
						{
							SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Axis_Flag2.*" );
						}
						else
						{
							if ( !Map.Axis_staircase_access_doors and !Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_7",
									".*Axis_MetalStaircase_8",
									"DEFEND_Axis_Flag2.*",
								});
							}
							else if ( Map.Axis_staircase_access_doors and Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_1",
									".*Axis_MetalStaircase_4",
									"DEFEND_Axis_Flag2.*",
								});
							}
							else if ( !Map.Axis_staircase_access_doors and Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_1",
									".*Axis_MetalStaircase_4",
									"DEFEND_Axis_Flag2.*",
								});
							}
						}
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							".*Axis_MetalStaircase.*",
							".*Axis_Flag2.*",
						});

						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*Axis_RadarEquipment.*",
							"CHECKPOINT_flag2",
						});
					}
				}

				if ( Map.count_allies_in_radarBaseTrigger > 0 and Map.count_allies_in_radarBaseTrigger < 4  )
				{
					if ( Map.flag2_Axis )
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							".*Axis_MetalStaircase.*",
							".*Axis_RadarEquipment.*",
						});

						if ( Map.count_engs_in_radarBaseTrigger > 0 )
						{
							if ( !Map.Axis_staircase_access_doors and !Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_7",
									".*Axis_MetalStaircase_8",
									".*Axis_MetalStaircase_9",
									".*Axis_MetalStaircase_11",
									"DEFEND_Axis_Flag2.*",
								});
							}
							else if ( Map.Axis_staircase_access_doors and Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_1",
									".*Axis_MetalStaircase_2",
									".*Axis_MetalStaircase_4",
									".*Axis_MetalStaircase_5",
									"DEFEND_Axis_Flag2.*",
								});
							}
							else if ( !Map.Axis_staircase_access_doors and Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_1",
									".*Axis_MetalStaircase_2",
									".*Axis_MetalStaircase_4",
									".*Axis_MetalStaircase_5",
									"DEFEND_Axis_Flag2.*",
								});
							}

							SetAvailableMapGoals( TEAM.AXIS, true, {
								".*Axis_RadarEquipment_1",
								".*Axis_RadarEquipment_2",
								".*Axis_RadarEquipment_3",
								".*Axis_RadarEquipment_4",
							});
						}
						else
						{
							if ( !Map.Axis_staircase_access_doors and !Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_7",
									".*Axis_MetalStaircase_8",
									".*Axis_MetalStaircase_9",
									".*Axis_MetalStaircase_10",
									".*Axis_MetalStaircase_11",
									"DEFEND_Axis_Flag2.*",
								});
							}
							else if ( Map.Axis_staircase_access_doors and Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_1",
									".*Axis_MetalStaircase_2",
									".*Axis_MetalStaircase_3",
									".*Axis_MetalStaircase_4",
									".*Axis_MetalStaircase_5",
									"DEFEND_Axis_Flag2.*",
								});
							}
							else if ( !Map.Axis_staircase_access_doors and Map.Metal_Staircase )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									".*Axis_MetalStaircase_1",
									".*Axis_MetalStaircase_2",
									".*Axis_MetalStaircase_3",
									".*Axis_MetalStaircase_4",
									".*Axis_MetalStaircase_7",
									".*Axis_MetalStaircase_8",
									"DEFEND_Axis_Flag2.*",
								});
							}

							SetAvailableMapGoals( TEAM.AXIS, true, {
								".*Axis_RadarEquipment_1",
								".*Axis_RadarEquipment_2",
								".*Axis_RadarEquipment_3",
							});
						}
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, ".*Axis_MetalStaircase.*" );

						SetAvailableMapGoals( TEAM.AXIS, true, {
							"CHECKPOINT_flag2",
							"ATTACK_Axis_Flag2.*",
							".*Axis_RadarEquipment.*",
						});
					}
				}

				if ( Map.count_allies_in_radarBaseTrigger == 0 )
				{
					Util.BotChat(TEAM.AXIS, "sayteam", "^2Radar Base is clean", 2);

					SetAvailableMapGoals( TEAM.AXIS, false, {
						".*Axis_RadarEquipment.*",
						".*Axis_MetalStaircase.*",
					});

					if ( Map.flag2_Axis )
					{
						if ( Map.Radar_base_MG )
						{
							SetAvailableMapGoals( TEAM.AXIS, false, "MOUNTMG42_Radar_base_MG_Nest" );
						}
						else
						{
							SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Radar_base_MG_Nest" );
						}

						if ( !Map.Axis_staircase_access_doors and !Map.Metal_Staircase )
						{
							SetAvailableMapGoals( TEAM.AXIS, true, {
								".*Axis_MetalStaircase_7",
								".*Axis_MetalStaircase_8",
								".*Axis_MetalStaircase_9",
								".*Axis_MetalStaircase_10",
								".*Axis_MetalStaircase_11",
								".*Axis_Flag2.*",
							});

							if ( Map.Staircase_MG )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									"MOUNTMG42_stairmg_gun",
									"REPAIRMG42_stairmg_gun",
								});
							}
							else
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Staircase_MG_Nest" );
							}
						}
						else if ( Map.Axis_staircase_access_doors and Map.Metal_Staircase )
						{
							SetAvailableMapGoals( TEAM.AXIS, true, {
								".*Axis_MetalStaircase_1",
								".*Axis_MetalStaircase_2",
								".*Axis_MetalStaircase_3",
								".*Axis_MetalStaircase_4",
								".*Axis_MetalStaircase_5",
								".*Axis_MetalStaircase_6",
								".*Axis_Flag2.*",
							});

							if ( Map.Staircase_MG )
							{
								SetAvailableMapGoals( TEAM.AXIS, false, {
									"MOUNTMG42_stairmg_gun",
									"REPAIRMG42_stairmg_gun",
								});
							}
							else
							{
								SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
							}
						}
						else if ( !Map.Axis_staircase_access_doors and Map.Metal_Staircase )
						{
							SetAvailableMapGoals( TEAM.AXIS, true, {
								".*Axis_MetalStaircase_1",
								".*Axis_MetalStaircase_2",
								".*Axis_MetalStaircase_3",
								".*Axis_MetalStaircase_4",
								".*Axis_MetalStaircase_5",
								".*Axis_MetalStaircase_6",
								".*Axis_MetalStaircase_7",
								"DEFEND_Axis_Flag2.*",
							});

							if ( Map.Staircase_MG )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, {
									"MOUNTMG42_stairmg_gun",
									"REPAIRMG42_stairmg_gun",
								});
							}
							else
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Staircase_MG_Nest" );
							}
						}
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							".*Axis_RadarEquipment.*",
							"DEFEND_Axis_MetalStaircase.*",
						});

						if ( Map.Staircase_MG )
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								"MOUNTMG42_stairmg_gun",
								"REPAIRMG42_stairmg_gun",
							});
						}
						else
						{
							SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Staircase_MG_Nest" );
						}

						if ( Map.Radar_base_MG )
						{
							SetAvailableMapGoals( TEAM.AXIS, true, {
								"MOUNTMG42_Radar_base_MG_Nest",
								"REPAIRMG42_Radar_base_MG_Nest",
							});
						}
						else
						{
							SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Radar_base_MG_Nest" );
						}

						SetAvailableMapGoals( TEAM.AXIS, true, {
							"CHECKPOINT_flag2",
							".*Axis_Flag2.*",
							".*Axis_RadarEquipment.*",
						});
					}

					Util.MapDebugPrint( "^5RadarBase is clean" );
				}
			}
		},
	},

	Stairs_and_SpawnTrigger =
	{
		Name = "StairsAndSpawn",
		TriggerOnClass = CLASS.ANYPLAYER,
		OnEnter = function(ent)
		{
			if ( Map.Axis_staircase_access_doors )
			{
				if( GetEntTeam(ent) == TEAM.ALLIES )
				{
					Map.count_allies_in_spawn += 1;

					Util.BotChat(TEAM.AXIS, "sayteam", "^1The Allies are going up a metal staircase!", 1);

					Util.MapDebugPrint( "^5allies entered into spawn trigger" );

					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"AMMOCAB_north_ammocabinet_1",
						"HEALTHCAB_north_healthcabinet",
					});

					if ( GetEntClass(ent) == CLASS.ENGINEER )
					{
						Map.count_engs_in_spawn += 1;

						Util.BotChat(TEAM.AXIS, "sayteam", "^1Allied engs are going up a metal staircase!!!", 2);

						Util.MapDebugPrint( "^5allied engs entered into spawn trigger" );
					}
				}
			}
		},
		OnExit = function(ent)
		{
			if ( Map.Axis_staircase_access_doors )
			{
				if( GetEntTeam(ent) == TEAM.ALLIES )
				{
					Map.count_allies_in_spawn -= 1;

					if ( GetEntClass(ent) == CLASS.ENGINEER )
					{
						Map.count_engs_in_spawn -= 1;
					}

					if ( Map.count_allies_in_spawn > 0 )
					{
						if ( Map.count_engs_in_spawn == 0 )
						{
							Util.BotChat(TEAM.AXIS, "sayteam", "^2Allied engs aren't in Radar Base and Staircase & Spawn area.", 1);

							Util.MapDebugPrint( "^5allied engs aren't in spawn trigger" );

							if ( !Map.Metal_Staircase )
							{
								if ( Map.flag2_Axis )
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_radar_equipment" );

									if ( Map.Radar_base_MG )
									{
										SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Radar_base_MG_Nest" );
									}

									SetAvailableMapGoals( TEAM.ALLIES, true, {
										"BUILD_Metal_Staircase",
										"PLANT_Axis_staircase_access_doors",
									});
								}
							}
						}
					}
					else
					{
						Util.BotChat(TEAM.AXIS, "sayteam", "^2Radar Base and Staircase & Spawn area are clean", 2);

						Util.MapDebugPrint( "^5spawn trigger is clean" );

						SetAvailableMapGoals( TEAM.ALLIES, false, {
							"AMMOCAB_north_ammocabinet_1",
							"HEALTHCAB_north_healthcabinet",
						});

						if ( !Map.Metal_Staircase )
						{
							if ( Map.flag2_Axis )
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, {
									"CHECKPOINT_flag2",
									"ATTACK_Allied_RadarEquipment.*",
								});

								SetAvailableMapGoals( TEAM.ALLIES, true, "CAMP_Allied_MetalStaircase.*" );
							}
						}
					}
				}
			}
		},
	},

	radar_equipment_Planted = function( trigger )
	{

		Map.radar_equipment_Dyno += 1;

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

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

		SetGoalPriority( "DEFUSE_radar_equipment.*", 1.1, TEAM.AXIS, CLASS.ENGINEER );

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

		sleep(0.5);

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

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

	radar_equipment_Defused = function( trigger )
	{

		Map.radar_equipment_Dyno -= 1;

		if ( Map.radar_equipment_Dyno == 0)
		{
			if ( Map.Radar_base_MG_Nest_Dyno > 0 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFUSE_Radar_base_MG_Nest.*" );
			}

			SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_Axis_RadarPlanted.*" );
		}

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

	radar_equipment_Destroyed = function( trigger )
	{

		Map.radar_equipment_Dyno = 0;

		Map.radar_equipment = false;

		sleep(1);

		ETUtil.WinningChat( TEAM.ALLIES );
		ETUtil.LosingChat( TEAM.AXIS );

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

	Hatch_exploded = function( trigger )
	{

		Map.Hatch_destroyed = true;

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

	Hatch_1_exploded = function( trigger )
	{

		Map.Hatch1_destroyed = true;

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

	Hatch_2_exploded = function( trigger )
	{

		Map.Hatch2_destroyed = true;

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

	Hatch_3_exploded = function( trigger )
	{

		Map.Hatch3_destroyed = true;

		Util.MapDebugPrint( "^5Hatch_3_exploded" );
	},
	Lower_Fence_exploded = function( trigger )
	{

		Map.LowerFence_destroyed = true;

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

	Wall_Beach_Fence_exploded = function( trigger )
	{
		Map.WallBeachFence_destroyed = true;

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

	Thirty_second = function( trigger )
	{
		Util.MapDebugPrint( "^5Thirty_second" );

		sleep(31);

		if ( Map.radar_equipment )
		{
			ETUtil.WinningChat( TEAM.AXIS );
			ETUtil.LosingChat( TEAM.ALLIES );
		}
	},
};

global OnMapLoad = function()
{

	// Register callback functions
	OnTrigger( "Generator protection contructed", Map.Generator_Protection_Net_Built );
	OnTrigger( "Planted at Generator Protection Net.", Map.Generator_Protection_Net_Planted );
	OnTrigger( "Defused at Generator Protection Net.", Map.Generator_Protection_Net_Defused );
	OnTrigger( "^1WARNING: ^3Generator protection destroyed", Map.Generator_Protection_Net_Destroyed );

	OnTrigger( "Planted at the Front Bunker Door.", Map.Front_Bunker_Door_Planted );
	OnTrigger( "Defused at the Front Bunker Door.", Map.Front_Bunker_Door_Defused );
	OnTrigger( "Allies have breached the front beach bunker door!!!!", Map.Front_Bunker_Door_Destroyed );

	OnTrigger( "Planted at the Lower Bunker Door.", Map.Lower_Bunker_Door_Planted );
	OnTrigger( "Defused at the Lower Bunker Door.", Map.Lower_Bunker_Door_Defused );
	OnTrigger( "Allies have breached the lower beach bunker door!!!!", Map.Lower_Bunker_Door_Destroyed );

	OnTrigger( "Planted at the main base wall breach.", Map.main_base_wall_breach_Planted );
	OnTrigger( "Defused at the main base wall breach.", Map.main_base_wall_breach_Defused );
	OnTrigger( "Allies have breached the main base wall!!!!", Map.main_base_wall_breach_Destroyed );

	OnTrigger( "Assault Ramp constructed.", Map.Assault_Ramp_Built );
	OnTrigger( "Planted at Assault Ramp.", Map.Assault_Ramp_Planted );
	OnTrigger( "Defused at Assault Ramp.", Map.Assault_Ramp_Defused );
	OnTrigger( "Assault Ramp destroyed.", Map.Assault_Ramp_Destroyed );

	OnTrigger( "Axis Command Post constructed. Charge speed increased!", Map.Axis_Command_Post_Built );
	OnTrigger( "Allied team has destroyed the Axis Command Post!", Map.Axis_Command_Post_Destroyed );
	OnTrigger( "Allied Command Post constructed. Charge speed increased!", Map.Allied_Command_Post_Built );
	OnTrigger( "Axis team has destroyed the Allied Command Post!", Map.Allied_Command_Post_Destroyed );
	OnTrigger( "Planted at the Command Post.", Map.Command_Post_Planted );
	OnTrigger( "Defused at the Command Post.", Map.Command_Post_Defused );

	OnTrigger( "Planted at the Ventialtion Power Generator.", Map.Ventialtion_Generator_Planted );
	OnTrigger( "Defused at the Ventialtion Power Generator.", Map.Ventialtion_Generator_Defused );
	OnTrigger( "Allies have destroyed the ventilation power generator!!!!", Map.Ventialtion_Generator_Destroyed );

	OnTrigger( "Metal Staircase constructed.", Map.Metal_Staircase_Built );
	OnTrigger( "Planted at Metal Staircase.", Map.Metal_Staircase_Planted );
	OnTrigger( "Defused at Metal Staircase.", Map.Metal_Staircase_Defused );
	OnTrigger( "Metal staircase destroyed.", Map.Metal_Staircase_Destroyed );

	OnTrigger( "Radar Base MG42 Nest constructed.", Map.Radar_base_MG_Nest_Built );
	OnTrigger( "Planted at Radar base MG Nest.", Map.Radar_base_MG_Nest_Planted );
	OnTrigger( "Defused at Radar base MG Nest.", Map.Radar_base_MG_Nest_Defused );
	OnTrigger( "Radar Base MG42 Nest destroyed.", Map.Radar_base_MG_Nest_Destroyed );

	OnTrigger( "Planted at Axis staircase access doors.", Map.Axis_staircase_access_doors_Planted );
	OnTrigger( "Defused at the Axis staircase access doors.", Map.Axis_staircase_access_doors_Defused );
	OnTrigger( "Allies have destroyed the basement doors!!!!", Map.Axis_staircase_access_doors_Destroyed );

	OnTrigger( "Axis Staircase MG42 Nest constructed.", Map.Staircase_MG_Nest_Built );
	OnTrigger( "Axis Staircase MG42 Nest destroyed.", Map.Staircase_MG_Nest_Destroyed );

	OnTrigger( "Planted at the radar door.", Map.radar_door_Planted );
	OnTrigger( "Defused at the radar door.", Map.radar_door_Defused );
	OnTrigger( "Allies has destroyed the radar door!", Map.radar_door_Destroyed );

	OnTrigger( "Planted at the radar equipment.", Map.radar_equipment_Planted );
	OnTrigger( "Defused at the radar equipment.", Map.radar_equipment_Defused );
	OnTrigger( "Allies have destroyed the radar!!!!", Map.radar_equipment_Destroyed );

	OnTrigger( "^3Axis have reclaimed the beach bunkers", Map.flag1_Axis_Captured );
	OnTrigger( "^3Allies have captured the beach bunkers", Map.flag1_Allies_Captured );

	OnTrigger( "^3Axis have reclaimed the battery bunkers", Map.flag2_Axis_Captured );
	OnTrigger( "^3Allies have captured the battery bunker", Map.flag2_Allies_Captured );

	OnTrigger( "GRENADE_Hatch Exploded.", Map.Hatch_exploded );

	OnTrigger( "GRENADE_hatch_1 Exploded.", Map.Hatch_1_exploded );
	OnTrigger( "GRENADE_hatch_2 Exploded.", Map.Hatch_2_exploded );
	OnTrigger( "GRENADE_hatch_3 Exploded.", Map.Hatch_3_exploded );

	OnTrigger( "GRENADE_Wall_Beach_Fence Exploded.", Map.Wall_Beach_Fence_exploded );
	OnTrigger( "GRENADE_lower_fence Exploded.", Map.Lower_Fence_exploded );

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

	OnTrigger( "base_lever1_goto", Map.Lift_Moving );

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

	SetAvailableMapGoals( TEAM.AXIS, true, {
		".*MG42_t364",
		".*MG42_t38.*",
		".*MG42_22.*",
		".*Axis_Start.*",
		"BUILD_Command_Post",
		".*CAB_north.2*",
	});

	SetAvailableMapGoals( TEAM.ALLIES, true, {
		".*Allied_Start.*",
		"PLANT_Lower_Bunker_Door",
		"PLANT_Front_Bunker_Door",
	});

	SetGoalPriority( "DEFEND_Axis_Courtyard.*", 0.51, TEAM.AXIS, 0 );
	SetGoalPriority( "DEFEND_Axis_ProtectionNet.*", 0.51, TEAM.AXIS, 0 );
	SetGoalPriority( ".*Axis_Flag2.*", 0.515, TEAM.AXIS, 0 );
	SetGoalPriority( "DEFEND_Axis_RadarEquipment.*", 0.51, TEAM.AXIS, 0 );
	SetGoalPriority( "DEFEND_Axis_RadarEquipment_1", 0.52, TEAM.AXIS, 0 );
	SetGoalPriority( "DEFEND_Axis_RadarEquipment_2", 0.52, TEAM.AXIS, 0 );
	SetGoalPriority( "DEFEND_Axis_RadarEquipment_3", 0.52, TEAM.AXIS, 0 );
	SetGoalPriority( "DEFEND_Axis_RadarEquipment_4", 0.52, TEAM.AXIS, 0 );
	SetGoalPriority( "ATTACK_Axis_RadarPlanted.*", 0.72, TEAM.AXIS, 0 );
	SetGoalPriority( "ATTACK_Axis_RadarPlanted.*", 0.0, TEAM.AXIS, CLASS.ENGINEER );

	SetGoalPriority( "PLANT_Command_Post", 0.49, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "BUILD_Command_Post", 0.75, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_Assault_Ramp", 0.49, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "BUILD_Staircase_MG_Nest", 0.91, TEAM.AXIS, CLASS.ENGINEER );

	SetGoalPriority( "PLANT_Radar_base_MG_Nest", 0.49, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_Command_Post", 0.49, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "BUILD_Command_Post", 0.75, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_Axis_staircase_access_doors", 0.91, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "MOUNTMG42_t436", 0.72, TEAM.ALLIES, 0 );

	// Max users per goal
	Util.SetMaxUsers( 1, "ATTACK.*" );
	Util.SetMaxUsers( 1, "DEFEND.*" );
	Util.SetMaxUsers( 1, "BUILD.*" );
	Util.SetMaxUsers( 1, "PLANT.*" );
	Util.SetMaxUsers( 1, "GRENADE.*" );
	Util.SetMaxUsers( 1, ".*MG42.*" );
	Util.SetMaxUsers( 1, "CAMP.*" );

	// Camp times
	//SetMapGoalProperties( "MOBILEMG42.*", {MinCampTime=10, MaxCampTime=60} );
	SetMapGoalProperties( "MOUNTMG42.*", {MinCampTime=30, MaxCampTime=90} );
	SetMapGoalProperties( "ATTACK.*", {MinCampTime=30, MaxCampTime=90} );
	SetMapGoalProperties( "DEFEND.*", {MinCampTime=30, MaxCampTime=90} );

      //Offset Plant/Build Fix
      Util.SetGoalOffset( -50, 0, 0, "PLANT_main_base_wall_breach" );
      Util.SetGoalOffset( 100, 0, 0, "PLANT_Ventilation_Generator" );
	Util.SetGoalOffset( -20, 0, 0, "PLANT_Generator_Protection_Net" );

	Wp.SetWaypointFlag( "CP_door_in", "axis", true );
	Wp.SetWaypointFlag( "CP_door_in", "door", true );
	Wp.SetWaypointFlag( "CP_door_out", "axis", true );
	Wp.SetWaypointFlag( "CP_door_out", "door", true );
	Wp.SetWaypointFlag( "Hatch_1", "closed", true );
	Wp.SetWaypointFlag( "Hatch_2", "closed", true );
	Wp.SetWaypointFlag( "Hatch_3", "closed", true );
	Wp.SetWaypointFlag( "ventilator_1", "closed", true );
	Wp.SetWaypointFlag( "ventilator_2", "closed", true );
	Wp.SetWaypointFlag( "ventilator_3", "closed", true );
	Wp.SetWaypointFlag( "ventilator_4", "closed", true );
	Wp.SetWaypointFlag( "ventilator_5", "closed", true );
	Wp.SetWaypointFlag( "ventilator_6", "closed", true );
	Wp.SetWaypointFlag( "ventilator_7", "closed", true );
	Wp.SetWaypointFlag( "ventilator_8", "closed", true );


	Undrground = OnTriggerRegion(AABB(2617.125,-1088.875,449.125,4736.875,2528.875,883.168), Map.Allies_In_Underground);
	insideProtectionNet = OnTriggerRegion(AABB(3279.125,364.724,449.125,3712.875,744.874,658.464), Map.Inside_Protection_Net );
	DCM_near_lowerbase_axis_spawn = OnTriggerRegion(AABB(4153.043,-345.522,793.125,4289.742,-215.127,986.937), RegionTrigger.DisableCombatMovement);
	NP_near_lowerbase_axis_spawn = OnTriggerRegion(AABB(4153.043,-345.522,793.125,4289.742,-215.127,986.937), RegionTrigger.DisableBotPush);
	DCM_plantmine_field = OnTriggerRegion(AABB(2018.429,2208.763,1005.784,2432.875,2717.980,1201.927), RegionTrigger.DisableCombatMovement);
	NP_plantmine_field = OnTriggerRegion(AABB(2018.429,2208.763,1005.784,2432.875,2717.980,1201.927), RegionTrigger.DisableBotPush);
	DCM_around_CP_hatch = OnTriggerRegion(AABB(2556.971,892.686,1145.125,2757.573,1064.875,1219.125), RegionTrigger.DisableCombatMovement);
	NP_around_CP_hatch = OnTriggerRegion(AABB(2556.971,892.686,1145.125,2757.573,1064.875,1219.125), RegionTrigger.DisableBotPush);
	DCM_ladder = OnTriggerRegion(AABB(7551.125,-448.874,449.125,7680.871,-263.642,1282.875), RegionTrigger.DisableCombatMovement);
	BD1 = OnTriggerRegion(AABB(191.125,1372.648,737.125,2112.875,3928.875,866.540), RegionTrigger.BreakableDistance);
	BD2 = OnTriggerRegion(AABB(-192.875,3516.526,705.125,271.754,3968.875,861.230), RegionTrigger.BreakableDistance);
	BD3 = OnTriggerRegion(AABB(2815.125,11.124,513.125,3206.197,344.875,587.125), RegionTrigger.BreakableDistance);
	BD4 = OnTriggerRegion(AABB(3279.125,486.242,449.125,3548.550,752.875,771.700), RegionTrigger.BreakableDistance);


	Util.UpdateSwitchData();

	MapRoutes =
	{
		PLANT_main_base_wall_breach =
		{
			ROUTE_RightBoatSpawn =
			{
				ROUTE_LowerBunkerDoor =
				{

				},
			},
			ROUTE_LeftBoatSpawn =
			{
				ROUTE_FrontBunkerDoor =
				{

				},
			},
		},
		CHECKPOINT_flag1 =
		{
			ROUTE_RightBoatSpawn =
			{
				ROUTE_LowerBunkerDoor =
				{

				},
				ROUTE_BelowTheWall_1 =
				{
					ROUTE_BelowTheWall_2 =
					{
						ROUTE_BelowTheWall_3 =
						{
							ROUTE_BelowTheWall_4 =
							{
								ROUTE_BelowTheWall_5 =
								{
									ROUTE_BelowTheWall_6 =
									{
										ROUTE_Tunnel_1 =
										{
											ROUTE_Tunnel_2 =
											{
												ROUTE_DestructibleDoor =
												{

												},
											},
										},
									},
								},
							},
						},
					},
				},
			},
			ROUTE_LeftBoatSpawn =
			{
				ROUTE_FrontBunkerDoor =
				{
					Weight = 2,
					ROUTE_OutsideFence =
					{

					},
					ROUTE_Tunnel_1 =
					{
						Weight = 2,
						ROUTE_Tunnel_2 =
						{
							ROUTE_DestructibleDoor =
							{

							},
						},
					},
				},
				ROUTE_BelowTheWall_6 =
				{
					ROUTE_BelowTheWall_5 =
					{
						ROUTE_BelowTheWall_4 =
						{
							ROUTE_BelowTheWall_3 =
							{
								ROUTE_BelowTheWall_2 =
								{
									ROUTE_BelowTheWall_1 =
									{
										ROUTE_LowerBunkerDoor =
										{

										},
									},
								},
							},
						},
					},
				},
			},
		},
		PLANT_Generator_Protection_Net_1 =
		{
			ROUTE_Flag1Spawn =
			{
				ROUTE_AssaultRamp =
				{
					Weight = 2,
					ROUTE_AssaultRampTunnel_1 =
					{
						ROUTE_AssaultRampTunnelFront =
						{
							ROUTE_NearAxisSpawn_1 =
							{
								ROUTE_NearAxisSpawn =
								{
									ROUTE_NearAxisSpawn_Tunnel_1 =
									{
										ROUTE_NearAxisSpawn_Tunnel_2 =
										{

										},
									},
								},
							},
						},
					},
				},
				ROUTE_MainBaseWall =
				{
					ROUTE_CPhatch =
					{
						ROUTE_CPTunnel =
						{
							ROUTE_NearAxisSpawn_2 =
							{
								ROUTE_NearAxisSpawn =
								{
									ROUTE_NearAxisSpawn_Tunnel_1 =
									{
										ROUTE_NearAxisSpawn_Tunnel_2 =
										{

										},
									},
								},
							},
						},
					},
					ROUTE_Pipe_1 =
					{
						ROUTE_Pipe_2 =
						{
							ROUTE_NearAxisSpawn_2 =
							{
								ROUTE_NearAxisSpawn =
								{
									ROUTE_NearAxisSpawn_Tunnel_1 =
									{
										ROUTE_NearAxisSpawn_Tunnel_2 =
										{

										},
									},
								},
							},
						},
					},
					ROUTE_Stairs_1 =
					{
						ROUTE_Stairs_2 =
						{
							ROUTE_NearAxisSpawn_2 =
							{
								ROUTE_NearAxisSpawn =
								{
									ROUTE_NearAxisSpawn_Tunnel_1 =
									{
										ROUTE_NearAxisSpawn_Tunnel_2 =
										{

										},
									},
								},
							},
						},
					},
				},
			},
			ROUTE_Flag1Spawn2 =
			{
				ROUTE_AssaultRamp =
				{
					Weight = 2,
					ROUTE_AssaultRampTunnel_1 =
					{
						ROUTE_AssaultRampTunnelFront =
						{
							ROUTE_NearAxisSpawn_1 =
							{
								ROUTE_NearAxisSpawn =
								{
									ROUTE_NearAxisSpawn_Tunnel_1 =
									{
										ROUTE_NearAxisSpawn_Tunnel_2 =
										{

										},
									},
								},
							},
						},
					},
				},
				ROUTE_MainBaseWall =
				{
					ROUTE_CPhatch =
					{
						ROUTE_CPTunnel =
						{
							ROUTE_NearAxisSpawn_2 =
							{
								ROUTE_NearAxisSpawn =
								{
									ROUTE_NearAxisSpawn_Tunnel_1 =
									{
										ROUTE_NearAxisSpawn_Tunnel_2 =
										{

										},
									},
								},
							},
						},
					},
					ROUTE_Pipe_1 =
					{
						ROUTE_Pipe_2 =
						{
							ROUTE_NearAxisSpawn_2 =
							{
								ROUTE_NearAxisSpawn =
								{
									ROUTE_NearAxisSpawn_Tunnel_1 =
									{
										ROUTE_NearAxisSpawn_Tunnel_2 =
										{

										},
									},
								},
							},
						},
					},
					ROUTE_Stairs_1 =
					{
						ROUTE_Stairs_2 =
						{
							ROUTE_NearAxisSpawn_2 =
							{
								ROUTE_NearAxisSpawn =
								{
									ROUTE_NearAxisSpawn_Tunnel_1 =
									{
										ROUTE_NearAxisSpawn_Tunnel_2 =
										{

										},
									},
								},
							},
						},
					},
				},
			},
			ROUTE_CPSpawn =
			{
				ROUTE_AssaultRamp =
				{
					Weight = 2,
					ROUTE_AssaultRampTunnel_1 =
					{
						ROUTE_AssaultRampTunnelFront =
						{
							ROUTE_NearAxisSpawn_1 =
							{
								ROUTE_NearAxisSpawn =
								{
									ROUTE_NearAxisSpawn_Tunnel_1 =
									{
										ROUTE_NearAxisSpawn_Tunnel_2 =
										{

										},
									},
								},
							},
						},
					},
				},
				ROUTE_CPhatch =
				{
					ROUTE_CPTunnel =
					{
						ROUTE_NearAxisSpawn_2 =
						{
							ROUTE_NearAxisSpawn =
							{
								ROUTE_NearAxisSpawn_Tunnel_1 =
								{
									ROUTE_NearAxisSpawn_Tunnel_2 =
									{

									},
								},
							},
						},
					},
				},
				ROUTE_Pipe_1 =
				{
					ROUTE_Pipe_2 =
					{
						ROUTE_NearAxisSpawn_2 =
						{
							ROUTE_NearAxisSpawn =
							{
								ROUTE_NearAxisSpawn_Tunnel_1 =
								{
									ROUTE_NearAxisSpawn_Tunnel_2 =
									{

									},
								},
							},
						},
					},
				},
				ROUTE_Stairs_1 =
				{
					ROUTE_Stairs_2 =
					{
						ROUTE_NearAxisSpawn_2 =
						{
							ROUTE_NearAxisSpawn =
							{
								ROUTE_NearAxisSpawn_Tunnel_1 =
								{
									ROUTE_NearAxisSpawn_Tunnel_2 =
									{

									},
								},
							},
						},
					},
				},
			},
		},
		PLANT_Generator_Protection_Net =
		{
			ROUTE_Flag1Spawn2 =
			{
				ROUTE_AssaultRamp =
				{
					Weight = 2,
					ROUTE_AssaultRampTunnel_1 =
					{
						ROUTE_AssaultRampTunnelFront =
						{

						},
					},
				},
				ROUTE_MainBaseWall =
				{
					ROUTE_CPhatch =
					{
						ROUTE_CPTunnel =
						{

						},
					},
					ROUTE_Pipe_1 =
					{
						ROUTE_Pipe_2 =
						{

						},
					},
					ROUTE_Stairs_1 =
					{
						ROUTE_Stairs_2 =
						{

						},
					},
				},
			},
			ROUTE_Flag1Spawn =
			{
				ROUTE_AssaultRamp =
				{
					Weight = 2,
					ROUTE_AssaultRampTunnel_1 =
					{
						ROUTE_AssaultRampTunnelFront =
						{

						},
					},
				},
				ROUTE_MainBaseWall =
				{
					ROUTE_CPhatch =
					{
						ROUTE_CPTunnel =
						{

						},
					},
					ROUTE_Pipe_1 =
					{
						ROUTE_Pipe_2 =
						{

						},
					},
					ROUTE_Stairs_1 =
					{
						ROUTE_Stairs_2 =
						{

						},
					},
				},
			},
			ROUTE_CPSpawn =
			{
				ROUTE_AssaultRamp =
				{
					ROUTE_AssaultRampTunnel_1 =
					{
						ROUTE_AssaultRampTunnelFront =
						{

						},
					},
				},
				ROUTE_CPhatch =
				{
					ROUTE_CPTunnel =
					{

					},
				},
				ROUTE_Pipe_1 =
				{
					ROUTE_Pipe_2 =
					{

					},
				},
				ROUTE_Stairs_1 =
				{
					ROUTE_Stairs_2 =
					{

					},
				},
			},
		},
		CHECKPOINT_flag2 =
		{
			ROUTE_AlliedVentSpawn =
			{
				ROUTE_StaircaseDoor =
				{
					Weight = 2,
					ROUTE_StaircaseMG42 =
					{

					},
				},
				ROUTE_MetalStaircase =
				{
					ROUTE_Ladder =
					{
						Weight = 2,
						ROUTE_NearFlag2 =
						{

						},
					},
					ROUTE_LiftLow =
					{
						ROUTE_LiftUp =
						{
							ROUTE_NearFlag2 =
							{

							},
						},
					},
				},
			},
		},
		PLANT_radar_equipment =
		{
			ROUTE_AlliedVentSpawn =
			{
				ROUTE_StaircaseDoor =
				{
					Weight = 2,
					ROUTE_StaircaseMG42 =
					{
						ROUTE_RightSpawnExit =
						{
							ROUTE_RightSpawnExit_1 =
							{

							},
						},
						ROUTE_LeftSpawnExit =
						{
							Weight = 2,
							ROUTE_LeftSpawnExitFront_1 =
							{
								ROUTE_LeftSpawnExitFront_2 =
								{

								},
							},
							ROUTE_LeftSpawnExitBunker_1 =
							{
								Weight = 2,
								ROUTE_LeftSpawnExitBunker_2 =
								{

								},
							},
						},
					},
				},
				ROUTE_MetalStaircase =
				{
					ROUTE_Ladder =
					{
						Weight = 2,
						ROUTE_NearFlag2 =
						{
							ROUTE_RightSpawnExit =
							{
								ROUTE_RightSpawnExit_1 =
								{

								},
							},
							ROUTE_LeftSpawnExit =
							{
								Weight = 2,
								ROUTE_LeftSpawnExitFront_1 =
								{
									ROUTE_LeftSpawnExitFront_2 =
									{

									},
								},
								ROUTE_LeftSpawnExitBunker_1 =
								{
									Weight = 2,
									ROUTE_LeftSpawnExitBunker_2 =
									{

									},
								},
							},
						},
					},
					ROUTE_LiftLow =
					{
						ROUTE_LiftUp =
						{
							ROUTE_NearFlag2 =
							{
								ROUTE_RightSpawnExit =
								{
									ROUTE_RightSpawnExit_1 =
									{

									},
								},
								ROUTE_LeftSpawnExit =
								{
									Weight = 2,
									ROUTE_LeftSpawnExitFront_1 =
									{
										ROUTE_LeftSpawnExitFront_2 =
										{

										},
									},
									ROUTE_LeftSpawnExitBunker_1 =
									{
										Weight = 2,
										ROUTE_LeftSpawnExitBunker_2 =
										{

										},
									},
								},
							},
						},
					},
				},
			},
			ROUTE_Flag2Spawn =
			{
				ROUTE_RightSpawnExit =
				{
					ROUTE_RightSpawnExit_1 =
					{

					},
				},
				ROUTE_LeftSpawnExit =
				{
					Weight = 2,
					ROUTE_LeftSpawnExitFront_1 =
					{
						ROUTE_LeftSpawnExitFront_2 =
						{

						},
					},
					ROUTE_LeftSpawnExitBunker_1 =
					{
						Weight = 2,
						ROUTE_LeftSpawnExitBunker_2 =
						{

						},
					},
				},
			},
		},
	};

	MapRoutes["ATTACK_Allied_ProtectionNet.*"] =
	{
		ROUTE_Flag1Spawn =
		{
			ROUTE_AssaultRamp =
			{
				ROUTE_AssaultRampTunnel_1 =
				{
					ROUTE_AssaultRampTunnelRight_1 =
					{
						ROUTE_AssaultRampTunnelRight_2 =
						{

						},
					},
					ROUTE_AssaultRampTunnelFront =
					{

					},
				},
			},
			ROUTE_MainBaseWall =
			{
				Weight = 2,
				ROUTE_CPhatch =
				{
					ROUTE_CPTunnel =
					{

					},
				},
				ROUTE_Pipe_1 =
				{
					ROUTE_Pipe_2 =
					{

					},
				},
				ROUTE_Stairs_1 =
				{
					ROUTE_Stairs_2 =
					{

					},
				},
			},
		},
		ROUTE_Flag1Spawn2 =
		{
			ROUTE_AssaultRamp =
			{
				ROUTE_AssaultRampTunnel_1 =
				{
					ROUTE_AssaultRampTunnelRight_1 =
					{
						ROUTE_AssaultRampTunnelRight_2 =
						{

						},
					},
					ROUTE_AssaultRampTunnelFront =
					{

					},
				},
			},
			ROUTE_MainBaseWall =
			{
				Weight = 2,
				ROUTE_CPhatch =
				{
					ROUTE_CPTunnel =
					{

					},
				},
				ROUTE_Pipe_1 =
				{
					ROUTE_Pipe_2 =
					{

					},
				},
				ROUTE_Stairs_1 =
				{
					ROUTE_Stairs_2 =
					{

					},
				},
			},
		},
		ROUTE_CPSpawn =
		{
			ROUTE_AssaultRamp =
			{
				ROUTE_AssaultRampTunnel_1 =
				{
					ROUTE_AssaultRampTunnelRight_1 =
					{
						ROUTE_AssaultRampTunnelRight_2 =
						{

						},
					},
					ROUTE_AssaultRampTunnelFront =
					{

					},
				},
			},
			ROUTE_CPhatch =
			{
				ROUTE_CPTunnel =
				{

				},
			},
			ROUTE_Pipe_1 =
			{
				ROUTE_Pipe_2 =
				{

				},
			},
			ROUTE_Stairs_1 =
			{
				ROUTE_Stairs_2 =
				{

				},
			},
		},
	};
	MapRoutes["ATTACK_Axis_RadarPlanted.*"] =
	{
		ROUTE_RadarBaseAxisSpawn_1 =
		{
			ROUTE_NearCabinets_1 =
			{
				ROUTE_NearCabinets_2 =
				{

				},
			},
		},
	};
	MapRoutes["ATTACK_Allied_RadarEquipment.*"] =
	{
		ROUTE_AlliedVentSpawn =
		{
			ROUTE_StaircaseDoor =
			{
				Weight = 2,
				ROUTE_StaircaseMG42 =
				{
					ROUTE_RightSpawnExit =
					{
						ROUTE_RightSpawnExit_1 =
						{

						},
					},
					ROUTE_LeftSpawnExit =
					{
						ROUTE_LeftSpawnExitFront_1 =
						{
							ROUTE_LeftSpawnExitFront_2 =
							{

							},
						},
						ROUTE_LeftSpawnExitBunker_1 =
						{
							ROUTE_LeftSpawnExitBunker_2 =
							{

							},
						},
					},
				},
			},
			ROUTE_MetalStaircase =
			{
				ROUTE_Ladder =
				{
					Weight = 2,
					ROUTE_NearFlag2 =
					{
						ROUTE_RightSpawnExit =
						{
							ROUTE_RightSpawnExit_1 =
							{

							},
						},
						ROUTE_LeftSpawnExit =
						{
							ROUTE_LeftSpawnExitFront_1 =
							{
								ROUTE_LeftSpawnExitFront_2 =
								{

								},
							},
							ROUTE_LeftSpawnExitBunker_1 =
							{
								ROUTE_LeftSpawnExitBunker_2 =
								{

								},
							},
						},
					},
				},
				ROUTE_LiftLow =
				{
					ROUTE_LiftUp =
					{
						ROUTE_NearFlag2 =
						{
							ROUTE_RightSpawnExit =
							{
								ROUTE_RightSpawnExit_1 =
								{

								},
							},
							ROUTE_LeftSpawnExit =
							{
								ROUTE_LeftSpawnExitFront_1 =
								{
									ROUTE_LeftSpawnExitFront_2 =
									{

									},
								},
								ROUTE_LeftSpawnExitBunker_1 =
								{
									ROUTE_LeftSpawnExitBunker_2 =
									{

									},
								},
							},
						},
						ROUTE_RightWay_1 =
						{
							ROUTE_RightWay_2 =
							{

							},
						},
					},
				},
			},
		},
		ROUTE_Flag2Spawn =
		{
			ROUTE_RightSpawnExit =
			{
				ROUTE_RightSpawnExit_1 =
				{

				},
			},
			ROUTE_LeftSpawnExit =
			{
				ROUTE_LeftSpawnExitFront_1 =
				{
					ROUTE_LeftSpawnExitFront_2 =
					{

					},
				},
				ROUTE_LeftSpawnExitBunker_1 =
				{
					ROUTE_LeftSpawnExitBunker_2 =
					{

					},
				},
			},
		},
	};

	Util.Routes(MapRoutes);

	SetAvailableMapGoals( TEAM.ALLIES, true, "ROUTE.*" );
	yield();
	SetAvailableMapGoals( TEAM.ALLIES, false, {
		"ROUTE_LowerBunkerDoor",
		"ROUTE_FrontBunkerDoor",
		"ROUTE_AssaultRamp",
		"ROUTE_MainBaseWall",
		"ROUTE_StaircaseDoor",
		"ROUTE_StaircaseMG42",
		"ROUTE_MetalStaircase",
		"ROUTE_Ladder",
		"ROUTE_NearFlag2",
		"ROUTE_LiftLow",
		"ROUTE_LiftUp",
	});

	//copy some routes
	MapRoutes.DEFEND_Axis_RadarEquipment_1 = MapRoutes["ATTACK_Axis_RadarPlanted.*"];
	MapRoutes.DEFEND_Axis_RadarEquipment_2 = MapRoutes["ATTACK_Axis_RadarPlanted.*"];
	MapRoutes.DEFEND_Axis_RadarEquipment_3 = MapRoutes["ATTACK_Axis_RadarPlanted.*"];
	MapRoutes.DEFEND_Axis_RadarEquipment_4 = MapRoutes["ATTACK_Axis_RadarPlanted.*"];
	MapRoutes.PLANT_Ventilation_Generator = MapRoutes.PLANT_Generator_Protection_Net;

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

global OnBotJoin = function( bot )
{
	bot.TargetBreakableDist = 150.0;

};
