//==========================================================================================
//
//	apennines_b2.gm
//
//	Who      		When		What
//------------------------------------------------------------------------------------------
//	Qiki			07 March 2011	Initial Script
//	Native12		18 March 2011	Start scripting
//	Native12		19 May 2011	First release
//	Native12		21 May 2011	Add routes
//	Native12		27 May 2011	Add routes, change of priorities....,release
//	Native12		15.05.2012	Reduced count of waypoints, minor fix in gm & goals
//
//------------------------------------------------------------------------------------------
//	apennines_b2.way	15.05.2012
//	apennines_b2_goals.gm	15.05.2012
//==========================================================================================

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

	garagedoor1 = true,
	AxisDoor = true,
	garagedoor2 = 0,
	AlliedFlag = 0,
	AxisGarageRoofMG42 = 0,
	AlliedGarageRoofMG42 = 0,
	Generator = 1,
	AxisCP = 0,
	AlliedCP = 0,
	WindowMG42 = 0,
	CabinMG42 = 0,
	BridgeBuild = 0,
	CellarEntrance = true,
	AlliesPastRiver = 0,
	AlliedEngPastRiver = 0,
	AlliedCovertPastRiver = 0,
	ComplexMG42 = false,
	Footbridge = 0,
	CellarMG42 = 0,
	AxisChangeSpawn = 0,
	AlliedEngInComplex = 0,
	AlliesInComplex = 0,
	AlliesInCanyon = 0,
	AlliedEngInCanyon = 0,
	ReSpawn = 0,
	AxisEngPastRiver = 0,
	AxisEngInCanyon = 0,

	Axis_Door_Dyno = 0,
	Bridge_Dyno = 0,
	Cabin_MG42_Dyno = 0,
	Cellar_Entrance_Dyno = 0,
	Cellar_MG42_Dyno = 0,
	Command_Post_Dyno = 0,
	Communications_Radio_Dyno = 0,
	Complex_Roof_MG42_Dyno = 0,
	Footbridge_Dyno = 0,
	Garage_Door_Dyno = 0,
	Garage_Roof_MG42_Dyno = 0,
	Generator_Dyno = 0,
	Window_MG42_Dyno = 0,

	Navigation =
	{
		//  	/bot waypoint_setproperty paththrough Navigation_PT:ladder
		ladder =
		{
			navigate = function(_this)
			{
				wpTable = {};
				Wp.GetWaypointByName("Axis_Spawn_Ladder", wpTable);
				if ( _this.Goto(wpTable.position) == EVENT.PATH_SUCCESS )
				{
					_this.AddAimRequest(Priority.VeryHigh, "facing", wpTable.facing);
					_this.Bot.HoldButton(BTN.FORWARD, 0.5);
					sleep(0.5);
					_this.AddAimRequest( Priority.VeryHigh, "facing",Vector3( -0.011860, 0.034844, -0.999322 ) );
					_this.Bot.HoldButton(BTN.FORWARD, 1);
					sleep(1);
					_this.AddAimRequest( Priority.VeryHigh, "facing",Vector3( -0.014307,-0.962692,-0.270222 ) );
					_this.Bot.HoldButton(BTN.FORWARD, 0.7);
					sleep(0.7);
				}
			},
		},
	},

	Garage_Door_Planted = function( trigger )
	{
		Map.Garage_Door_Dyno += 1;

		SetAvailableMapGoals( TEAM.AXIS, false, {
			"AIRSTRIKE_Axis_Start_1",
			"AIRSTRIKE_Axis_Start_6",
		});

		SetAvailableMapGoals( TEAM.AXIS, true, {
			"SMOKEBOMB_Axis_GarageDoorPlanted",
			"DEFEND_Axis_Start_.*",
			"BUILD_Complex_Roof_MG42",
		});

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

	Garage_Door_Defused = function( trigger )
	{
		Map.Garage_Door_Dyno -= 1;

		if ( Map.Garage_Door_Dyno == 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, {
				"DEFEND_Axis_Start_.*",
				"SMOKEBOMB_Axis_GarageDoorPlanted",
			});

			if ( Map.garagedoor1 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					"AIRSTRIKE_Axis_Start_1",
					"AIRSTRIKE_Axis_Start_6",
				});
			}
		}

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

	Garage_Door_Destroyed = function( trigger )
	{

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

		Map.Garage_Door_Dyno = 0;
		Map.garagedoor1 = false;

		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"PLANT_Garage_Door",
			".*_Allied_Start_.*",
			".*_Allied_StartBack_.*",
		});

		SetAvailableMapGoals( TEAM.AXIS, false, {
			"SMOKEBOMB_Axis_GarageDoorPlanted",
			"SMOKEBOMB_Axis_Start_13",
			"AIRSTRIKE_Axis_Start_1",
			"AIRSTRIKE_Axis_Start_6",
			"ARTILLERY_S_Axis_Start_5",
			"ARTILLERY_S_Axis_Start_8",
			"CALLARTILLERY_Axis_Start_4",
			"CALLARTILLERY_Axis_Start_10",
			".*_Axis_StartFront_.*",
		});

		SetAvailableMapGoals( TEAM.AXIS, true, {
			"SMOKEBOMB_Axis_Start_25",
			"AIRSTRIKE_Axis_Start_28",
			"ARTILLERY_S_Axis_Start_27",
			"CALLARTILLERY_Axis_Start_26",
		});

		Util.MapDebugPrint( "^5Garage_Door_Destroyed" );

		if ( Map.AlliedFlag == 1 )	//bunker is Allied
		{
			SetAvailableMapGoals( TEAM.AXIS, false, {
				".*_Axis_Start_.*",
				".*_Axis_StartBack_.*",
				"BUILD_Generator",
				"PLANTMINE_Axis_Start_20",
				"PLANTMINE_Axis_Start_21",
				"PLANTMINE_Axis_Start_22",
				"PLANTMINE_Axis_Start_23",
				"PLANTMINE_Axis_Start_24",
			});

			if ( Map.BridgeBuild == 0 )	//destroyed
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					"PLANTMINE_Axis_CellarEntrance_.*",
					"PLANTMINE_Axis_NearBridge_.*",
					".*_Axis_NearBridge_.*",
					"AMMOCAB_south_ammocabinet_1",
					"HEALTHCAB_south_healthcabinet_1",
				});

				if ( Map.ComplexMG42 )	//built
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						"MOUNTMG42_Complex_Roof_MG42",
						"REPAIRMG42_Complex_Roof_MG42",
					});
				}
				else	//destroyed
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Complex_Roof_MG42" );
				}
				if ( Map.CellarMG42 == 0 )	//destroyed
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Cellar_MG42" );
				}

				Util.MapDebugPrint( "^5Garage_Door_Destroyed, bunker is Allied, Bridge destroyed" );
			}
		}
		else	//bunker is Axis
		{
			if ( Map.BridgeBuild == 0 )	//destroyed
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					"PLANTMINE_Axis_CellarEntrance_.*",
					"PLANTMINE_Axis_NearBridge_.*",
					"AMMOCAB_south_ammocabinet_1",
					"HEALTHCAB_south_healthcabinet_1",
				});

				if ( Map.ComplexMG42 )	//built
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						"MOUNTMG42_Complex_Roof_MG42",
						"REPAIRMG42_Complex_Roof_MG42",
					});
				}
				else	//destroyed
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Complex_Roof_MG42" );
				}
				if ( Map.CellarMG42 == 0 )	//destroyed
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Cellar_MG42" );
				}

				Util.MapDebugPrint( "^5Garage_Door_Destroyed, bunker is Axis, Bridge destroyed" );
			}
		}

		SetGoalPriority( "BUILD_Garage_Roof_MG42", 0.90, TEAM.ALLIES, CLASS.ENGINEER );

		if ( Map.BridgeBuild == 0 )	//destroyed
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Bridge" );
			SetGoalPriority( "BUILD_Bridge", 0.91, TEAM.ALLIES, CLASS.ENGINEER );
			yield();
			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"BUILD_Bridge",
				".*_Allied_NearBridge_.*",
			});
		}

		if ( Map.AxisDoor )	//intact
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"SWITCH_GarageDoor2",
				"CHECKPOINT_checkpoint",
				"AMMOCAB_south_ammocabinet",
				"HEALTHCAB_south_healthcabinet",
			});

			if ( Map.AxisGarageRoofMG42 == 1 )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Roof_MG42" );
			}

			if ( Map.AlliedGarageRoofMG42 == 0 and Map.AxisGarageRoofMG42 == 0 )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Garage_Roof_MG42" );
			}

			if ( Map.Generator == 1 )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Generator" );
			}

			if ( Map.AxisCP == 1 )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Command_Post" );
			}

			if ( Map.AlliedCP == 0 and Map.AxisCP == 0 )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
			}

			SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Axis_Door" );
			SetGoalPriority( "PLANT_Axis_Door", 0.4, TEAM.ALLIES, CLASS.ENGINEER );
			yield();
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_Door" );

			Util.MapDebugPrint( "^5Garage_Door_Destroyed, Axisdoor intact" );
		}
	},

	Cabin_MG42_Built = function( trigger )
	{

		Map.CabinMG42 = 1;

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

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

		if ( Map.AlliedFlag == 0 )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"REPAIRMG42_Cabin_MG42",
				"MOUNTMG42_Cabin_MG42",
			});
		}
		else
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, {
				"REPAIRMG42_Cabin_MG42",
				"MOUNTMG42_Cabin_MG42",
			});
		}

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

	Cabin_MG42_Planted = function( trigger )
	{
		Map.Cabin_MG42_Dyno += 1;

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

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

	Cabin_MG42_Defused = function( trigger )
	{
		Map.Cabin_MG42_Dyno -= 1;

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

	Cabin_MG42_Destroyed = function( trigger )
	{
		Map.Cabin_MG42_Dyno = 0;
		Map.CabinMG42 = 0;

		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"REPAIRMG42_Cabin_MG42",
			"MOUNTMG42_Cabin_MG42",
		});

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

		if ( Map.AlliedFlag == 0 )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Cabin_MG42" );
		}
		else
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Cabin_MG42" );
		}

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

	Window_MG42_Built = function( trigger )
	{

		Map.WindowMG42 = 1;

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

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

		if ( Map.AlliedFlag == 0 )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"REPAIRMG42_Window_MG42",
				"MOUNTMG42_Window_MG42",
			});
		}
		else
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, {
				"REPAIRMG42_Window_MG42",
				"MOUNTMG42_Window_MG42",
			});
		}

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

	Window_MG42_Planted = function( trigger )
	{
		Map.Window_MG42_Dyno += 1;

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

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

	Window_MG42_Defused = function( trigger )
	{
		Map.Window_MG42_Dyno -= 1;

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

	Window_MG42_Destroyed = function( trigger )
	{
		Map.Window_MG42_Dyno = 0;
		Map.WindowMG42 = 0;

		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"REPAIRMG42_Window_MG42",
			"MOUNTMG42_Window_MG42",
		});

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

		if ( Map.AlliedFlag == 0 )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Window_MG42" );
		}
		else
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Window_MG42" );
		}

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

	Axis_Garage_Roof_MG42_Built = function( trigger )
	{

		Map.AxisGarageRoofMG42 = 1;

		Util.SetGoalPosition(943.226440, -1458.586426, 920.125122, "PLANT_Garage_Roof_MG42");
		Wp.SetWaypointFlag( "Tower_1", "closed", false);

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

		if ( Map.garagedoor1 )
		{
			if ( Map.AlliedFlag == 0 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					"SMOKEBOMB_Axis_GarageRoofMG42",
					"REPAIRMG42_axisgarage_mg42_actual",
					"MOUNTMG42_axisgarage_mg42_actual",
				});
			}
			else
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Roof_MG42" );
			}
		}
		else
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Roof_MG42" );
		}

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

	Allied_Garage_Roof_MG42_Built = function( trigger )
	{
		Map.AlliedGarageRoofMG42 = 1;

		Util.SetGoalPosition(943.043579, -1333.470825, 920.128357, "PLANT_Garage_Roof_MG42");
		Wp.SetWaypointFlag( "Tower_2", "closed", false);

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

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

		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"REPAIRMG42_Garage_Roof_MG42",
			"MOUNTMG42_Garage_Roof_MG42",
		});

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

	Garage_Roof_MG42_Planted = function( trigger )
	{
		Map.Garage_Roof_MG42_Dyno += 1;

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

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

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

	Garage_Roof_MG42_Defused = function( trigger )
	{
		Map.Garage_Roof_MG42_Dyno -= 1;

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

	Axis_Garage_Roof_MG42_Destroyed = function( trigger )
	{
		Map.Garage_Roof_MG42_Dyno = 0;
		Map.AxisGarageRoofMG42 = 0;
		Wp.SetWaypointFlag( "Tower_1", "closed", true);

		SetAvailableMapGoals( TEAM.AXIS, false, {
			"REPAIRMG42_axisgarage_mg42_actual",
			"MOUNTMG42_axisgarage_mg42_actual",
			"SMOKEBOMB_Axis_GarageRoofMG42",
		});

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

		if ( Map.garagedoor1 )
		{
			if ( Map.AlliedFlag == 0 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Garage_Roof_MG42" );
			}
			else
			{
				SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Garage_Roof_MG42" );

				SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Garage_Roof_MG42" );
			}
		}
		else
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Garage_Roof_MG42" );
		}

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

	Allied_Garage_Roof_MG42_Destroyed = function( trigger )
	{
		Map.Garage_Roof_MG42_Dyno = 0;
		Map.AlliedGarageRoofMG42 = 0;
		Wp.SetWaypointFlag( "Tower_2", "closed", true);

		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"REPAIRMG42_Garage_Roof_MG42",
			"MOUNTMG42_Garage_Roof_MG42",
		});

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

		if ( Map.garagedoor1 )
		{
			if ( Map.AlliedFlag == 1 )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Garage_Roof_MG42" );
			}
			else
			{
				SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Garage_Roof_MG42" );

				SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Garage_Roof_MG42" );
			}
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Garage_Roof_MG42" );

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

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

	Axis_Door_Planted = function( trigger )
	{
		Map.Axis_Door_Dyno += 1;

		if ( Map.garagedoor1 )
		{
			if ( Map.AlliedFlag == 0 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFUSE_Axis_Door_.*" );
			}
			else
			{
				SetAvailableMapGoals( TEAM.AXIS, false, "DEFUSE_Axis_Door_.*" );
			}
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "DEFUSE_Axis_Door_.*" );
		}

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

	Axis_Door_Defused = function( trigger )
	{
		Map.Axis_Door_Dyno -= 1;

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

	Axis_Door_Destroyed = function( trigger )
	{
		Map.Axis_Door_Dyno = 0;
		Map.AxisDoor = false;

		Wp.SetWaypointFlag( "Axis_Door_1", "axis", false);
		Wp.SetWaypointFlag( "Axis_Door_1", "door", false);
		Wp.SetWaypointFlag( "Axis_Door", "axis", false);
		Wp.SetWaypointFlag( "Axis_Door", "door", false);

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

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

		Util.MapDebugPrint( "^5Axis_Door_Destroyed" );

		if ( Map.garagedoor1 )	//intact
		{
			sleep(1.5);
			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"SWITCH_GarageDoor2",
				"CHECKPOINT_checkpoint",
				"AMMOCAB_south_ammocabinet",
				"HEALTHCAB_south_healthcabinet",
			});

			if ( Map.AxisGarageRoofMG42 == 1 )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Roof_MG42" );
			}

			if ( Map.AlliedGarageRoofMG42 == 0 and Map.AxisGarageRoofMG42 == 0 )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Garage_Roof_MG42" );
			}

			if ( Map.Generator == 1 )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Generator" );
			}

			if ( Map.AxisCP == 1 )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Command_Post" );
			}

			if ( Map.AlliedCP == 0 and Map.AxisCP == 0 )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
			}

			Util.MapDebugPrint( "^5Axis_Door_Destroyed, Garagedoor intact" );
		}
	},

	checkpoint_Allies_Captured = function( trigger )
	{

		Map.AlliedFlag = 1;

		if ( Map.ReSpawn == 1 )
		{
			Map.ReSpawn = 0;
		}

		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"CHECKPOINT_checkpoint",
			"REPAIRMG42_Cabin_MG42",
			"MOUNTMG42_Cabin_MG42",
			"REPAIRMG42_Window_MG42",
			"MOUNTMG42_Window_MG42",
		});

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

		if ( Map.garagedoor1 )	//intact
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Axis_Start_.*" );
		}
		else	//destroyed
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, {
				".*_Allied_StartBack_.*",
				".*_Allied_Start_.*",
			});
		}

		if ( Map.AxisGarageRoofMG42 == 1 )	//built
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Roof_MG42" );

			SetAvailableMapGoals( TEAM.AXIS, false, {
				"REPAIRMG42_axisgarage_mg42_actual",
				"MOUNTMG42_axisgarage_mg42_actual",
				"SMOKEBOMB_Axis_GarageRoofMG42",
			});
		}

		if ( Map.AlliedGarageRoofMG42 == 1 )	//built
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"REPAIRMG42_Garage_Roof_MG42",
				"MOUNTMG42_Garage_Roof_MG42",
			});
		}

		if ( Map.AlliedGarageRoofMG42 == 0 and Map.AxisGarageRoofMG42 == 0 )	//both destroyed
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Garage_Roof_MG42" );
		}

		if ( Map.Generator == 1 )	//built
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Generator" );
		}
		else	//destroyed
		{
			//SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Axis_InfrontofWall_.*" );
		}

		if ( Map.AxisCP == 1 )	//built
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Command_Post" );
		}

		if ( Map.AlliedCP == 0 and Map.AxisCP == 0 )	//both destroyed
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
		}

		if ( Map.WindowMG42 == 0 )	//destroyed
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Window_MG42" );
		}
		else	//built
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Window_MG42" );
		}

		if ( Map.CabinMG42 == 0 )	//destroyed
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Cabin_MG42" );
		}
		else	//built
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Cabin_MG42" );
		}

		Util.MapDebugPrint( "^5Allies_Captured_Garage" );

		sleep(35);

		if ( Map.AxisChangeSpawn == 0 )
		{
			if ( !Map.garagedoor1 )	//destroyed
			{
				if ( Map.AlliedFlag == 1 )	//Garage is Allied
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"BUILD_Generator",
						"AMMOCAB_south_ammocabinet",
						"HEALTHCAB_south_healthcabinet",
						"BUILD_Command_Post",
						"BUILD_Garage_Roof_MG42",
						".*_Axis_Start_.*",
						".*_Axis_StartBack_.*",
						"SWITCH_GarageDoor2",
						"CHECKPOINT_checkpoint",
						"PLANTMINE_Axis_Start_20",
						"PLANTMINE_Axis_Start_21",
						"PLANTMINE_Axis_Start_22",
						"PLANTMINE_Axis_Start_23",
						"PLANTMINE_Axis_Start_24",
					});
					yield;
					SetGoalPriority( "CHECKPOINT_checkpoint", 0.4, TEAM.AXIS, 0 );
					SetGoalPriority( "CHECKPOINT_checkpoint", 0.75, TEAM.AXIS, CLASS.COVERTOPS );

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

					Util.ChangeSpawn( TEAM.AXIS, 2 );
					Map.AxisChangeSpawn = 1;

					Util.MapDebugPrint( "^5Axis_not_Recaptured_Garage" );

					if ( Map.BridgeBuild == 0 )	//destroyed
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							"PLANTMINE_Axis_NearBridge_.*",
							"PLANTMINE_Axis_CellarEntrance_.*",
							".*_Axis_NearBridge_.*",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
						});

						if ( Map.ComplexMG42 )	//built
						{
							SetAvailableMapGoals( TEAM.AXIS, true, {
								"MOUNTMG42_Complex_Roof_MG42",
								"REPAIRMG42_Complex_Roof_MG42",
							});
						}
						else	//destroyed
						{
							SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Complex_Roof_MG42" );
						}
						if ( Map.CellarMG42 == 0 )	//destroyed
						{
							SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Cellar_MG42" );
						}
						else	//built
						{
							if ( !Map.CellarEntrance )	//destroyed
							{
								if ( Map.AlliesInCanyon > 0 )	//Allies are in canyon
								{
									SetAvailableMapGoals( TEAM.AXIS, true, {
										"MOUNTMG42_Cellar_MG42",
										"REPAIRMG42_Cellar_MG42",
									});
								}
							}
						}

						Util.MapDebugPrint( "^5Axis_not_Recaptured_Garage, Bridge destroyed" );
					}
				}
			}
			else	//Garagedoor intact
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					"BUILD_Complex_Roof_MG42",
					"BUILD_Cellar_MG42",
					"PLANTMINE_Axis_CellarEntrance_.*",
					"PLANTMINE_Axis_NearBridge_.*",
				});

				Util.MapDebugPrint( "^5Allies_Captured_Garage, Garagedoor intact" );
			}
		}
		else
		{
			if ( Map.AlliedFlag == 1 )	//Garage is Allied
			{
				SetAvailableMapGoals( TEAM.AXIS, false, {
					".*_Axis_Start_.*",
					".*_Axis_StartBack_.*",
					"AMMOCAB_south_ammocabinet",
					"HEALTHCAB_south_healthcabinet",
					"SWITCH_GarageDoor2",
				});

				Util.MapDebugPrint( "^5Axis lost Garage" );
			}
		}
	},

	checkpoint_Axis_Captured = function( trigger )
	{

		Map.AlliedFlag = 0;

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

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

		if ( Map.AlliedGarageRoofMG42 == 1 )	//built
		{
			if ( Map.garagedoor1 )	//intact
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Garage_Roof_MG42" );
			}

			SetAvailableMapGoals( TEAM.ALLIES, false, {
				"REPAIRMG42_Garage_Roof_MG42",
				"MOUNTMG42_Garage_Roof_MG42",
			});
		}

		if ( Map.AxisGarageRoofMG42 == 1 )	//built
		{
			if ( Map.garagedoor1 )	//intact
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					"SMOKEBOMB_Axis_GarageRoofMG42",
					"REPAIRMG42_axisgarage_mg42_actual",
					"MOUNTMG42_axisgarage_mg42_actual",
				});
			}
		}

		if ( Map.AlliedGarageRoofMG42 == 0 and Map.AxisGarageRoofMG42 == 0 )	//both destroyed
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Garage_Roof_MG42" );

			if ( Map.garagedoor1 )	//intact
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Garage_Roof_MG42" );
			}
		}

		if ( Map.Generator == 0 )	//destroyed
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Generator" );

		}
		else	//built
		{
			if ( Map.garagedoor1 and Map.AxisDoor )	//both intact
			{
				SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Generator" );
			}
			else	//destroyed
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Generator" );
			}
		}

		if ( Map.AlliedCP == 1 )	//built
		{
			if ( Map.garagedoor1 )	//intact
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Command_Post" );
			}
		}

		if ( Map.AlliedCP == 0 and Map.AxisCP == 0 )	//both destroyed
		{
			if ( Map.garagedoor1 and Map.AxisDoor )	//both intact
			{
				SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Command_Post" );
			}

			if ( Map.garagedoor1 )	//intact
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" );
			}
		}

		if ( Map.WindowMG42 == 0 )	//destroyed
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Window_MG42" );
		}
		else	//built
		{
			//disabled - suicidal mission :o))
			//SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Window_MG42" );

			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"REPAIRMG42_Window_MG42",
				"MOUNTMG42_Window_MG42",
			});
		}

		if ( Map.CabinMG42 == 0 )	//destroyed
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Cabin_MG42" );
		}
		else	//built
		{
			//disabled - suicidal mission :o))
			//SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Cabin_MG42" );

			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"REPAIRMG42_Cabin_MG42",
				"MOUNTMG42_Cabin_MG42",
			});
		}

		if ( Map.AxisChangeSpawn == 0 )
		{
			Util.ChangeSpawn( TEAM.AXIS, 3 );

			Util.MapDebugPrint( "^5Axis_Captured_Garage" );
		}
		else
		{
			if ( Map.AlliesPastRiver == 0 and Map.BridgeBuild == 0 and Map.AlliesInCanyon == 0 and Map.Generator == 1 )
			{
				if ( Map.AxisChangeSpawn == 1 )
				{
					Util.ChangeSpawn( TEAM.AXIS, 3 );
					Map.ReSpawn = 1;

					Map.AxisChangeSpawn = 0;

					SetAvailableMapGoals( TEAM.AXIS, false, {
						".*_Axis_Radio_.*",
						"AMMOCAB_south_ammocabinet_1",
						"HEALTHCAB_south_healthcabinet_1",
						"MOUNTMG42_Complex_Roof_MG42",
						"REPAIRMG42_Complex_Roof_MG42",
						"BUILD_Complex_Roof_MG42",
						"MOUNTMG42_Cellar_MG42",
						"REPAIRMG42_Cellar_MG42",
						"BUILD_Cellar_MG42",
						".*_Axis_NearBridge_.*",
						".*_Axis_NearFootBridge_.*",
						".*_Axis_CellarEntrance_.*",
					});

					SetAvailableMapGoals( TEAM.ALLIES, false, {
						".*_Allied_Radio_.*",
						"PLANT_Communications_Radio",
						"AMMOCAB_south_ammocabinet_1",
						"HEALTHCAB_south_healthcabinet_1",
						"PLANT_Complex_Roof_MG42",
						"PLANT_Cellar_MG42",
						"PLANT_Cellar_Entrance",
						".*_Allied_NearBridge_.*",
						".*_Allied_NearFootBridge_.*",
						".*_Allied_NearCellarEntrance_.*",
					});

					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*_Axis_Start_.*",
						".*_Axis_StartBack_.*",
						"AMMOCAB_south_ammocabinet",
						"HEALTHCAB_south_healthcabinet",
					});

					if ( Map.garagedoor2 )
					{
						if ( Map.garagedoor1 )
						{
							SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
						}
						else
						{
							if ( Map.AxisChangeSpawn == 0 )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
							}
							else
							{
								if ( Map.ReSpawn == 1 )
								{
									SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
								}
							}
						}
					}

					if ( !Map.garagedoor1 )
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							"PLANTMINE_Axis_Start_1.*",
							"SMOKEBOMB_Axis_Start_13",
							"AIRSTRIKE_Axis_Start_1",
							"AIRSTRIKE_Axis_Start_6",
							"ARTILLERY_S_Axis_Start_5",
							"ARTILLERY_S_Axis_Start_8",
							"CALLARTILLERY_Axis_Start_4",
							"CALLARTILLERY_Axis_Start_10",
						});
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							"SMOKEBOMB_Axis_Start_25",
							"AIRSTRIKE_Axis_Start_28",
							"ARTILLERY_S_Axis_Start_27",
							"CALLARTILLERY_Axis_Start_26",
							".*_Axis_Start_7",
							".*_Axis_Start_9",
							".*_Axis_Start_10",
							".*_Axis_Start_11",
							".*_Axis_Start_12",
							".*_Axis_Start_14",
						});
					}

					if ( !Map.garagedoor2 )
					{
						if ( !Map.garagedoor1 or !Map.AxisDoor )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_GarageDoor2" );
						}
					}

					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"CHECKPOINT_checkpoint",
						".*_Allied_Start_.*",
						".*_Allied_StartBack_.*",
						"BUILD_Bridge",
						"PLANT_Generator",
					});

					if ( Map.garagedoor1 )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Door" );
					}

					if ( Map.AxisDoor )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_Door" );
					}

					if ( Map.WindowMG42 == 0 )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Window_MG42" );
					}
					else
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"REPAIRMG42_Window_MG42",
							"MOUNTMG42_Window_MG42",
						});
					}

					if ( Map.CabinMG42 == 0 )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Cabin_MG42" );
					}
					else
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"REPAIRMG42_Cabin_MG42",
							"MOUNTMG42_Cabin_MG42",
						});
					}

					Util.MapDebugPrint( "^5Axis_Re-Captured_Garage" );
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						".*_Axis_Radio_.*",
						"AMMOCAB_south_ammocabinet_1",
						"HEALTHCAB_south_healthcabinet_1",
						"MOUNTMG42_Complex_Roof_MG42",
						"REPAIRMG42_Complex_Roof_MG42",
						"BUILD_Complex_Roof_MG42",
						"MOUNTMG42_Cellar_MG42",
						"REPAIRMG42_Cellar_MG42",
						"BUILD_Cellar_MG42",
						".*_Axis_NearBridge_.*",
						".*_Axis_NearFootBridge_.*",
						".*_Axis_CellarEntrance_.*",
					});

					SetAvailableMapGoals( TEAM.ALLIES, false, {
						".*_Allied_Radio_.*",
						"PLANT_Communications_Radio",
						"AMMOCAB_south_ammocabinet_1",
						"HEALTHCAB_south_healthcabinet_1",
						"PLANT_Complex_Roof_MG42",
						"PLANT_Cellar_MG42",
						"PLANT_Cellar_Entrance",
						".*_Allied_NearBridge_.*",
						".*_Allied_NearFootBridge_.*",
						".*_Allied_NearCellarEntrance_.*",
					});

					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*_Axis_Start_.*",
						".*_Axis_StartBack_.*",
						"AMMOCAB_south_ammocabinet",
						"HEALTHCAB_south_healthcabinet",
					});

					if ( Map.garagedoor2 )
					{
						if ( Map.garagedoor1 )
						{
							SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
						}
						else
						{
							if ( Map.AxisChangeSpawn == 0 )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
							}
							else
							{
								if ( Map.ReSpawn == 1 )
								{
									SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
								}
							}
						}
					}

					if ( !Map.garagedoor1 )
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							"PLANTMINE_Axis_Start_1.*",
							"SMOKEBOMB_Axis_Start_13",
							"AIRSTRIKE_Axis_Start_1",
							"AIRSTRIKE_Axis_Start_6",
							"ARTILLERY_S_Axis_Start_5",
							"ARTILLERY_S_Axis_Start_8",
							"CALLARTILLERY_Axis_Start_4",
							"CALLARTILLERY_Axis_Start_10",
						});
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							"SMOKEBOMB_Axis_Start_25",
							"AIRSTRIKE_Axis_Start_28",
							"ARTILLERY_S_Axis_Start_27",
							"CALLARTILLERY_Axis_Start_26",
							".*_Axis_Start_7",
							".*_Axis_Start_9",
							".*_Axis_Start_10",
							".*_Axis_Start_11",
							".*_Axis_Start_12",
							".*_Axis_Start_14",
						});
					}

					if ( !Map.garagedoor2 )
					{
						if ( !Map.garagedoor1 or !Map.AxisDoor )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_GarageDoor2" );
						}
					}

					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"CHECKPOINT_checkpoint",
						".*_Allied_Start_.*",
						".*_Allied_StartBack_.*",
						"BUILD_Bridge",
						"PLANT_Generator",
					});

					if ( Map.garagedoor1 )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Door" );

						if ( Map.AxisDoor )
						{
							if ( Map.Generator == 1 )
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Generator" );
							}
						}
					}

					if ( Map.AxisDoor )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_Door" );
					}

					if ( Map.WindowMG42 == 0 )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Window_MG42" );
					}
					else
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"REPAIRMG42_Window_MG42",
							"MOUNTMG42_Window_MG42",
						});
					}

					if ( Map.CabinMG42 == 0 )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Cabin_MG42" );
					}
					else
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"REPAIRMG42_Cabin_MG42",
							"MOUNTMG42_Cabin_MG42",
						});
					}

					Util.MapDebugPrint( "^5AAAA" );
				}
			}
			else
			{
				Util.ChangeSpawn( TEAM.AXIS, 2 );

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

	Bridge_Built = function( trigger )
	{

		Map.BridgeBuild = 1;

		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"BUILD_Bridge",
			".*_Allied_NearBridge_.*",
		});

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

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

		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"PLANT_Communications_Radio",
			"AMMOCAB_south_ammocabinet_1",
			"HEALTHCAB_south_healthcabinet_1",
			"CALLARTILLERY_Allied_NearBridge_2",
			"ARTILLERY_S_Allied_NearBridge_3",
			".*_Allied_Radio_.*",
		});

		if ( Map.ComplexMG42 )	//built
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Complex_Roof_MG42" );
		}
		if ( Map.CellarMG42 == 1 )	//built
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_MG42" );
		}
		if ( Map.CellarEntrance )	//intact
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_Entrance" );
		}

		Util.MapDebugPrint( "^5Bridge_Built" );

		if ( Map.garagedoor1 )	//intact
		{
			if ( Map.AlliedEngInComplex == 0 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					"PLANTMINE_Axis_CellarEntrance_.*",
					"PLANTMINE_Axis_NearBridge_.*",
					".*_Axis_NearBridge_2",
					".*_Axis_NearBridge_3",
					".*_Axis_NearBridge_7",
					"AMMOCAB_south_ammocabinet_1",
					"HEALTHCAB_south_healthcabinet_1",
				});

				if ( Map.ComplexMG42 )	//built
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						"MOUNTMG42_Complex_Roof_MG42",
						"REPAIRMG42_Complex_Roof_MG42",
					});
				}
				else	//destroyed
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Complex_Roof_MG42" );
				}
				if ( Map.CellarMG42 == 0 )	//destroyed
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Cellar_MG42" );
				}

				Util.MapDebugPrint( "^5Bridge_Built, Garagedoor intact, Allies are not in complex" );
			}
		}
		else	//destroyed
		{
			if ( Map.AlliedEngInComplex == 0 )	//Allied engs are not in complex
			{
				if ( Map.AlliedFlag == 1 )	//bunker is Allied
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						".*_Axis_Start_.*",
						".*_Axis_StartBack_.*",
						"BUILD_Generator",
					});

					SetAvailableMapGoals( TEAM.AXIS, true, {
						"PLANTMINE_Axis_CellarEntrance_.*",
						".*_Axis_NearBridge_.*",
						"AMMOCAB_south_ammocabinet_1",
						"HEALTHCAB_south_healthcabinet_1",
					});

					if ( Map.ComplexMG42 )	//built
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							"MOUNTMG42_Complex_Roof_MG42",
							"REPAIRMG42_Complex_Roof_MG42",
						});
					}
					else	//destroyed
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Complex_Roof_MG42" );
					}
					if ( Map.CellarMG42 == 0 )	//destroyed
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Cellar_MG42" );
					}

					Util.MapDebugPrint( "^5Bridge_Built, Garagedoor destroyed, Allies are not in complex, Bunker is Allied" );
				}
				else	//bunker is Axis
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						"PLANTMINE_Axis_CellarEntrance_.*",
						"PLANTMINE_Axis_NearBridge_.*",
						".*_Axis_NearBridge_2",
						".*_Axis_NearBridge_7",
						"AMMOCAB_south_ammocabinet_1",
						"HEALTHCAB_south_healthcabinet_1",
					});

					if ( Map.ComplexMG42 )	//built
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							"MOUNTMG42_Complex_Roof_MG42",
							"REPAIRMG42_Complex_Roof_MG42",
						});
					}
					else	//destroyed
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Complex_Roof_MG42" );
					}
					if ( Map.CellarMG42 == 0 )	//destroyed
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Cellar_MG42" );
					}

					Util.MapDebugPrint( "^5Bridge_Built, Garagedoor destroyed, Allies are not in complex, Bunker is Axis" );
				}
			}
		}
	},

	Bridge_Planted = function( trigger )
	{
		Map.Bridge_Dyno += 1;

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

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

	Bridge_Defused = function( trigger )
	{
		Map.Bridge_Dyno -= 1;

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

	Bridge_Destroyed = function( trigger )
	{
		Map.Bridge_Dyno = 0;
		Map.BridgeBuild = 0;

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

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

		SetAvailableMapGoals( TEAM.AXIS, true, {
			"PLANTMINE_Axis_Start_1.*",
			"PLANTMINE_Axis_NearBridge_.*",
		});

		if ( !Map.garagedoor1 )	//destroyed
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allied_NearBridge_.*" );

			SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Bridge" );
			SetGoalPriority( "BUILD_Bridge", 0.91, TEAM.ALLIES, CLASS.ENGINEER );
			yield();
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Bridge" );

			Util.MapDebugPrint( "^5Bridge_Destroyed, garage door destroyed" );
		}
		else	//intact
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Bridge" );

			Util.MapDebugPrint( "^5Bridge_Destroyed, garage door intact" );
		}

		if ( Map.AlliesPastRiver == 0 )	//Allies donīt cross river
		{
			if ( Map.AlliedFlag == 0 )	//Bunker is Axis
			{
				SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Axis_NearBridge_.*" );

				Util.MapDebugPrint( "^5Bridge_Destroyed, Allies donīt cross river, Bunker is Axis" );
			}

			if ( Map.AlliesInCanyon == 0 )
			{
				if ( Map.Footbridge == 0 )	//destroyed
				{
					SetAvailableMapGoals( TEAM.ALLIES, false, {
						"PLANT_Communications_Radio",
						"AMMOCAB_south_ammocabinet_1",
						"HEALTHCAB_south_healthcabinet_1",
						".*_Allied_Radio_.*",
						".*_Allied_NearCellarEntrance_.*",
					});

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

					if ( Map.Generator == 1 )	//built
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, {
							".*_Allied_NearFootBridge_.*",
							".*_Allied_NearCellarEntrance_.*",
							"BUILD_Footbridge",
						});
					}
					else
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"BUILD_Footbridge",
							".*_Allied_NearFootBridge_.*",
						});
					}

					if ( Map.CellarEntrance )	//intact
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_Entrance" );
					}
					if ( Map.ComplexMG42 )	//built
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
					}
					if ( Map.CellarMG42 == 1 )	//built
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
					}

					Util.MapDebugPrint( "^5Bridge_Destroyed, Allies donīt cross river, Allies are not in Canyon, Footbridge destroyed" );
				}
				else	//Footbridge built
				{
					if ( Map.Generator == 1 )	//built
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, {
							"PLANT_Communications_Radio",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							".*_Allied_Radio_.*",
						});

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

						if ( Map.CellarEntrance )	//intact
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_Entrance" );
						}
						if ( Map.ComplexMG42 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
						}
						if ( Map.CellarMG42 == 1 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
						}

						Util.MapDebugPrint( "^5Bridge_Destroyed, Allies donīt cross river, Allies are not in Canyon, Footbridge built, Generator built" );
					}
					else	//Generator destroyed
					{
						if ( Map.CellarEntrance )	//intact
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, {
								"PLANT_Communications_Radio",
								"AMMOCAB_south_ammocabinet_1",
								"HEALTHCAB_south_healthcabinet_1",
								".*_Allied_Radio_.*",
							});

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

							if ( Map.ComplexMG42 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
							}
							if ( Map.CellarMG42 == 1 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
							}

							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"PLANT_Cellar_Entrance",
								"ATTACK_Allied_NearCellarEntrance_.*",
							});

							Util.MapDebugPrint( "^5Bridge_Destroyed, Allies donīt cross river, Allies are not in Canyon, Footbridge built, Generator destroyed, Cellarentrance intact" );
						}
					}
				}
			}
			else	//Allies are in Canyon
			{
				if ( Map.Footbridge == 0 )	//destroyed
				{
					if ( Map.AlliedEngInCanyon == 0 )
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

						if ( Map.CellarEntrance )	//intact
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_Entrance" );
						}
						if ( Map.ComplexMG42 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
						}
						if ( Map.CellarMG42 == 1 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
						}
					}

					Util.MapDebugPrint( "^5Bridge_Destroyed, Allies donīt cross river, Allies are in Canyon, Footbridge destroyed, Allied engs are not in Canyon" );
				}
				else	//built
				{
					if ( Map.Generator == 1 )	//built
					{
						if ( Map.AlliedEngInCanyon == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

							if ( Map.CellarEntrance )	//intact
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_Entrance" );
							}
							if ( Map.ComplexMG42 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
							}
							if ( Map.CellarMG42 == 1 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
							}

							Util.MapDebugPrint( "^5Bridge_Destroyed, Allies donīt cross river, Allies are in Canyon, Footbridge built, Generator built, Allied engs are not in Canyon" );
						}
					}
				}
			}
		}
		else	//Allies cross river
		{
			if ( Map.AlliesInCanyon == 0 )
			{
				if ( Map.Footbridge == 0 )	//destroyed
				{
					if ( Map.AlliedEngPastRiver == 0 )
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

						if ( Map.CellarEntrance )	//intact
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_Entrance" );
						}

						Util.MapDebugPrint( "^5Bridge_Destroyed, Allies cross river, Allies are not in Canyon, Footbridge destroyed, Allied engs donīt cross river" );

						if ( Map.AlliedCovertPastRiver == 0 )
						{
							if ( Map.ComplexMG42 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
							}
							if ( Map.CellarMG42 == 1 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
							}

							Util.MapDebugPrint( "^5Bridge_Destroyed, Allies cross river, Allies are not in Canyon, Footbridge destroyed, Allied engs donīt cross river, Allied covertops donīt cross river" );
						}
					}
				}
				else
				{
					if ( Map.Generator == 1 )	//built
					{
						if ( Map.AlliedEngPastRiver == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

							if ( Map.CellarEntrance )	//intact
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_Entrance" );
							}

							Util.MapDebugPrint( "^5Bridge_Destroyed, Allies cross river, Allies are not in Canyon, Footbridge built, Generator built, Allied engs donīt cross river" );

							if ( Map.AlliedCovertPastRiver == 0 )
							{
								if ( Map.ComplexMG42 )	//built
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
								}
								if ( Map.CellarMG42 == 1 )	//built
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
								}

								Util.MapDebugPrint( "^5Bridge_Destroyed, Allies cross river, Allies are not in Canyon, Footbridge built, Generator built, Allied engs donīt cross river, Allied covertops donīt cross river" );
							}
						}
					}
				}
			}
			else
			{
				if ( Map.Footbridge == 0 )	//destroyed
				{
					if ( Map.AlliedEngInCanyon == 0 )
					{
						if ( Map.AlliedEngPastRiver == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

							if ( Map.CellarEntrance )	//intact
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_Entrance" );
							}

							Util.MapDebugPrint( "^5Bridge_Destroyed, Allies cross river, Allies are in Canyon, Footbridge destroyed, Allied engs are not in Canyon, Allied engs donīt cross river" );

							if ( Map.AlliedCovertPastRiver == 0 )
							{
								if ( Map.ComplexMG42 )	//built
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
								}
								if ( Map.CellarMG42 == 1 )	//built
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
								}

								Util.MapDebugPrint( "^5Bridge_Destroyed, Allies cross river, Allies are in Canyon, Footbridge destroyed, Allied engs are not in Canyon, Allied engs donīt cross river, Allied covertops donīt cross river" );
							}
						}
					}
				}
				else
				{
					if ( Map.Generator == 1 )	//built
					{
						if ( Map.AlliedEngInCanyon == 0 )
						{
							if ( Map.AlliedEngPastRiver == 0 )
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

								if ( Map.CellarEntrance )	//intact
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_Entrance" );
								}

								Util.MapDebugPrint( "^5Bridge_Destroyed, Allies cross river, Allies are in Canyon, Footbridge built, Generator built, Allied engs are not in Canyon, Allied engs donīt cross river" );

								if ( Map.AlliedCovertPastRiver == 0 )
								{
									if ( Map.ComplexMG42 )	//built
									{
										SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
									}
									if ( Map.CellarMG42 == 1 )	//built
									{
										SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
									}

									Util.MapDebugPrint( "^5Bridge_Destroyed, Allies cross river, Allies are in Canyon, Footbridge built, Generator built, Allied engs are not in Canyon, Allied engs donīt cross river, Allied covertops donīt cross river" );
								}
							}
						}
					}
				}
			}
		}

		if ( Map.AlliesPastRiver == 0 and Map.Generator == 1 and Map.AlliesInCanyon == 0 and Map.AlliedFlag == 0 )
		{
			if ( Map.AxisChangeSpawn == 1 )
			{
				Util.ChangeSpawn( TEAM.AXIS, 3 );
				Map.ReSpawn = 1;

				Map.AxisChangeSpawn = 0;

				SetAvailableMapGoals( TEAM.AXIS, false, {
					".*_Axis_Radio_.*",
					"AMMOCAB_south_ammocabinet_1",
					"HEALTHCAB_south_healthcabinet_1",
					"MOUNTMG42_Complex_Roof_MG42",
					"REPAIRMG42_Complex_Roof_MG42",
					"BUILD_Complex_Roof_MG42",
					"MOUNTMG42_Cellar_MG42",
					"REPAIRMG42_Cellar_MG42",
					"BUILD_Cellar_MG42",
					".*_Axis_NearBridge_.*",
					".*_Axis_NearFootBridge_.*",
					".*_Axis_CellarEntrance_.*",
				});

				SetAvailableMapGoals( TEAM.ALLIES, false, {
					".*_Allied_Radio_.*",
					"PLANT_Communications_Radio",
					"AMMOCAB_south_ammocabinet_1",
					"HEALTHCAB_south_healthcabinet_1",
					"PLANT_Complex_Roof_MG42",
					"PLANT_Cellar_MG42",
					"PLANT_Cellar_Entrance",
					".*_Allied_NearBridge_.*",
					".*_Allied_NearFootBridge_.*",
					".*_Allied_NearCellarEntrance_.*",
				});

				SetAvailableMapGoals( TEAM.AXIS, true, {
					".*_Axis_Start_.*",
					".*_Axis_StartBack_.*",
					"AMMOCAB_south_ammocabinet",
					"HEALTHCAB_south_healthcabinet",
				});

				if ( Map.garagedoor2 )
				{
					if ( Map.garagedoor1 )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
					}
					else
					{
						if ( Map.AxisChangeSpawn == 0 )
						{
							SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
						}
						else
						{
							if ( Map.ReSpawn == 1 )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
							}
						}
					}
				}

				if ( !Map.garagedoor1 )
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"PLANTMINE_Axis_Start_1.*",
						"SMOKEBOMB_Axis_Start_13",
						"AIRSTRIKE_Axis_Start_1",
						"AIRSTRIKE_Axis_Start_6",
						"ARTILLERY_S_Axis_Start_5",
						"ARTILLERY_S_Axis_Start_8",
						"CALLARTILLERY_Axis_Start_4",
						"CALLARTILLERY_Axis_Start_10",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"SMOKEBOMB_Axis_Start_25",
						"AIRSTRIKE_Axis_Start_28",
						"ARTILLERY_S_Axis_Start_27",
						"CALLARTILLERY_Axis_Start_26",
						".*_Axis_Start_7",
						".*_Axis_Start_9",
						".*_Axis_Start_10",
						".*_Axis_Start_11",
						".*_Axis_Start_12",
						".*_Axis_Start_14",
					});
				}

				if ( !Map.garagedoor2 )
				{
					if ( !Map.garagedoor1 or !Map.AxisDoor )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_GarageDoor2" );
					}
				}

				SetAvailableMapGoals( TEAM.ALLIES, true, {
					"CHECKPOINT_checkpoint",
					".*_Allied_Start_.*",
					".*_Allied_StartBack_.*",
					"BUILD_Bridge",
					"PLANT_Generator",
				});

				if ( Map.garagedoor1 )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Door" );
				}

				if ( Map.AxisDoor )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_Door" );
				}

				if ( Map.WindowMG42 == 0 )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Window_MG42" );
				}
				else
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"REPAIRMG42_Window_MG42",
						"MOUNTMG42_Window_MG42",
					});
				}

				if ( Map.CabinMG42 == 0 )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Cabin_MG42" );
				}
				else
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"REPAIRMG42_Cabin_MG42",
						"MOUNTMG42_Cabin_MG42",
					});
				}

				Util.MapDebugPrint( "^5Axis_Re-Captured_Garage" );
			}
			else
			{
				SetAvailableMapGoals( TEAM.AXIS, false, {
					".*_Axis_Radio_.*",
					"AMMOCAB_south_ammocabinet_1",
					"HEALTHCAB_south_healthcabinet_1",
					"MOUNTMG42_Complex_Roof_MG42",
					"REPAIRMG42_Complex_Roof_MG42",
					"BUILD_Complex_Roof_MG42",
					"MOUNTMG42_Cellar_MG42",
					"REPAIRMG42_Cellar_MG42",
					"BUILD_Cellar_MG42",
					".*_Axis_NearBridge_.*",
					".*_Axis_NearFootBridge_.*",
					".*_Axis_CellarEntrance_.*",
				});

				SetAvailableMapGoals( TEAM.ALLIES, false, {
					".*_Allied_Radio_.*",
					"PLANT_Communications_Radio",
					"AMMOCAB_south_ammocabinet_1",
					"HEALTHCAB_south_healthcabinet_1",
					"PLANT_Complex_Roof_MG42",
					"PLANT_Cellar_MG42",
					"PLANT_Cellar_Entrance",
					".*_Allied_NearBridge_.*",
					".*_Allied_NearFootBridge_.*",
					".*_Allied_NearCellarEntrance_.*",
				});

				SetAvailableMapGoals( TEAM.AXIS, true, {
					".*_Axis_Start_.*",
					".*_Axis_StartBack_.*",
					"AMMOCAB_south_ammocabinet",
					"HEALTHCAB_south_healthcabinet",
				});

				if ( Map.garagedoor2 )
				{
					if ( Map.garagedoor1 )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
					}
					else
					{
						if ( Map.AxisChangeSpawn == 0 )
						{
							SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
						}
						else
						{
							if ( Map.ReSpawn == 1 )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
							}
						}
					}
				}

				if ( !Map.garagedoor1 )
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"PLANTMINE_Axis_Start_1.*",
						"SMOKEBOMB_Axis_Start_13",
						"AIRSTRIKE_Axis_Start_1",
						"AIRSTRIKE_Axis_Start_6",
						"ARTILLERY_S_Axis_Start_5",
						"ARTILLERY_S_Axis_Start_8",
						"CALLARTILLERY_Axis_Start_4",
						"CALLARTILLERY_Axis_Start_10",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"SMOKEBOMB_Axis_Start_25",
						"AIRSTRIKE_Axis_Start_28",
						"ARTILLERY_S_Axis_Start_27",
						"CALLARTILLERY_Axis_Start_26",
						".*_Axis_Start_7",
						".*_Axis_Start_9",
						".*_Axis_Start_10",
						".*_Axis_Start_11",
						".*_Axis_Start_12",
						".*_Axis_Start_14",
					});
				}

				if ( !Map.garagedoor2 )
				{
					if ( !Map.garagedoor1 or !Map.AxisDoor )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_GarageDoor2" );
					}
				}

				SetAvailableMapGoals( TEAM.ALLIES, true, {
					"CHECKPOINT_checkpoint",
					".*_Allied_Start_.*",
					".*_Allied_StartBack_.*",
					"BUILD_Bridge",
					"PLANT_Generator",
				});

				if ( Map.garagedoor1 )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Door" );

					if ( Map.AxisDoor )
					{
						if ( Map.Generator == 1 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Generator" );
						}
					}
				}

				if ( Map.AxisDoor )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_Door" );
				}

				if ( Map.WindowMG42 == 0 )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Window_MG42" );
				}
				else
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"REPAIRMG42_Window_MG42",
						"MOUNTMG42_Window_MG42",
					});
				}

				if ( Map.CabinMG42 == 0 )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Cabin_MG42" );
				}
				else
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"REPAIRMG42_Cabin_MG42",
						"MOUNTMG42_Cabin_MG42",
					});
				}

				Util.MapDebugPrint( "^5BBBB" );
			}
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_Complex_Roof_MG42" );

			if ( Map.AlliesInComplex == 0 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_NearBridge_.*" );
			}

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

	Generator_Built = function( trigger )
	{

		Map.Generator = 1;

		SetAvailableMapGoals( TEAM.AXIS, false, {
			"BUILD_Generator",
			"DEFEND_Axis_InfrontofWall_.*",
			"ROUTE_Wall",
		});

		Util.MapDebugPrint( "^5Generator_Built" );

		if ( !Map.garagedoor1 or !Map.AxisDoor or Map.AlliedFlag == 1 )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Generator" );
		}

		if ( Map.BridgeBuild == 0 )	//Bridge destroyed
		{
			if ( Map.AlliesInCanyon == 0 )	//Allies are not in canyon
			{
				SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Footbridge" );

				Util.MapDebugPrint( "^5Generator_Built, Bridge destroyed, Allies are not in Canyon" );

				if ( Map.AlliesPastRiver == 0 )	//Allies donīt cross river
				{
					SetAvailableMapGoals( TEAM.ALLIES, false, {
						".*_Allied_Radio_.*",
						"PLANT_Communications_Radio",
						"ATTACK_Allied_NearCellarEntrance_.*",
						".*_Allied_NearFootBridge_.*",
					});

					if ( Map.AlliedFlag == 0 )	//Bunker is Axis
					{
						SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Axis_NearBridge_.*" );

						Util.MapDebugPrint( "^5Generator built, Bridge destroyed, Allies are not in canyon, Allies donīt cross river, Bunker is Axis" );
					}

					if ( Map.CellarEntrance )	//intact
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_Entrance" );
					}

					if ( Map.ComplexMG42 )	//built
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
					}
					if ( Map.CellarMG42 == 1 )	//built
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
					}
					if ( Map.Footbridge == 0 )	//destroyed
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Footbridge" );
					}

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

					Util.MapDebugPrint( "^5Generator_Built, Bridge destroyed, Allies are not in Canyon, Allies donīt cross river" );
				}
				else	//Allies cross river
				{
					if ( Map.AlliedEngPastRiver == 0 )	//Allied engs donīt cross river
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

						if ( Map.CellarEntrance )	//intact
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_Entrance" );

							SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );
						}
						else	//Cellarentrance destroyed
						{
							SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );
							SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_NearFootBridge_2" );
						}

						Util.MapDebugPrint( "^5Generator_Built, Bridge destroyed, Allies are not in Canyon, Allies cross river, Allied engs donīt cross river" );

						if ( Map.AlliedCovertPastRiver == 0 )	//Allied covertops donīt cross river
						{
							if ( Map.ComplexMG42 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
							}
							if ( Map.CellarMG42 == 1 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
							}

							Util.MapDebugPrint( "^5Generator_Built, Bridge destroyed, Allies are not in Canyon, Allies cross river, Allied engs donīt cross river, Allied covertops donīt cross river" );
						}
					}
				}
			}
			else	//Allies are in canyon
			{
				if ( Map.AlliedEngInCanyon == 0 )	//Allied engs are not in canyon
				{
					if ( Map.Footbridge == 0 )	//Footbridge destroyed
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, {
							"BUILD_Footbridge",
							".*_Allied_NearFootBridge_.*",
						});

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

						Util.MapDebugPrint( "^5Generator_Built, Bridge destroyed, Allies are in Canyon, Allied engs are not in Canyon, Footbridge destroyed" );
					}

					if ( Map.AlliesPastRiver == 0 )	//Allies donīt cross river
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, {
							".*_Allied_Radio_.*",
							"PLANT_Communications_Radio",
						});

						if ( Map.AlliedFlag == 0 )	//Bunker is Axis
						{
							SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Axis_NearBridge_.*" );

							Util.MapDebugPrint( "^5Generator built, Bridge destroyed, Allies are in canyon, Allies donīt cross river, Bunker is Axis" );
						}

						if ( Map.ComplexMG42 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
						}
						if ( Map.CellarMG42 == 1 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
						}
						if ( Map.CellarEntrance )	//intact
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, {
								"PLANT_Cellar_Entrance",
								".*_Allied_NearCellarEntrance_.*",
							});
						}
						else	//Cellarentrance destroyed
						{
							SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );
							SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_NearFootBridge_2" );
						}

						Util.MapDebugPrint( "^5Generator_Built, Bridge destroyed, Allies are in Canyon, Allied engs are not in Canyon, Allies donīt cross river" );
					}
					else	//Allies cross river
					{
						if ( Map.AlliedEngPastRiver == 0 )	//Allied engs donīt cross river
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

							if ( Map.Footbridge == 0 )	//Footbridge destroyed
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, {
									"BUILD_Footbridge",
									".*_Allied_NearFootBridge_.*",
								});

								SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );
							}
							if ( Map.CellarEntrance )	//intact
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, {
									"PLANT_Cellar_Entrance",
									".*_Allied_NearCellarEntrance_.*",
								});

								SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );
							}
							else	//Cellarentrance destroyed
							{
								SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );
								SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_NearFootBridge_2" );
							}

							Util.MapDebugPrint( "^5Generator_Built, Bridge destroyed, Allies are in Canyon, Allied engs are not in Canyon, Allies cross river, Allied engs donīt cross river" );

							if ( Map.AlliedCovertPastRiver == 0 )	//Allied covertops donīt cross river
							{
								if ( Map.ComplexMG42 )	//built
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
								}
								if ( Map.CellarMG42 == 1 )	//built
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
								}

								Util.MapDebugPrint( "^5Generator_Built, Bridge destroyed, Allies are in Canyon, Allied engs are not in Canyon, Allies cross river, Allied engs donīt cross river, Allied covertops donīt cross river" );
							}
						}
					}
				}
			}
		}
		else	//Bridge built
		{
			if ( Map.AlliesInCanyon == 0 )	//Allies are not in canyon
			{
				SetAvailableMapGoals( TEAM.ALLIES, false, {
					"BUILD_Footbridge",
					".*_Allied_NearFootBridge_.*",
				});

				SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );
				SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_NearFootBridge_2" );

				Util.MapDebugPrint( "^5Generator_Built, Bridge built, Allies are not in Canyon" );

				if ( Map.CellarEntrance )	//intact
				{
					SetAvailableMapGoals( TEAM.ALLIES, false, ".*_Allied_NearCellarEntrance_.*" );

					SetAvailableMapGoals( TEAM.ALLIES, true, {
						".*_Allied_NearCellarEntrance_2",
						".*_Allied_NearCellarEntrance_3",
					});

					Util.MapDebugPrint( "^5Generator_Built, Bridge built, Allies are not in Canyon, Cellarentrance intact" );
				}
			}
			else	//Allies are in canyon
			{
				if ( Map.AlliedEngInCanyon == 0 )	//Allied engs are not in canyon
				{
					if ( Map.Footbridge == 0 )	//Footbridge destroyed
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Footbridge" );
					}

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

					SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );
					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*_Axis_NearFootBridge_1",
						".*_Axis_NearFootBridge_2",
					});

					Util.MapDebugPrint( "^5Generator_Built, Bridge built, Allies are in Canyon, Allied engs are not in Canyon" );

					if ( Map.CellarEntrance )	//intact
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, ".*_Allied_NearCellarEntrance_.*" );

						SetAvailableMapGoals( TEAM.ALLIES, true, {
							".*_Allied_NearCellarEntrance_2",
							".*_Allied_NearCellarEntrance_3",
						});

						Util.MapDebugPrint( "^5Generator_Built, Bridge built, Allies are in Canyon, Allied engs are not in Canyon, Cellarentrance intact" );
					}
				}
			}
		}

		if ( Map.AlliesPastRiver == 0 and Map.BridgeBuild == 0 and Map.AlliesInCanyon == 0 and Map.AlliedFlag == 0 )
		{
			if ( Map.AxisChangeSpawn == 1 )
			{
				Util.ChangeSpawn( TEAM.AXIS, 3 );
				Map.ReSpawn = 1;

				Map.AxisChangeSpawn = 0;

				SetAvailableMapGoals( TEAM.AXIS, false, {
					".*_Axis_Radio_.*",
					"AMMOCAB_south_ammocabinet_1",
					"HEALTHCAB_south_healthcabinet_1",
					"MOUNTMG42_Complex_Roof_MG42",
					"REPAIRMG42_Complex_Roof_MG42",
					"BUILD_Complex_Roof_MG42",
					"MOUNTMG42_Cellar_MG42",
					"REPAIRMG42_Cellar_MG42",
					"BUILD_Cellar_MG42",
					".*_Axis_NearBridge_.*",
					".*_Axis_NearFootBridge_.*",
					".*_Axis_CellarEntrance_.*",
				});

				SetAvailableMapGoals( TEAM.ALLIES, false, {
					".*_Allied_Radio_.*",
					"PLANT_Communications_Radio",
					"AMMOCAB_south_ammocabinet_1",
					"HEALTHCAB_south_healthcabinet_1",
					"PLANT_Complex_Roof_MG42",
					"PLANT_Cellar_MG42",
					"PLANT_Cellar_Entrance",
					".*_Allied_NearBridge_.*",
					".*_Allied_NearFootBridge_.*",
					".*_Allied_NearCellarEntrance_.*",
				});

				SetAvailableMapGoals( TEAM.AXIS, true, {
					".*_Axis_Start_.*",
					".*_Axis_StartBack_.*",
					"AMMOCAB_south_ammocabinet",
					"HEALTHCAB_south_healthcabinet",
				});

				if ( Map.garagedoor2 )
				{
					if ( Map.garagedoor1 )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
					}
					else
					{
						if ( Map.AxisChangeSpawn == 0 )
						{
							SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
						}
						else
						{
							if ( Map.ReSpawn == 1 )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
							}
						}
					}
				}

				if ( !Map.garagedoor1 )
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"PLANTMINE_Axis_Start_1.*",
						"SMOKEBOMB_Axis_Start_13",
						"AIRSTRIKE_Axis_Start_1",
						"AIRSTRIKE_Axis_Start_6",
						"ARTILLERY_S_Axis_Start_5",
						"ARTILLERY_S_Axis_Start_8",
						"CALLARTILLERY_Axis_Start_4",
						"CALLARTILLERY_Axis_Start_10",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"SMOKEBOMB_Axis_Start_25",
						"AIRSTRIKE_Axis_Start_28",
						"ARTILLERY_S_Axis_Start_27",
						"CALLARTILLERY_Axis_Start_26",
						".*_Axis_Start_7",
						".*_Axis_Start_9",
						".*_Axis_Start_10",
						".*_Axis_Start_11",
						".*_Axis_Start_12",
						".*_Axis_Start_14",
					});
				}

				if ( !Map.garagedoor2 )
				{
					if ( !Map.garagedoor1 or !Map.AxisDoor )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_GarageDoor2" );
					}
				}

				SetAvailableMapGoals( TEAM.ALLIES, true, {
					"CHECKPOINT_checkpoint",
					".*_Allied_Start_.*",
					".*_Allied_StartBack_.*",
					"BUILD_Bridge",
					"PLANT_Generator",
				});

				if ( Map.garagedoor1 )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Door" );
				}

				if ( Map.AxisDoor )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_Door" );
				}

				if ( Map.WindowMG42 == 0 )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Window_MG42" );
				}
				else
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"REPAIRMG42_Window_MG42",
						"MOUNTMG42_Window_MG42",
					});
				}

				if ( Map.CabinMG42 == 0 )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Cabin_MG42" );
				}
				else
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"REPAIRMG42_Cabin_MG42",
						"MOUNTMG42_Cabin_MG42",
					});
				}

				Util.MapDebugPrint( "^5Axis_Re-Captured_Garage" );
			}
			else
			{
				SetAvailableMapGoals( TEAM.AXIS, false, {
					".*_Axis_Radio_.*",
					"AMMOCAB_south_ammocabinet_1",
					"HEALTHCAB_south_healthcabinet_1",
					"MOUNTMG42_Complex_Roof_MG42",
					"REPAIRMG42_Complex_Roof_MG42",
					"BUILD_Complex_Roof_MG42",
					"MOUNTMG42_Cellar_MG42",
					"REPAIRMG42_Cellar_MG42",
					"BUILD_Cellar_MG42",
					".*_Axis_NearBridge_.*",
					".*_Axis_NearFootBridge_.*",
					".*_Axis_CellarEntrance_.*",
				});

				SetAvailableMapGoals( TEAM.ALLIES, false, {
					".*_Allied_Radio_.*",
					"PLANT_Communications_Radio",
					"AMMOCAB_south_ammocabinet_1",
					"HEALTHCAB_south_healthcabinet_1",
					"PLANT_Complex_Roof_MG42",
					"PLANT_Cellar_MG42",
					"PLANT_Cellar_Entrance",
					".*_Allied_NearBridge_.*",
					".*_Allied_NearFootBridge_.*",
					".*_Allied_NearCellarEntrance_.*",
				});

				SetAvailableMapGoals( TEAM.AXIS, true, {
					".*_Axis_Start_.*",
					".*_Axis_StartBack_.*",
					"AMMOCAB_south_ammocabinet",
					"HEALTHCAB_south_healthcabinet",
				});

				if ( Map.garagedoor2 )
				{
					if ( Map.garagedoor1 )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
					}
					else
					{
						if ( Map.AxisChangeSpawn == 0 )
						{
							SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
						}
						else
						{
							if ( Map.ReSpawn == 1 )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
							}
						}
					}
				}

				if ( !Map.garagedoor1 )
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"PLANTMINE_Axis_Start_1.*",
						"SMOKEBOMB_Axis_Start_13",
						"AIRSTRIKE_Axis_Start_1",
						"AIRSTRIKE_Axis_Start_6",
						"ARTILLERY_S_Axis_Start_5",
						"ARTILLERY_S_Axis_Start_8",
						"CALLARTILLERY_Axis_Start_4",
						"CALLARTILLERY_Axis_Start_10",
					});
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, false, {
						"SMOKEBOMB_Axis_Start_25",
						"AIRSTRIKE_Axis_Start_28",
						"ARTILLERY_S_Axis_Start_27",
						"CALLARTILLERY_Axis_Start_26",
						".*_Axis_Start_7",
						".*_Axis_Start_9",
						".*_Axis_Start_10",
						".*_Axis_Start_11",
						".*_Axis_Start_12",
						".*_Axis_Start_14",
					});
				}

				if ( !Map.garagedoor2 )
				{
					if ( !Map.garagedoor1 or !Map.AxisDoor )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_GarageDoor2" );
					}
				}

				SetAvailableMapGoals( TEAM.ALLIES, true, {
					"CHECKPOINT_checkpoint",
					".*_Allied_Start_.*",
					".*_Allied_StartBack_.*",
					"BUILD_Bridge",
					"PLANT_Generator",
				});

				if ( Map.garagedoor1 )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Door" );

					if ( Map.AxisDoor )
					{
						if ( Map.Generator == 1 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Generator" );
						}
					}
				}

				if ( Map.AxisDoor )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_Door" );
				}

				if ( Map.WindowMG42 == 0 )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Window_MG42" );
				}
				else
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"REPAIRMG42_Window_MG42",
						"MOUNTMG42_Window_MG42",
					});
				}

				if ( Map.CabinMG42 == 0 )
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Cabin_MG42" );
				}
				else
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"REPAIRMG42_Cabin_MG42",
						"MOUNTMG42_Cabin_MG42",
					});
				}

				Util.MapDebugPrint( "^5CCCC" );
			}
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_Complex_Roof_MG42" );

			if ( Map.AlliesInComplex == 0 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_NearBridge_.*" );
			}

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

	Generator_Planted = function( trigger )
	{
		Map.Generator_Dyno += 1;

		if ( Map.AlliedFlag == 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "DEFUSE_Generator_.*" );
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "DEFUSE_Generator_.*" );
		}

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

	Generator_Defused = function( trigger )
	{
		Map.Generator_Dyno -= 1;

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

	Generator_Destroyed = function( trigger )
	{
		Map.Generator_Dyno = 0;
		Map.Generator = 0;

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

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

		SetGoalPriority( "BUILD_Footbridge", 0.91, TEAM.ALLIES, CLASS.ENGINEER );

		Util.MapDebugPrint( "^5Generator_Destroyed" );

		if ( Map.AlliesInCanyon == 0 )	//Allies are not in Canyon
		{
			if ( Map.Footbridge == 1 )	//built
			{
				if ( Map.AlliedFlag == 0 )	//bunker is Axis
				{
					if ( Map.CellarEntrance )	//intact
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*_Axis_NearFootBridge_3",
							".*_Axis_NearFootBridge_4",
							"DEFEND_Axis_InfrontofWall_.*",
							"PLANTMINE_Axis_CellarEntrance_.*",
						});

						Util.MapDebugPrint( "^5Generator destroyed, Allies are not in canyon, Footbridge built, Bunker is Axis, Cellarentrance intact" );
					}
					else	//destroyed
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*_Axis_NearFootBridge_.*",
							"DEFEND_Axis_InfrontofWall_1",
							"DEFEND_Axis_InfrontofWall_2",
							"PLANTMINE_Axis_CellarEntrance_.*",
						});

						Util.MapDebugPrint( "^5Generator destroyed, Allies are not in canyon, Footbridge built, Bunker is Axis, Cellarentrance destroyed" );
					}
				}
				else	//bunker is Allied
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						"DEFEND_Axis_InfrontofWall_1",
						"DEFEND_Axis_InfrontofWall_2",
						".*_Axis_NearFootBridge_3",
						".*_Axis_NearFootBridge_4",
						".*_Axis_NearFootBridge_5",
						".*_Axis_NearFootBridge_6",
						"PLANTMINE_Axis_CellarEntrance_.*",
					});

					Util.MapDebugPrint( "^5Generator destroyed, Allies are not in canyon, Footbridge built, Bunker is Allied" );
				}
			}
			else	//Footbridge destroyed
			{
				if ( Map.AlliedFlag == 0 )	//bunker is Axis
				{
					SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );

					SetAvailableMapGoals( TEAM.AXIS, true, {
						"DEFEND_Axis_InfrontofWall_.*",
						"PLANTMINE_Axis_CellarEntrance_.*",
					});

					Util.MapDebugPrint( "^5Generator destroyed, Allies are not in canyon, Footbridge destroyed, Bunker is Axis" );
				}
				else	//bunker is Allied
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						"DEFEND_Axis_InfrontofWall_1",
						"DEFEND_Axis_InfrontofWall_2",
						".*_Axis_NearFootBridge_3",
						".*_Axis_NearFootBridge_4",
						".*_Axis_NearFootBridge_5",
						".*_Axis_NearFootBridge_6",
						"PLANTMINE_Axis_CellarEntrance_.*",
					});

					Util.MapDebugPrint( "^5Generator destroyed, Allies are not in canyon, Footbridge destroyed, Bunker is Allied" );
				}
			}
		}
		else	//Allies are in Canyon
		{
			if ( Map.AlliedEngInCanyon == 0 )	//Allied engs are not in canyon
			{
				if ( Map.Footbridge == 1 )	//built
				{
					if ( Map.AlliedFlag == 0 )	//bunker is Axis
					{
						if ( Map.CellarEntrance )	//intact
						{
							SetAvailableMapGoals( TEAM.AXIS, true, {
								".*_Axis_NearFootBridge_1",
								".*_Axis_NearFootBridge_3",
								"DEFEND_Axis_InfrontofWall_.*",
								"PLANTMINE_Axis_CellarEntrance_.*",
							});

							Util.MapDebugPrint( "^5Generator destroyed, Allies are in canyon, Allied engs are not in canyon, Footbridge built, Bunker is Axis, Cellarentrance intact" );
						}
						else	//destroyed
						{
							SetAvailableMapGoals( TEAM.AXIS, true, {
								".*_Axis_NearFootBridge_.*",
								"DEFEND_Axis_InfrontofWall_1",
								"DEFEND_Axis_InfrontofWall_2",
								"PLANTMINE_Axis_CellarEntrance_.*",
							});

							Util.MapDebugPrint( "^5Generator destroyed, Allies are in canyon, Allied engs are not in canyon, Footbridge built, Bunker is Axis, Cellarentrance destroyed" );
						}
					}
					else	//bunker is Allied
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							"DEFEND_Axis_InfrontofWall_1",
							"DEFEND_Axis_InfrontofWall_2",
							".*_Axis_NearFootBridge_1",
							".*_Axis_NearFootBridge_3",
							".*_Axis_NearFootBridge_5",
							".*_Axis_NearFootBridge_6",
							"PLANTMINE_Axis_CellarEntrance_.*",
						});

						Util.MapDebugPrint( "^5Generator destroyed, Allies are in canyon, Allied engs are not in canyon, Footbridge built, Bunker is Allied" );
					}
				}
				else	//Footbridge destroyed
				{
					if ( Map.AlliedFlag == 0 )	//bunker is Axis
					{
						SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );

						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*_Axis_NearFootBridge_3",
							"DEFEND_Axis_InfrontofWall_.*",
							"PLANTMINE_Axis_CellarEntrance_.*",
						});

						Util.MapDebugPrint( "^5Generator destroyed, Allies are in canyon, Allied engs are not in canyon, Footbridge destroyed, Bunker is Axis" );
					}
					else	//bunker is Allied
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							"DEFEND_Axis_InfrontofWall_1",
							"DEFEND_Axis_InfrontofWall_2",
							".*_Axis_NearFootBridge_3",
							".*_Axis_NearFootBridge_4",
							".*_Axis_NearFootBridge_5",
							".*_Axis_NearFootBridge_6",
							"PLANTMINE_Axis_CellarEntrance_.*",
						});

						Util.MapDebugPrint( "^5Generator destroyed, Allies are in canyon, Allied engs are not in canyon, Footbridge destroyed, Bunker is Allied" );
					}
				}
			}
		}

		sleep(23);

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

		if ( Map.Footbridge == 0 )	//destroyed
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, {
				"BUILD_Footbridge",
				".*_Allied_NearFootBridge_.*",
			});

			Util.MapDebugPrint( "^5Generator_Destroyed, Footbridge destroyed" );
		}
		else	//Footbridge built
		{
			if ( Map.CellarEntrance )	//intact
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allied_NearCellarEntrance_.*" );

				SetGoalPriority( "PLANT_Cellar_Entrance", 0.92, TEAM.ALLIES, CLASS.ENGINEER );

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

				Util.MapDebugPrint( "^5Generator_Destroyed, Footbridge built, Cellarentrance intact" );
			}
			else	//Cellarentrance destroyed
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, {
					"AMMOCAB_south_ammocabinet_1",
					"HEALTHCAB_south_healthcabinet_1",
					".*_Allied_Radio_.*",
					"PLANT_Communications_Radio",
				});

				if ( Map.ComplexMG42 )	//built
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Complex_Roof_MG42" );
				}
				if ( Map.CellarMG42 == 1 )	//built
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_MG42" );
				}

				Util.MapDebugPrint( "^5Generator_Destroyed, Footbridge built, Cellarentrance destroyed" );
			}
		}
	},

	Footbridge_Built = function( trigger )
	{

		Map.Footbridge = 1;

		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"BUILD_Footbridge",
			".*_Allied_NearFootBridge_.*",
		});

		SetAvailableMapGoals( TEAM.AXIS, true, {
			"PLANT_Footbridge",
			"ROUTE_Footbridge",
		});

		Util.MapDebugPrint( "^5Footbridge_Built" );

		if ( Map.AlliesInCanyon == 0 )	//Allies are not in Canyon
		{
			if ( Map.Generator == 0 )	//Generator destroyed
			{
				if ( Map.AlliedFlag == 0 )	//bunker is Axis
				{
					if ( Map.CellarEntrance )	//intact
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*_Axis_NearFootBridge_3",
							".*_Axis_NearFootBridge_4",
							"DEFEND_Axis_InfrontofWall_.*",
							"PLANTMINE_Axis_CellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allied_NearCellarEntrance_.*" );
						SetGoalPriority( "PLANT_Cellar_Entrance", 0.92, TEAM.ALLIES, CLASS.ENGINEER );
						SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_Entrance" );

						Util.MapDebugPrint( "^5Footbridge built, Allies are not in canyon, Generator destroyed, Bunker is Axis, Cellarentrance intact" );
					}
					else	//Cellarentrance destroyed
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*_Axis_NearFootBridge_.*",
							"DEFEND_Axis_InfrontofWall_1",
							"DEFEND_Axis_InfrontofWall_2",
							"PLANTMINE_Axis_CellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"PLANT_Communications_Radio",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							".*_Allied_Radio_.*",
						});

						if ( Map.ComplexMG42 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Complex_Roof_MG42" );
						}
						if ( Map.CellarMG42 == 1 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_MG42" );
						}

						Util.MapDebugPrint( "^5Footbridge built, Allies are not in canyon, Generator destroyed, Bunker is Axis, Cellarentrance destroyed" );
					}
				}
				else	//bunker is Allied
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						"DEFEND_Axis_InfrontofWall_1",
						"DEFEND_Axis_InfrontofWall_2",
						".*_Axis_NearFootBridge_.*",
						"PLANTMINE_Axis_CellarEntrance_.*",
					});

					Util.MapDebugPrint( "^5Footbridge built, Allies are not in canyon, Generator destroyed, Bunker is Allied" );

					if ( Map.CellarEntrance )	//intact
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allied_NearCellarEntrance_.*" );
						SetGoalPriority( "PLANT_Cellar_Entrance", 0.92, TEAM.ALLIES, CLASS.ENGINEER );
						SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_Entrance" );

						Util.MapDebugPrint( "^5Footbridge built, Allies are not in canyon, Generator destroyed, Bunker is Allied, Cellarentrance intact" );
					}
					else	//Cellarentrance destroyed
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"PLANT_Communications_Radio",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							".*_Allied_Radio_.*",
						});

						if ( Map.ComplexMG42 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Complex_Roof_MG42" );
						}
						if ( Map.CellarMG42 == 1 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_MG42" );
						}

						Util.MapDebugPrint( "^5Footbridge built, Allies are not in canyon, Generator destroyed, Bunker is Allied, Cellarentrance destroyed" );
					}
				}
			}
			else	//Generator built
			{
				if ( Map.CellarEntrance )	//intact
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*_Axis_NearFootBridge_1",
						".*_Axis_NearFootBridge_2",
						".*_Axis_NearFootBridge_3",
						"PLANTMINE_Axis_CellarEntrance_.*",
					});

					SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allied_NearCellarEntrance_.*" );
					SetGoalPriority( "PLANT_Cellar_Entrance", 0.92, TEAM.ALLIES, CLASS.ENGINEER );
					SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_Entrance" );

					Util.MapDebugPrint( "^5Footbridge built, Allies are not in canyon, Generator built, Cellarentrance intact" );

					sleep(15);	//waiting if allied eng enter into canyon

					if ( Map.AlliesPastRiver == 0 and Map.BridgeBuild == 0 and Map.AlliedEngInCanyon == 0 and Map.Generator == 1 and Map.CellarEntrance )
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, {
							"PLANT_Cellar_Entrance",
							".*_Allied_NearCellarEntrance_.*",
						});

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

						Util.MapDebugPrint( "^5DFootbridge_Built, Allies donīt cross river, Bridge destroyed, Allied engs are not in canyon, Generator built, Cellarentrance intact" );
					}
				}
				else	//cellarentrance destroyed
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*_Axis_NearFootBridge_1",
						".*_Axis_NearFootBridge_2",
						".*_Axis_NearFootBridge_3",
						"PLANTMINE_Axis_CellarEntrance_.*",
					});

					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"PLANT_Communications_Radio",
						"AMMOCAB_south_ammocabinet_1",
						"HEALTHCAB_south_healthcabinet_1",
						".*_Allied_Radio_.*",
					});

					if ( Map.ComplexMG42 )	//built
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Complex_Roof_MG42" );
					}
					if ( Map.CellarMG42 == 1 )	//built
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_MG42" );
					}

					Util.MapDebugPrint( "^5Footbridge built, Allies are not in canyon, Generator built, Cellarentrance destroyed" );

					sleep(15);	//waiting if allied eng enter into canyon

					if ( Map.AlliesPastRiver == 0 and Map.BridgeBuild == 0 and Map.AlliedEngInCanyon == 0 and Map.Generator == 1 )
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

						if ( Map.ComplexMG42 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
						}
						if ( Map.CellarMG42 == 1 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
						}

						Util.MapDebugPrint( "^5DFootbridge_Built, Allies donīt cross river, Bridge destroyed, Allied engs are not in canyon, Generator built, Cellarentrance destroyed" );

						if ( Map.AlliesInCanyon == 0 )	//Allies are not in canyon
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, {
								"AMMOCAB_south_ammocabinet_1",
								"HEALTHCAB_south_healthcabinet_1",
								".*_Allied_Radio_.*",
							});

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

							Util.MapDebugPrint( "^5DFootbridge_Built, Allies donīt cross river, Bridge destroyed, Allies are not in canyon, Generator built, Cellarentrance destroyed" );
						}
					}
				}
			}
		}
		else	//Allies are in Canyon
		{
			if ( Map.AlliedEngInCanyon == 0 )	//Allied engs are not in canyon
			{
				if ( Map.Generator == 0 )	//Generator destroyed
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*_Axis_NearFootBridge_.*",
						"DEFEND_Axis_InfrontofWall_1",
						"DEFEND_Axis_InfrontofWall_2",
						"PLANTMINE_Axis_CellarEntrance_.*",
					});

					Util.MapDebugPrint( "^5Footbridge built, Allies are in canyon, Allied engs are not in canyon, Generator destroyed, Bunker is Axis" );

					if ( Map.CellarEntrance )	//intact
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allied_NearCellarEntrance_.*" );
						SetGoalPriority( "PLANT_Cellar_Entrance", 0.92, TEAM.ALLIES, CLASS.ENGINEER );
						SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_Entrance" );

						Util.MapDebugPrint( "^5Footbridge built, Allies are in canyon, Allied engs are not in canyon, Generator destroyed, Bunker is Axis, Cellarentrance intact" );
					}
					else	//Cellarentrance destroyed
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"PLANT_Communications_Radio",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							".*_Allied_Radio_.*",
						});

						if ( Map.ComplexMG42 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Complex_Roof_MG42" );
						}
						if ( Map.CellarMG42 == 1 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_MG42" );
						}

						Util.MapDebugPrint( "^5Footbridge built, Allies are in canyon, Allied engs are not in canyon, Generator destroyed, Bunker is Axis, Cellarentrance destroyed" );
					}
				}
				else	//Generator built
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*_Axis_NearFootBridge_1",
						".*_Axis_NearFootBridge_2",
						".*_Axis_NearFootBridge_3",
						"PLANTMINE_Axis_CellarEntrance_.*",
					});

					Util.MapDebugPrint( "^5Footbridge built, Allies are in canyon, Allied engs are not in canyon, Generator built" );

					if ( Map.CellarEntrance )	//intact
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allied_NearCellarEntrance_.*" );
						SetGoalPriority( "PLANT_Cellar_Entrance", 0.92, TEAM.ALLIES, CLASS.ENGINEER );
						SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_Entrance" );

						Util.MapDebugPrint( "^5Footbridge built, Allies are in canyon, Allied engs are not in canyon, Generator built, Cellarentrance intact" );

						sleep(15);	//waiting if allied eng enter into canyon

						if ( Map.AlliesPastRiver == 0 and Map.BridgeBuild == 0 and Map.AlliedEngInCanyon == 0 and Map.Generator == 1 and Map.CellarEntrance )
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, {
								"PLANT_Cellar_Entrance",
								".*_Allied_NearCellarEntrance_.*",
							});

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

							Util.MapDebugPrint( "^5EFootbridge_Built, Allies donīt cross river, Bridge destroyed, Allied engs are not in canyon, Generator built, Cellarentrance intact" );
						}
					}
					else	//cellarentrance destroyed
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*_Axis_NearFootBridge_1",
							".*_Axis_NearFootBridge_2",
							".*_Axis_NearFootBridge_3",
							"PLANTMINE_Axis_CellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"PLANT_Communications_Radio",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							".*_Allied_Radio_.*",
						});

						if ( Map.ComplexMG42 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Complex_Roof_MG42" );
						}
						if ( Map.CellarMG42 == 1 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_MG42" );
						}

						Util.MapDebugPrint( "^5Footbridge built, Allies are in canyon, Allied engs are not in canyon, Generator built, Cellarentrance destroyed" );

						sleep(15);	//waiting if allied eng enter into canyon

						if ( Map.AlliesPastRiver == 0 and Map.BridgeBuild == 0 and Map.AlliedEngInCanyon == 0 and Map.Generator == 1 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

							if ( Map.ComplexMG42 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
							}
							if ( Map.CellarMG42 == 1 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
							}

							Util.MapDebugPrint( "^5EFootbridge_Built, Allies donīt cross river, Bridge destroyed, Allied engs are not in canyon, Generator built, Cellarentrance destroyed" );

							if ( Map.AlliesInCanyon == 0 )	//Allies are not in canyon
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, {
									"AMMOCAB_south_ammocabinet_1",
									"HEALTHCAB_south_healthcabinet_1",
									".*_Allied_Radio_.*",
								});

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

								Util.MapDebugPrint( "^5EFootbridge_Built, Allies donīt cross river, Bridge destroyed, Allies are not in canyon, Generator built, Cellarentrance destroyed" );
							}
						}
					}
				}
			}
		}
	},

	Footbridge_Planted = function( trigger )
	{
		Map.Footbridge_Dyno += 1;

		SetGoalPriority( "DEFUSE_Footbridge_*", 0.75, TEAM.ALLIES, CLASS.ENGINEER );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFUSE_Footbridge_*" );

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

	Footbridge_Defused = function( trigger )
	{
		Map.Footbridge_Dyno -= 1;

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

	Footbridge_Destroyed = function( trigger )
	{
		Map.Footbridge_Dyno = 0;
		Map.Footbridge = 0;

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

		SetAvailableMapGoals( TEAM.AXIS, false, {
			"PLANT_Footbridge",
			"ROUTE_Footbridge",
		});

		if ( Map.AlliesInCanyon == 0 )	//Allies are not in Canyon
		{
			if ( Map.Generator == 0 )	//destroyed
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, {
					"BUILD_Footbridge",
					".*_Allied_NearFootBridge_.*",
				});

				Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are not in canyon, Generator destroyed" );

				if ( Map.AlliesPastRiver == 0 and Map.BridgeBuild == 0 )	//Allies donīt cross river, Bridge destroyed
				{
					if ( Map.AlliedFlag == 0 )	//Bunker is Axis
					{
						SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Axis_NearBridge_.*" );

						Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies donīt cross river, Bridge destroyed, Bunker is Axis" );
					}

					if ( Map.CellarEntrance )	//intact
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, {
							"PLANT_Cellar_Entrance",
							".*_Allied_NearCellarEntrance_.*",
						});

						Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are not in canyon, Generator destroyed, Allies donīt cross river, Bridge destroyed, Cellar entrance intact" );
					}
					else	//Cellarentrance destroyed
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

						if ( Map.ComplexMG42 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
						}
						if ( Map.CellarMG42 == 1 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
						}

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

						Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are not in canyon, Generator destroyed, Allies donīt cross river, Bridge destroyed, Cellar entrance destroyed" );
					}
					if ( Map.AxisChangeSpawn == 0 and Map.AlliedFlag == 0 )	//Bunker is Axis
					{
						SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );

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

						Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are not in canyon, Generator destroyed, Allies donīt cross river, Bridge destroyed, Setting Axis defend to wall" );
					}
				}
				else	//Allies cross river or Bridge built
				{
					if ( Map.AlliedEngPastRiver == 0 and Map.BridgeBuild == 0 )	//Allied engs donīt cross river, Bridge destroyed
					{
						if ( Map.CellarEntrance )	//intact
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, {
								"PLANT_Cellar_Entrance",
								".*_Allied_NearCellarEntrance_.*",
							});

							Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are not in canyon, Generator destroyed, Allies cross river, Allied engs donīt cross river, Bridge destroyed, Cellar entrance intact" );
						}
						else	//Cellarentrance destroyed
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

							if ( Map.ComplexMG42 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
							}
							if ( Map.CellarMG42 == 1 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
							}

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

							Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are not in canyon, Generator destroyed, Allies cross river, Allied engs donīt cross river, Bridge destroyed, Cellar entrance destroyed" );
						}
						if ( Map.AxisChangeSpawn == 0 and Map.AlliedFlag == 0 )	//Bunker is Axis
						{
							SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );

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

							Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are not in canyon, Generator destroyed, Allies cross river, Allied engs donīt cross river, Bridge destroyed, Setting Axis defend to wall" );
						}
					}
				}
			}
			else	//Generator built
			{
				SetAvailableMapGoals( TEAM.ALLIES, false, {
					"BUILD_Footbridge",
					".*_Allied_NearFootBridge_.*",
				});

				Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are not in canyon, Generator built" );

				if ( Map.AlliesPastRiver == 0 and Map.BridgeBuild == 0 )	//Allies donīt cross river, Bridge destroyed
				{
					if ( Map.AlliedFlag == 0 )	//Bunker is Axis
					{
						SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Axis_NearBridge_.*" );

						Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies donīt cross river, Bridge destroyed, Bunker is Axis" );
					}

					if ( Map.CellarEntrance )	//intact
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, {
							"PLANT_Cellar_Entrance",
							".*_Allied_NearCellarEntrance_.*",
						});

						Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are not in canyon, Generator built, Allies donīt cross river, Bridge destroyed, Cellar entrance intact" );
					}
					else	//cellarentrance destroyed
					{
						SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

						if ( Map.ComplexMG42 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
						}
						if ( Map.CellarMG42 == 1 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
						}

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

						Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are not in canyon, Generator built, Allies donīt cross river, Bridge destroyed, Cellar entrance destroyed" );
					}
					if ( Map.AxisChangeSpawn == 0 and Map.AlliedFlag == 0 )	//Bunker is Axis
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							".*_Axis_NearFootBridge_.*",
							"DEFEND_Axis_InfrontofWall_.*",
						});

						Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are not in canyon, Generator built, Allies donīt cross river, Bridge destroyed, Cancell Axis defend in Canyon" );
					}
				}
				else	//Allies cross river or Bridge built
				{
					if ( Map.AlliedEngPastRiver == 0 and Map.BridgeBuild == 0 )	//Allied engs donīt cross river, Bridge destroyed
					{
						if ( Map.CellarEntrance )	//intact
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, {
								"PLANT_Cellar_Entrance",
								".*_Allied_NearCellarEntrance_.*",
							});

							Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are not in canyon, Generator built, Allies cross river, Allied engs donīt cross river, Bridge destroyed, Cellar entrance intact" );
						}
						else	//Cellarentrance destroyed
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

							if ( Map.ComplexMG42 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
							}
							if ( Map.CellarMG42 == 1 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
							}

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

							Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are not in canyon, Generator built, Allies cross river, Allied engs donīt cross river, Bridge destroyed, Cellar entrance destroyed" );
						}
						if ( Map.AxisChangeSpawn == 0 and Map.AlliedFlag == 0 )	//Bunker is Axis
						{
							SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );

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

							Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are not in canyon, Generator built, Allies cross river, Allied engs donīt cross river, Bridge destroyed, Setting Axis defend to wall" );
						}
					}
				}
			}
		}
		else	//Allies are in Canyon
		{
			if ( Map.AlliedEngInCanyon == 0 )	//Allied engs are not in canyon
			{
				if ( Map.Generator == 0 )	//destroyed
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, {
						"BUILD_Footbridge",
						".*_Allied_NearFootBridge_.*",
					});

					Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Allied engs are not in canyon, Generator destroyed" );

					if ( Map.AlliesPastRiver == 0 and Map.BridgeBuild == 0 )	//Allies donīt cross river, Bridge destroyed
					{
						if ( Map.CellarEntrance )	//intact
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, {
								"PLANT_Cellar_Entrance",
								".*_Allied_NearCellarEntrance_.*",
							});

							Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Allied engs are not in canyon, Generator destroyed, Allies donīt cross river, Bridge destroyed, Cellar entrance intact" );
						}
						else	//Cellarentrance destroyed
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

							if ( Map.ComplexMG42 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
							}
							if ( Map.CellarMG42 == 1 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
							}

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

							Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Allied engs are not in canyon, Generator destroyed, Allies donīt cross river, Bridge destroyed, Cellar entrance destroyed" );
						}
						if ( Map.AxisChangeSpawn == 0 and Map.AlliedFlag == 0 )	//Bunker is Axis
						{
							SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );

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

							Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Allied engs are not in canyon, Generator destroyed, Allies donīt cross river, Bridge destroyed, Setting Axis defend to wall" );
						}
					}
					else	//Allies cross river or Bridge built
					{
						if ( Map.AlliedEngPastRiver == 0 and Map.BridgeBuild == 0 )	//Allied engs donīt cross river, Bridge destroyed
						{
							if ( Map.CellarEntrance )	//intact
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, {
									"PLANT_Cellar_Entrance",
									".*_Allied_NearCellarEntrance_.*",
								});

								Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Allied engs are not in canyon, Generator destroyed, Allies cross river, Allied engs donīt cross river, Bridge destroyed, Cellar entrance intact" );
							}
							else	//Cellarentrance destroyed
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

								if ( Map.ComplexMG42 )	//built
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
								}
								if ( Map.CellarMG42 == 1 )	//built
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
								}

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

								Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Allied engs are not in canyon, Generator destroyed, Allies cross river, Allied engs donīt cross river, Bridge destroyed, Cellar entrance destroyed" );
							}
							if ( Map.AxisChangeSpawn == 0 and Map.AlliedFlag == 0 )	//Bunker is Axis
							{
								SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_NearFootBridge_.*" );

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

								Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Allied engs are not in canyon, Generator destroyed, Allies cross river, Allied engs donīt cross river, Bridge destroyed, Setting Axis defend to wall" );
							}
						}
					}
				}
				else	//Generator built
				{
					SetAvailableMapGoals( TEAM.ALLIES, false, {
						"BUILD_Footbridge",
						".*_Allied_NearFootBridge_.*",
					});

					Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Generator built" );

					if ( Map.AlliesPastRiver == 0 and Map.BridgeBuild == 0 )	//Allies donīt cross river, Bridge destroyed
					{
						if ( Map.CellarEntrance )	//intact
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, {
								"PLANT_Cellar_Entrance",
								".*_Allied_NearCellarEntrance_.*",
							});

							Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Allied engs are not in canyon, Generator built, Allies donīt cross river, Bridge destroyed, Cellar entrance intact" );
						}
						else	//cellarentrance destroyed
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

							if ( Map.ComplexMG42 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
							}
							if ( Map.CellarMG42 == 1 )	//built
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
							}

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

							Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Allied engs are not in canyon, Generator built, Allies donīt cross river, Bridge destroyed, Cellar entrance destroyed" );
						}
						if ( Map.AxisChangeSpawn == 0 and Map.AlliedFlag == 0 )	//Bunker is Axis
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								".*_Axis_NearFootBridge_.*",
								"DEFEND_Axis_InfrontofWall_.*",
							});

							Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Allied engs are not in canyon, Generator built, Allies donīt cross river, Bridge destroyed, Cancell Axis defend in Canyon" );
						}
					}
					else	//Allies cross river or Bridge built
					{
						if ( Map.AlliedEngPastRiver == 0 and Map.BridgeBuild == 0 )	//Allied engs donīt cross river, Bridge destroyed
						{
							if ( Map.CellarEntrance )	//intact
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, {
									"PLANT_Cellar_Entrance",
									".*_Allied_NearCellarEntrance_.*",
								});

								Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Allied engs are not in canyon, Generator built, Allies cross river, Allied engs donīt cross river, Bridge destroyed, Cellar entrance intact" );
							}
							else	//cellarentrance destroyed
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Communications_Radio" );

								if ( Map.ComplexMG42 )	//built
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Complex_Roof_MG42" );
								}
								if ( Map.CellarMG42 == 1 )	//built
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Cellar_MG42" );
								}

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

								Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Allied engs are not in canyon, Generator built, Allies cross river, Allied engs donīt cross river, Bridge destroyed, Cellar entrance destroyed" );
							}
							if ( Map.AxisChangeSpawn == 0 and Map.AlliedFlag == 0 )	//Bunker is Axis
							{
								SetAvailableMapGoals( TEAM.AXIS, false, {
									".*_Axis_NearFootBridge_.*",
									"DEFEND_Axis_InfrontofWall_.*",
								});

								Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Allied engs are not in canyon, Generator built, Allies cross river, Allied engs donīt cross river, Bridge destroyed, Cancell Axis defend in Canyon" );
							}
						}
					}
				}
			}
			//else
			//{
				//Util.MapDebugPrint( "^5Footbridge_Destroyed, Allies are in canyon, Allied engs are in canyon" );
			//}
		}
	},

	Complex_Roof_MG42_Built = function( trigger )
	{

		Map.ComplexMG42 = true;
		Wp.SetWaypointFlag( "Axis_Tower", "closed", false);

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

		if ( Map.AxisChangeSpawn == 1 )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, {
				"MOUNTMG42_Complex_Roof_MG42",
				"REPAIRMG42_Complex_Roof_MG42",
			});
		}

		if ( Map.BridgeBuild == 1 or Map.AlliedEngPastRiver > 0 or Map.AlliedCovertPastRiver > 0 )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Complex_Roof_MG42" );
		}

		if ( Map.AlliedEngInCanyon == 0 )
		{
			if ( Map.Generator == 0 and Map.Footbridge == 1 and !Map.CellarEntrance )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Complex_Roof_MG42" );
			}
		}
		else
		{
			if ( !Map.CellarEntrance )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Complex_Roof_MG42" );
			}
		}

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

	Complex_Roof_MG42_Planted = function( trigger )
	{
		Map.Complex_Roof_MG42_Dyno += 1;

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

	Complex_Roof_MG42_Defused = function( trigger )
	{
		Map.Complex_Roof_MG42_Dyno -= 1;

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

	Complex_Roof_MG42_Destroyed = function( trigger )
	{
		Map.Complex_Roof_MG42_Dyno = 0;
		Map.ComplexMG42 = false;
		Wp.SetWaypointFlag( "Axis_Tower", "closed", true);

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

		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFUSE_Complex_Roof_MG42_.*",
			"MOUNTMG42_Complex_Roof_MG42",
			"REPAIRMG42_Complex_Roof_MG42",
		});

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

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

	Cellar_Entrance_Planted = function( trigger )
	{
		Map.Cellar_Entrance_Dyno += 1;

		Wp.SetWaypointFlag( "JumpDown", "closed", false);

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

	Cellar_Entrance_Defused = function( trigger )
	{
		Map.Cellar_Entrance_Dyno -= 1;

		if ( Map.Cellar_Entrance_Dyno == 0 )
		{

			Wp.SetWaypointFlag( "JumpDown", "closed", true);
		}

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

	Cellar_Entrance_Destroyed = function( trigger )
	{
		Map.Cellar_Entrance_Dyno = 0;
		Map.CellarEntrance = false;

		Wp.SetWaypointFlag( "JumpDown", "closed", true);

		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"PLANT_Cellar_Entrance",
			".*_Allied_NearCellarEntrance_.*",
		});

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

		SetGoalPriority( "PLANT_Communications_Radio", 0.92, TEAM.ALLIES, CLASS.ENGINEER );

		SetGoalPriority( "BUILD_Cellar_MG42", 0.94, TEAM.AXIS, CLASS.ENGINEER );

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

		if ( Map.CellarMG42 == 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Cellar_MG42" );
		}
		else
		{
			if ( Map.AlliesInCanyon > 0 )	//Allies are in canyon
			{
				SetAvailableMapGoals( TEAM.AXIS, true, {
					"MOUNTMG42_Cellar_MG42",
					"REPAIRMG42_Cellar_MG42",
				});
			}
		}

		if ( Map.BridgeBuild == 0 )
		{
			if ( Map.AlliesPastRiver == 0 )
			{
				if ( Map.AlliesInCanyon == 0 )
				{
					if ( Map.Generator == 0 )
					{
						if ( Map.Footbridge == 1 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"PLANT_Communications_Radio",
								".*_Allied_Radio_.*",
							});

							if ( Map.ComplexMG42 )
							{
								SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Complex_Roof_MG42" );
							}
							if ( Map.CellarMG42 == 1 )
							{
								SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_MG42" );
							}
						}
					}
				}
				else
				{
					SetAvailableMapGoals( TEAM.ALLIES, true, ".*_Allied_Radio_.*" );

					if ( Map.AlliedEngInCanyon > 0 )
					{
						SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Communications_Radio" );

						if ( Map.ComplexMG42 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Complex_Roof_MG42" );
						}
						if ( Map.CellarMG42 == 1 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_MG42" );
						}
					}
				}
			}
		}

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

	Cellar_MG42_Built = function( trigger )
	{

		Map.CellarMG42 = 1;

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

		if ( Map.AxisChangeSpawn == 1 )
		{
			if ( !Map.CellarEntrance )
			{
				if ( Map.AlliesInCanyon > 0 )	//Allies are in canyon
				{
					SetAvailableMapGoals( TEAM.AXIS, true, {
						"MOUNTMG42_Cellar_MG42",
						"REPAIRMG42_Cellar_MG42",
					});
				}
			}
		}

		if ( Map.BridgeBuild == 1 or Map.AlliedEngPastRiver > 0 or Map.AlliedCovertPastRiver > 0 )
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_MG42" );
		}

		if ( Map.AlliedEngInCanyon == 0 )
		{
			if ( Map.Generator == 0 and Map.Footbridge == 1 and !Map.CellarEntrance )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_MG42" );
			}
		}
		else
		{
			if ( !Map.CellarEntrance )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_MG42" );
			}
		}

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

	Cellar_MG42_Planted = function( trigger )
	{
		Map.Cellar_MG42_Dyno += 1;

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

	Cellar_MG42_Defused = function( trigger )
	{
		Map.Cellar_MG42_Dyno -= 1;

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

	Cellar_MG42_Destroyed = function( trigger )
	{
		Map.Cellar_MG42_Dyno = 0;
		Map.CellarMG42 = 0;

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

		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFUSE_Cellar_MG42_.*",
			"MOUNTMG42_Cellar_MG42",
			"REPAIRMG42_Cellar_MG42",
		});

		if ( !Map.CellarEntrance )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Cellar_MG42" );
		}

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

	Communications_Radio_Planted = function( trigger )
	{
		Map.Communications_Radio_Dyno += 1;

		if ( Map.Cellar_Entrance_Dyno > 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "DEFUSE_Cellar_Entrance_.*" );
		}
		if ( Map.Cellar_MG42_Dyno > 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "DEFUSE_Cellar_MG42_.*" );
		}
		if ( Map.CellarMG42 == 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Cellar_MG42" );
		}
		if ( Map.Complex_Roof_MG42_Dyno > 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "DEFUSE_Complex_Roof_MG42_.*" );
		}
		if ( !Map.ComplexMG42 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Complex_Roof_MG42" );
		}
		if ( Map.Bridge_Dyno > 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Bridge" );
		}
		if ( Map.BridgeBuild == 1 )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Bridge" );
		}

		SetGoalPriority( "DEFUSE_Communications_Radio_.*", 1.5, TEAM.AXIS, CLASS.ENGINEER );

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

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

	Communications_Radio_Defused = function( trigger )
	{
		Map.Communications_Radio_Dyno -= 1;

		if ( Map.Communications_Radio_Dyno == 0 )
		{
			if ( Map.Cellar_Entrance_Dyno > 0 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFUSE_Cellar_Entrance_.*" );
			}
			if ( Map.Cellar_MG42_Dyno > 0 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFUSE_Cellar_MG42_.*" );
			}
			if ( Map.CellarMG42 == 0 )
			{
				if ( !Map.CellarEntrance )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Cellar_MG42" );
				}
			}
			if ( Map.Complex_Roof_MG42_Dyno > 0 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFUSE_Complex_Roof_MG42_.*" );
			}
			if ( !Map.ComplexMG42 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Complex_Roof_MG42" );
			}
			if ( Map.BridgeBuild == 1 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Bridge" );
			}
		}

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

	Communications_Radio_Destroyed = function( trigger )
	{
		Map.Communications_Radio_Dyno = 0;

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

		Util.MapDebugPrint( "^5Communications_Radio_Destroyed" );

		sleep(5);
	},

	Allied_CP_Built = function( trigger )
	{

		Map.AlliedCP = 1;

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

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

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

	Allied_CP_Destroyed = function( trigger )
	{

		Map.AlliedCP = 0;

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

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

		if ( Map.garagedoor1 )
		{
			if ( Map.AlliedFlag == 0 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" );

				SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Command_Post" );
			}
			else
			{
				SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Command_Post" );

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

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

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

	Axis_CP_Built = function( trigger )
	{

		Map.AxisCP = 1;

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

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

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

	Axis_CP_Destroyed = function( trigger )
	{

		Map.AxisCP = 0;

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

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

		if ( Map.AlliedFlag == 0 )
		{
			SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" );

			SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Command_Post" );
		}
		else
		{
			SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Command_Post" );

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

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

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

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

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

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

	Command_Post_Defused = function( trigger )
	{
		Map.Command_Post_Dyno -= 1;

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

	garage_door2_lever = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, false, "SWITCH_GarageDoor2" );
		SetAvailableMapGoals( TEAM.AXIS, false, "SWITCH_GarageDoor2" );

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

	garage_door2 = function( trigger )
	{
		sleep( 1 );
		vel = ToVector(trigger.Action);

		if ( vel[ 0 ] < 0 )
		{
			Map.garagedoor2 = false;

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

			Util.MapDebugPrint("^5garage door 2 closing");
		}
		else if ( vel[ 0 ] > 0 )
		{
			Map.garagedoor2 = true;

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

			Util.MapDebugPrint("^5garage door 2 opening");
		}

		if ( Map.garagedoor2 )
		{
			if ( Map.garagedoor1 )
			{
				SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );

				Util.MapDebugPrint( "^5garage_door2_switch_Axis" );
			}
			else
			{
				if ( Map.AxisChangeSpawn == 0 )
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
				}
				else
				{
					if ( Map.ReSpawn == 1 )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
					}
				}

				Util.MapDebugPrint( "^5garage_door2_switch_Axis" );
			}
		}
		else if ( !Map.garagedoor2 )
		{
			if ( !Map.garagedoor1 or !Map.AxisDoor )
			{
				SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_GarageDoor2" );

				Util.MapDebugPrint( "^5garage_door2_switch_Allied" );
			}
		}
		else
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, "SWITCH_GarageDoor2" );

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

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

	Trigger_Past_River =
	{
		Name = "TriggerPastRiver",
		TriggerOnClass = CLASS.ANYPLAYER,
		OnEnter = function(ent)
		{
			if( GetEntTeam(ent) == TEAM.ALLIES )
			{
				Map.AlliesPastRiver +=1;

				Util.MapDebugPrint( "^5Allies cross river" );

				if ( Map.AlliedEngPastRiver > 0 )
				{
					if ( Map.AlliesPastRiver > 4 )
					{
						if ( Map.AxisChangeSpawn == 0 )
						{
							ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.SOLDIER );
						}
					}
				}

				foreach ( id and bot in BotTable )
				{
					if ( bot.GetTeam() == TEAM.AXIS )
					{
						bot.SayTeam("^1Allies cross River and they are going to the complex!");
						break;
					}
				}

				SetAvailableMapGoals( TEAM.AXIS, false, "MOUNTMG42_Cellar_MG42" );
				SetGoalPriority( "MOUNTMG42_Cellar_MG42", 0.72, TEAM.AXIS, 0 );
				yield;
				SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_Cellar_MG42" );

				Util.MapDebugPrint( "^5Allies cross river" );

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

					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*_Axis_Radio_1",
						".*_Axis_Radio_4",
					});
					SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Generator" );

					if ( Map.AxisEngInCanyon == 0 and Map.AxisEngPastRiver == 0 )
					{
						ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.ENGINEER );
					}
					if ( Map.AxisEngInCanyon > 0 and Map.AxisEngPastRiver == 0 )
					{
						if ( Map.CellarEntrance )
						{
							ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.ENGINEER );
						}
					}

					foreach ( id and bot in BotTable )
					{
						if ( bot.GetTeam() == TEAM.AXIS )
						{
							bot.SayTeam("^1Allied Engineers cross River and they are going to the complex!");
							break;
						}
					}

					Util.MapDebugPrint( "^5Allied engs cross river" );
				}

				if ( GetEntClass(ent) == CLASS.COVERTOPS )
				{
					Map.AlliedCovertPastRiver += 1;

					Util.MapDebugPrint( "^5Allied covertops cross River" );
				}
			}
			else
			{
				if ( GetEntClass(ent) == CLASS.ENGINEER )
				{
					Map.AxisEngPastRiver += 1;
				}
			}
		},
		OnExit = function(ent)
		{
			if( GetEntTeam(ent) == TEAM.ALLIES )
			{
				Map.AlliesPastRiver -=1;

				if ( !Map.CellarEntrance )
				{
					if ( ( Map.AlliesInCanyon + Map.AlliesPastRiver ) < 4 )
					{
						if ( Map.AxisChangeSpawn == 0 )
						{
							ETUtil.SuicideSpawn( TEAM.AXIS, 3, -1, CLASS.SOLDIER );
						}
					}
				}
				else
				{
					if ( Map.AlliesPastRiver < 4 )
					{
						if ( Map.AxisChangeSpawn == 0 )
						{
							ETUtil.SuicideSpawn( TEAM.AXIS, 3, -1, CLASS.SOLDIER );
						}
					}
				}

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

					if ( !Map.CellarEntrance )
					{
						if ( Map.AlliedEngInCanyon == 0 and Map.AlliedEngPastRiver == 0 )
						{
							SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_Radio_.*" );

							if ( Map.AxisChangeSpawn == 0 )
							{
								ETUtil.SuicideSpawn( TEAM.AXIS, 3, -1, CLASS.ENGINEER );
								//ETUtil.SuicideSpawn( TEAM.AXIS, 3, -1, CLASS.COVERTOPS );
							}
						}
					}
					else
					{
						if ( Map.AlliedEngPastRiver == 0 )
						{
							if ( Map.AxisChangeSpawn == 0 )
							{
								ETUtil.SuicideSpawn( TEAM.AXIS, 3, -1, CLASS.ENGINEER );
								//ETUtil.SuicideSpawn( TEAM.AXIS, 3, -1, CLASS.COVERTOPS );
							}
						}
					}
				}
				if ( GetEntClass(ent) == CLASS.COVERTOPS )
				{
					Map.AlliedCovertPastRiver -= 1;
				}

				if ( Map.AlliesPastRiver == 0 )
				{
					if ( Map.AlliedEngInCanyon == 0 )
					{
						SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_Radio_.*" );
					}

					if ( Map.AlliesInCanyon == 0 )	//Allies are not in canyon
					{
						SetAvailableMapGoals( TEAM.AXIS, false, "MOUNTMG42_Cellar_MG42" );
						SetGoalPriority( "MOUNTMG42_Cellar_MG42", 0.68, TEAM.AXIS, 0 );
						SetGoalPriority( "MOUNTMG42_Cellar_MG42", 0.72, TEAM.AXIS, CLASS.SOLDIER );
					}

					if ( Map.BridgeBuild == 0 )	//Bridge destroyed
					{
						if ( Map.CellarEntrance )	//intact
						{
							SetAvailableMapGoals( TEAM.ALLIES, false, {
								".*_Allied_Radio_.*",
								"PLANT_Communications_Radio",
								"AMMOCAB_south_ammocabinet_1",
								"HEALTHCAB_south_healthcabinet_1",
								"PLANT_Complex_Roof_MG42",
								"PLANT_Cellar_MG42",
							});

							Util.MapDebugPrint( "^5Allies donīt cross river, Bridge destroyed, Cellarentrance intact" );

							if ( Map.AlliedEngInCanyon == 0 )	//Allied engs are not in canyon
							{
								if ( Map.Generator == 0 )	//Generator destroyed
								{
									if ( Map.Footbridge == 0 )	//Footbridge destroyed
									{
										SetAvailableMapGoals( TEAM.ALLIES, false, {
											"PLANT_Cellar_Entrance",
											"ATTACK_Allied_NearCellarEntrance_.*",
										});

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

										SetAvailableMapGoals( TEAM.ALLIES, true, {
											".*_Allied_NearFootBridge_.*",
											"BUILD_Footbridge",
										});

										Util.MapDebugPrint( "^5Allies donīt cross river, Bridge destroyed, Cellarentrance intact, Allied engs are not in canyon, Generator destroyed, Footbridge destroyed" );
									}
								}
								else	//Generator built
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, {
										"PLANT_Cellar_Entrance",
										"ATTACK_Allied_NearCellarEntrance_.*",
									});

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

									Util.MapDebugPrint( "^5Allies donīt cross river, Bridge destroyed, Cellarentrance intact, Allied engs are not in canyon, Generator built" );
								}
							}
						}
						else	//Cellarentrance destroyed
						{
							if ( Map.AlliedEngInCanyon == 0 )	//Allied engs are not in canyon
							{
								if ( Map.Generator == 0 )	//Generator destroyed
								{
									if ( Map.Footbridge == 0 )	//Footbridge destroyed
									{
										SetAvailableMapGoals( TEAM.ALLIES, false, {
											"PLANT_Communications_Radio",
											"PLANT_Complex_Roof_MG42",
											"PLANT_Cellar_MG42",
										});

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

										SetAvailableMapGoals( TEAM.ALLIES, true, {
											".*_Allied_NearFootBridge_.*",
											"BUILD_Footbridge",
										});

										Util.MapDebugPrint( "^5Allies donīt cross river, Bridge destroyed, Cellarentrance destroyed, Allied engs are not in canyon, Generator destroyed, Footbridge destroyed" );

										if ( Map.AlliesInCanyon == 0 )	//Allies are not in canyon
										{
											SetAvailableMapGoals( TEAM.ALLIES, false, {
												".*_Allied_Radio_.*",
												"AMMOCAB_south_ammocabinet_1",
												"HEALTHCAB_south_healthcabinet_1",
											});

											Util.MapDebugPrint( "^5Allies donīt cross river, Bridge destroyed, Cellarentrance destroyed, Allied engs are not in canyon, Generator destroyed, Footbridge destroyed, Allies are not in canyon" );
										}
									}
								}
								else	//Generator built
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, {
										"PLANT_Communications_Radio",
										"PLANT_Complex_Roof_MG42",
										"PLANT_Cellar_MG42",
									});

									Util.MapDebugPrint( "^5Allies donīt cross river, Bridge destroyed, Cellarentrance destroyed, Allied engs are not in canyon, Generator built" );

									if ( Map.AlliesInCanyon == 0 )	//Allies are not in canyon
									{
										SetAvailableMapGoals( TEAM.ALLIES, false, {
											".*_Allied_Radio_.*",
											"AMMOCAB_south_ammocabinet_1",
											"HEALTHCAB_south_healthcabinet_1",
										});

										Util.MapDebugPrint( "^5Allies donīt cross river, Bridge destroyed, Cellarentrance destroyed, Allied engs are not in canyon, Generator built, Allies are not in canyon" );
									}
								}
							}
						}
					}

					foreach ( id and bot in BotTable )
					{
						if ( bot.GetTeam() == TEAM.AXIS )
						{
							bot.SayTeam("^1Complex and Area behind River are clear.");
							break;
						}
					}

					Util.MapDebugPrint( "^5Complex and Area behind River are clear." );

					if ( Map.BridgeBuild == 0 )	//Bridge destroyed
					{
						if ( Map.AlliedFlag == 0 )	//Bunker is Axis
						{
							SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Axis_NearBridge_.*" );

							Util.MapDebugPrint( "^5AComplex and Area behind River are clear, Bridge destroyed, Bunker is Axis." );
						}
						else
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_Allied_NearBridge_.*" );

							Util.MapDebugPrint( "^5AComplex and Area behind River are clear, Bridge destroyed, Bunker is Allied." );
						}
					}
				}

				if ( Map.AlliesPastRiver == 0 and Map.BridgeBuild == 0 and Map.AlliesInCanyon == 0 and Map.Generator == 1 and Map.AlliedFlag == 0 )
				{
					if ( Map.AxisChangeSpawn == 1 )
					{
						Util.ChangeSpawn( TEAM.AXIS, 3 );
						Map.ReSpawn = 1;

						Map.AxisChangeSpawn = 0;

						SetAvailableMapGoals( TEAM.AXIS, false, {
							".*_Axis_Radio_.*",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							"MOUNTMG42_Complex_Roof_MG42",
							"REPAIRMG42_Complex_Roof_MG42",
							"BUILD_Complex_Roof_MG42",
							"MOUNTMG42_Cellar_MG42",
							"REPAIRMG42_Cellar_MG42",
							"BUILD_Cellar_MG42",
							".*_Axis_NearBridge_.*",
							".*_Axis_NearFootBridge_.*",
							".*_Axis_CellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.ALLIES, false, {
							".*_Allied_Radio_.*",
							"PLANT_Communications_Radio",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							"PLANT_Complex_Roof_MG42",
							"PLANT_Cellar_MG42",
							"PLANT_Cellar_Entrance",
							".*_Allied_NearBridge_.*",
							".*_Allied_NearFootBridge_.*",
							".*_Allied_NearCellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*_Axis_Start_.*",
							".*_Axis_StartBack_.*",
							"AMMOCAB_south_ammocabinet",
							"HEALTHCAB_south_healthcabinet",
						});

						if ( Map.garagedoor2 )
						{
							if ( Map.garagedoor1 )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
							}
							else
							{
								if ( Map.AxisChangeSpawn == 0 )
								{
									SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
								}
								else
								{
									if ( Map.ReSpawn == 1 )
									{
										SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
									}
								}
							}
						}

						if ( !Map.garagedoor1 )
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								"PLANTMINE_Axis_Start_1.*",
								"SMOKEBOMB_Axis_Start_13",
								"AIRSTRIKE_Axis_Start_1",
								"AIRSTRIKE_Axis_Start_6",
								"ARTILLERY_S_Axis_Start_5",
								"ARTILLERY_S_Axis_Start_8",
								"CALLARTILLERY_Axis_Start_4",
								"CALLARTILLERY_Axis_Start_10",
							});
						}
						else
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								"SMOKEBOMB_Axis_Start_25",
								"AIRSTRIKE_Axis_Start_28",
								"ARTILLERY_S_Axis_Start_27",
								"CALLARTILLERY_Axis_Start_26",
								".*_Axis_Start_7",
								".*_Axis_Start_9",
								".*_Axis_Start_10",
								".*_Axis_Start_11",
								".*_Axis_Start_12",
								".*_Axis_Start_14",
							});
						}

						if ( !Map.garagedoor2 )
						{
							if ( !Map.garagedoor1 or !Map.AxisDoor )
							{
								SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_GarageDoor2" );
							}
						}

						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"CHECKPOINT_checkpoint",
							".*_Allied_Start_.*",
							".*_Allied_StartBack_.*",
							"BUILD_Bridge",
							"PLANT_Generator",
						});

						if ( Map.garagedoor1 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Door" );
						}

						if ( Map.AxisDoor )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_Door" );
						}

						if ( Map.WindowMG42 == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Window_MG42" );
						}
						else
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"REPAIRMG42_Window_MG42",
								"MOUNTMG42_Window_MG42",
							});
						}

						if ( Map.CabinMG42 == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Cabin_MG42" );
						}
						else
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"REPAIRMG42_Cabin_MG42",
								"MOUNTMG42_Cabin_MG42",
							});
						}

						Util.MapDebugPrint( "^5Axis_Re-Captured_Garage" );
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							".*_Axis_Radio_.*",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							"MOUNTMG42_Complex_Roof_MG42",
							"REPAIRMG42_Complex_Roof_MG42",
							"BUILD_Complex_Roof_MG42",
							"MOUNTMG42_Cellar_MG42",
							"REPAIRMG42_Cellar_MG42",
							"BUILD_Cellar_MG42",
							".*_Axis_NearBridge_.*",
							".*_Axis_NearFootBridge_.*",
							".*_Axis_CellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.ALLIES, false, {
							".*_Allied_Radio_.*",
							"PLANT_Communications_Radio",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							"PLANT_Complex_Roof_MG42",
							"PLANT_Cellar_MG42",
							"PLANT_Cellar_Entrance",
							".*_Allied_NearBridge_.*",
							".*_Allied_NearFootBridge_.*",
							".*_Allied_NearCellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*_Axis_Start_.*",
							".*_Axis_StartBack_.*",
							"AMMOCAB_south_ammocabinet",
							"HEALTHCAB_south_healthcabinet",
						});

						if ( Map.garagedoor2 )
						{
							if ( Map.garagedoor1 )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
							}
							else
							{
								if ( Map.AxisChangeSpawn == 0 )
								{
									SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
								}
								else
								{
									if ( Map.ReSpawn == 1 )
									{
										SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
									}
								}
							}
						}

						if ( !Map.garagedoor1 )
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								"PLANTMINE_Axis_Start_1.*",
								"SMOKEBOMB_Axis_Start_13",
								"AIRSTRIKE_Axis_Start_1",
								"AIRSTRIKE_Axis_Start_6",
								"ARTILLERY_S_Axis_Start_5",
								"ARTILLERY_S_Axis_Start_8",
								"CALLARTILLERY_Axis_Start_4",
								"CALLARTILLERY_Axis_Start_10",
							});
						}
						else
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								"SMOKEBOMB_Axis_Start_25",
								"AIRSTRIKE_Axis_Start_28",
								"ARTILLERY_S_Axis_Start_27",
								"CALLARTILLERY_Axis_Start_26",
								".*_Axis_Start_7",
								".*_Axis_Start_9",
								".*_Axis_Start_10",
								".*_Axis_Start_11",
								".*_Axis_Start_12",
								".*_Axis_Start_14",
							});
						}

						if ( !Map.garagedoor2 )
						{
							if ( !Map.garagedoor1 or !Map.AxisDoor )
							{
								SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_GarageDoor2" );
							}
						}

						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"CHECKPOINT_checkpoint",
							".*_Allied_Start_.*",
							".*_Allied_StartBack_.*",
							"BUILD_Bridge",
							"PLANT_Generator",
						});

						if ( Map.garagedoor1 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Door" );

							if ( Map.AxisDoor )
							{
								if ( Map.Generator == 1 )
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Generator" );
								}
							}
						}

						if ( Map.AxisDoor )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_Door" );
						}

						if ( Map.WindowMG42 == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Window_MG42" );
						}
						else
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"REPAIRMG42_Window_MG42",
								"MOUNTMG42_Window_MG42",
							});
						}

						if ( Map.CabinMG42 == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Cabin_MG42" );
						}
						else
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"REPAIRMG42_Cabin_MG42",
								"MOUNTMG42_Cabin_MG42",
							});
						}

						Util.MapDebugPrint( "^5DDDD" );
					}
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_Complex_Roof_MG42" );

					if ( Map.AlliesInComplex == 0 )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_NearBridge_.*" );
					}

					Util.MapDebugPrint( "^5XXXX" );
				}
			}
			else
			{
				if ( GetEntClass(ent) == CLASS.ENGINEER )
				{
					Map.AxisEngPastRiver -= 1;
				}
			}
		},
	},
	Trigger_AllyInComplex =
	{
		Name = "TriggerAllyInComplex",
		TriggerOnClass = CLASS.ANYPLAYER,
		OnEnter = function(ent)
		{
			if( GetEntTeam(ent) == TEAM.ALLIES )
			{
				Map.AlliesInComplex += 1;

				foreach ( id and bot in BotTable )
				{
					if ( bot.GetTeam() == TEAM.AXIS )
					{
						bot.SayTeam("^1Allies entered into complex!");
						break;
					}
				}

				Util.MapDebugPrint( "^5Allies entered into complex" );

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

					foreach ( id and bot in BotTable )
					{
						if ( bot.GetTeam() == TEAM.AXIS )
						{
							bot.SayTeam("^1Allied engs entered into complex!");
							break;
						}
					}

					SetAvailableMapGoals( TEAM.AXIS, false, {
						".*_Axis_NearBridge_.*",
						".*_Axis_NearFootBridge_.*",
					});

					if ( Map.AxisChangeSpawn == 0 )
					{
						if ( Map.AlliesPastRiver > 4 )
						{
							ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.COVERTOPS );
						}
						else
						{
							ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.ENGINEER );
						}
					}

					SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_Radio_.*" );
					yield();
					SetGoalPriority( "DEFEND_Axis_Radio_.*", 0.92, TEAM.AXIS, CLASS.COVERTOPS );
					SetGoalPriority( "DEFEND_Axis_Radio_.*", 0.92, TEAM.AXIS, CLASS.FIELDOPS );
					SetGoalPriority( "DEFEND_Axis_Radio_.*", 0.92, TEAM.AXIS, CLASS.ENGINEER );
					SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_Radio_.*" );

					Util.MapDebugPrint( "^5Allied engs entered into complex" );
				}
			}
		},
		OnExit = function(ent)
		{
			if( GetEntTeam(ent) == TEAM.ALLIES )
			{
				Map.AlliesInComplex -= 1;

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

					if ( Map.AlliedEngInComplex == 0)
					{

						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*_Axis_NearBridge_.*",
							".*_Axis_NearFootBridge_.*",
						});

						SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_Radio_.*" );
						yield();
						SetGoalPriority( "DEFEND_Axis_Radio_.*", 0.55, TEAM.AXIS, 0 );
						SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_Radio_.*" );

						if ( Map.AlliesPastRiver < 4 )
						{
							if ( Map.AxisChangeSpawn == 0 )
							{
								ETUtil.SuicideSpawn( TEAM.AXIS, 3, -1, CLASS.COVERTOPS );
							}
						}
					}
				}

				if ( Map.AlliesInComplex == 0 )
				{
					foreach ( id and bot in BotTable )
					{
						if ( bot.GetTeam() == TEAM.AXIS )
						{
							bot.SayTeam("^1Complex is clear. Allies are not in complex.");
							break;
						}
					}

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

					SetAvailableMapGoals( TEAM.AXIS, true, {
						".*_Axis_Radio_3",
						".*_Axis_Radio_4",
						".*_Axis_Radio_5",
					});

					Util.MapDebugPrint( "^5Complex is clear." );
				}

				if ( Map.AlliesPastRiver == 0 and Map.BridgeBuild == 0 and Map.AlliesInCanyon == 0 and Map.Generator == 1 and Map.AlliedFlag == 0 )
				{
					if ( Map.AxisChangeSpawn == 1 )
					{
						Util.ChangeSpawn( TEAM.AXIS, 3 );
						Map.ReSpawn = 1;

						Map.AxisChangeSpawn = 0;

						SetAvailableMapGoals( TEAM.AXIS, false, {
							".*_Axis_Radio_.*",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							"MOUNTMG42_Complex_Roof_MG42",
							"REPAIRMG42_Complex_Roof_MG42",
							"BUILD_Complex_Roof_MG42",
							"MOUNTMG42_Cellar_MG42",
							"REPAIRMG42_Cellar_MG42",
							"BUILD_Cellar_MG42",
							".*_Axis_NearBridge_.*",
							".*_Axis_NearFootBridge_.*",
							".*_Axis_CellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.ALLIES, false, {
							".*_Allied_Radio_.*",
							"PLANT_Communications_Radio",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							"PLANT_Complex_Roof_MG42",
							"PLANT_Cellar_MG42",
							"PLANT_Cellar_Entrance",
							".*_Allied_NearBridge_.*",
							".*_Allied_NearFootBridge_.*",
							".*_Allied_NearCellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*_Axis_Start_.*",
							".*_Axis_StartBack_.*",
							"AMMOCAB_south_ammocabinet",
							"HEALTHCAB_south_healthcabinet",
						});

						if ( Map.garagedoor2 )
						{
							if ( Map.garagedoor1 )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
							}
							else
							{
								if ( Map.AxisChangeSpawn == 0 )
								{
									SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
								}
								else
								{
									if ( Map.ReSpawn == 1 )
									{
										SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
									}
								}
							}
						}

						if ( !Map.garagedoor1 )
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								"PLANTMINE_Axis_Start_1.*",
								"SMOKEBOMB_Axis_Start_13",
								"AIRSTRIKE_Axis_Start_1",
								"AIRSTRIKE_Axis_Start_6",
								"ARTILLERY_S_Axis_Start_5",
								"ARTILLERY_S_Axis_Start_8",
								"CALLARTILLERY_Axis_Start_4",
								"CALLARTILLERY_Axis_Start_10",
							});
						}
						else
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								"SMOKEBOMB_Axis_Start_25",
								"AIRSTRIKE_Axis_Start_28",
								"ARTILLERY_S_Axis_Start_27",
								"CALLARTILLERY_Axis_Start_26",
								".*_Axis_Start_7",
								".*_Axis_Start_9",
								".*_Axis_Start_10",
								".*_Axis_Start_11",
								".*_Axis_Start_12",
								".*_Axis_Start_14",
							});
						}

						if ( !Map.garagedoor2 )
						{
							if ( !Map.garagedoor1 or !Map.AxisDoor )
							{
								SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_GarageDoor2" );
							}
						}

						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"CHECKPOINT_checkpoint",
							".*_Allied_Start_.*",
							".*_Allied_StartBack_.*",
							"BUILD_Bridge",
							"PLANT_Generator",
						});

						if ( Map.garagedoor1 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Door" );
						}

						if ( Map.AxisDoor )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_Door" );
						}

						if ( Map.WindowMG42 == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Window_MG42" );
						}
						else
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"REPAIRMG42_Window_MG42",
								"MOUNTMG42_Window_MG42",
							});
						}

						if ( Map.CabinMG42 == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Cabin_MG42" );
						}
						else
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"REPAIRMG42_Cabin_MG42",
								"MOUNTMG42_Cabin_MG42",
							});
						}

						Util.MapDebugPrint( "^5Axis_Re-Captured_Garage" );
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							".*_Axis_Radio_.*",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							"MOUNTMG42_Complex_Roof_MG42",
							"REPAIRMG42_Complex_Roof_MG42",
							"BUILD_Complex_Roof_MG42",
							"MOUNTMG42_Cellar_MG42",
							"REPAIRMG42_Cellar_MG42",
							"BUILD_Cellar_MG42",
							".*_Axis_NearBridge_.*",
							".*_Axis_NearFootBridge_.*",
							".*_Axis_CellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.ALLIES, false, {
							".*_Allied_Radio_.*",
							"PLANT_Communications_Radio",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							"PLANT_Complex_Roof_MG42",
							"PLANT_Cellar_MG42",
							"PLANT_Cellar_Entrance",
							".*_Allied_NearBridge_.*",
							".*_Allied_NearFootBridge_.*",
							".*_Allied_NearCellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*_Axis_Start_.*",
							".*_Axis_StartBack_.*",
							"AMMOCAB_south_ammocabinet",
							"HEALTHCAB_south_healthcabinet",
						});

						if ( Map.garagedoor2 )
						{
							if ( Map.garagedoor1 )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
							}
							else
							{
								if ( Map.AxisChangeSpawn == 0 )
								{
									SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
								}
								else
								{
									if ( Map.ReSpawn == 1 )
									{
										SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
									}
								}
							}
						}

						if ( !Map.garagedoor1 )
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								"PLANTMINE_Axis_Start_1.*",
								"SMOKEBOMB_Axis_Start_13",
								"AIRSTRIKE_Axis_Start_1",
								"AIRSTRIKE_Axis_Start_6",
								"ARTILLERY_S_Axis_Start_5",
								"ARTILLERY_S_Axis_Start_8",
								"CALLARTILLERY_Axis_Start_4",
								"CALLARTILLERY_Axis_Start_10",
							});
						}
						else
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								"SMOKEBOMB_Axis_Start_25",
								"AIRSTRIKE_Axis_Start_28",
								"ARTILLERY_S_Axis_Start_27",
								"CALLARTILLERY_Axis_Start_26",
								".*_Axis_Start_7",
								".*_Axis_Start_9",
								".*_Axis_Start_10",
								".*_Axis_Start_11",
								".*_Axis_Start_12",
								".*_Axis_Start_14",
							});
						}

						if ( !Map.garagedoor2 )
						{
							if ( !Map.garagedoor1 or !Map.AxisDoor )
							{
								SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_GarageDoor2" );
							}
						}

						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"CHECKPOINT_checkpoint",
							".*_Allied_Start_.*",
							".*_Allied_StartBack_.*",
							"BUILD_Bridge",
							"PLANT_Generator",
						});

						if ( Map.garagedoor1 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Door" );
						}

						if ( Map.AxisDoor )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_Door" );
						}

						if ( Map.WindowMG42 == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Window_MG42" );
						}
						else
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"REPAIRMG42_Window_MG42",
								"MOUNTMG42_Window_MG42",
							});
						}

						if ( Map.CabinMG42 == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Cabin_MG42" );
						}
						else
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"REPAIRMG42_Cabin_MG42",
								"MOUNTMG42_Cabin_MG42",
							});
						}

						Util.MapDebugPrint( "^5EEEE" );
					}
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_Complex_Roof_MG42" );

					if ( Map.AlliesInComplex == 0 )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_NearBridge_.*" );
					}

					Util.MapDebugPrint( "^5WWWW" );
				}
			}
		},
	},
	Trigger_AllyInCanyon =
	{
		Name = "TriggerAllyInCanyon",
		TriggerOnClass = CLASS.ANYPLAYER,
		OnEnter = function(ent)
		{
			if( GetEntTeam(ent) == TEAM.ALLIES )
			{
				Map.AlliesInCanyon += 1;

				foreach ( id and bot in BotTable )
				{
					if ( bot.GetTeam() == TEAM.AXIS )
					{
						bot.SayTeam("^1Allies entered into canyon!");
						break;
					}

					Util.MapDebugPrint( "^5Allies entered into canyon" );
				}

				if ( !Map.CellarEntrance )	//destroyed
				{
					SetAvailableMapGoals( TEAM.AXIS, false, "MOUNTMG42_Cellar_MG42" );
					SetGoalPriority( "MOUNTMG42_Cellar_MG42", 0.72, TEAM.AXIS, 0 );
					yield;
					SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_Cellar_MG42" );
				}

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

					foreach ( id and bot in BotTable )
					{
						if ( bot.GetTeam() == TEAM.AXIS )
						{
							bot.SayTeam("^1Allied engs entered into canyon!");
							break;
						}
					}

					if ( !Map.CellarEntrance )	//destroyed
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*_Axis_Radio_1",
							".*_Axis_Radio_4",
						});
						SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Generator" );

						if ( Map.AxisEngInCanyon == 0 and Map.AxisEngPastRiver == 0 )
						{
							ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.ENGINEER );
						}
						if ( Map.AxisEngInCanyon > 0 and Map.AxisEngPastRiver == 0 )
						{
							if ( Map.CellarEntrance )
							{
								ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.ENGINEER );
							}
						}

						foreach ( id and bot in BotTable )
						{
							if ( bot.GetTeam() == TEAM.AXIS )
							{
								bot.SayTeam("^1Allied Engineers cross River and they are going to the complex!");
								break;
							}
						}

						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"PLANT_Communications_Radio",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							".*_Allied_Radio_.*",
						});

						if ( Map.ComplexMG42 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Complex_Roof_MG42" );
						}
						if ( Map.CellarMG42 == 1 )	//built
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Cellar_MG42" );
						}

						Util.MapDebugPrint( "^5Allied engs entered into canyon, Cellarentrance destroyed" );
					}
					else	//cellarentrance intact
					{
						SetAvailableMapGoals( TEAM.AXIS, true, {
							"DEFEND_Axis_NearFootBridge_1",
							"DEFEND_Axis_NearFootBridge_2",
						});

						SetAvailableMapGoals( TEAM.ALLIES, true, {
							".*_Allied_NearCellarEntrance_.*",
							"PLANT_Cellar_Entrance",
						});

						Util.MapDebugPrint( "^5Allied engs entered into canyon, Cellarentrance intact" );
					}
				}

				if ( !Map.CellarEntrance )
				{
					if ( Map.AlliedEngInCanyon > 0 )
					{
						if ( Map.AlliesInCanyon > 4 )
						{
							if ( Map.AxisChangeSpawn == 0 )
							{
								ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.SOLDIER );
							}
						}
					}
				}
			}
			else
			{
				if ( GetEntClass(ent) == CLASS.ENGINEER )
				{
					Map.AxisEngInCanyon += 1;
				}
			}
		},
		OnExit = function(ent)
		{
			if( GetEntTeam(ent) == TEAM.ALLIES )
			{
				Map.AlliesInCanyon -= 1;

				if ( !Map.CellarEntrance )
				{
					if ( ( Map.AlliesInCanyon + Map.AlliesPastRiver ) < 4 )
					{
						if ( Map.AxisChangeSpawn == 0 )
						{
							ETUtil.SuicideSpawn( TEAM.AXIS, 3, -1, CLASS.SOLDIER );
						}
					}
				}

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

					if ( !Map.CellarEntrance )
					{
						if ( Map.AlliedEngInCanyon == 0 and Map.AlliedEngPastRiver == 0 )
						{
							SetAvailableMapGoals( TEAM.AXIS, false, ".*_Axis_Radio_.*" );

							if ( Map.AxisChangeSpawn == 0 )
							{
								ETUtil.SuicideSpawn( TEAM.AXIS, 3, -1, CLASS.ENGINEER );
								//ETUtil.SuicideSpawn( TEAM.AXIS, 3, -1, CLASS.COVERTOPS );
							}
						}
					}
				}

				if ( Map.AlliesInCanyon == 0 )
				{
					foreach ( id and bot in BotTable )
					{
						if ( bot.GetTeam() == TEAM.AXIS )
						{
							bot.SayTeam("^1Canyon is clear. Allies are not in canyon.");
							break;
						}
					}

					Util.MapDebugPrint( "^5Canyon is clear." );

					if ( Map.AlliesPastRiver == 0 )
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							".*_Axis_Radio_.*",
							"MOUNTMG42_Cellar_MG42",
						});
						SetGoalPriority( "MOUNTMG42_Cellar_MG42", 0.68, TEAM.AXIS, 0 );
						SetGoalPriority( "MOUNTMG42_Cellar_MG42", 0.72, TEAM.AXIS, CLASS.SOLDIER );

						if ( Map.BridgeBuild == 0 )	//Bridge destroyed
						{
							if ( Map.CellarEntrance )	//intact
							{
								SetAvailableMapGoals( TEAM.ALLIES, false, {
									".*_Allied_Radio_.*",
									"PLANT_Communications_Radio",
									"AMMOCAB_south_ammocabinet_1",
									"HEALTHCAB_south_healthcabinet_1",
									"PLANT_Complex_Roof_MG42",
									"PLANT_Cellar_MG42",
								});

								Util.MapDebugPrint( "^5Canyon is clear, Allies donīt cross river, Bridge destroyed, Cellarentrance intact" );

								if ( Map.Generator == 0 )	//Generator destroyed
								{
									if ( Map.Footbridge == 0 )	//Footbridge destroyed
									{
										SetAvailableMapGoals( TEAM.ALLIES, false, {
											"PLANT_Cellar_Entrance",
											"ATTACK_Allied_NearCellarEntrance_.*",
										});

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

										SetAvailableMapGoals( TEAM.ALLIES, true, {
											".*_Allied_NearFootBridge_.*",
											"BUILD_Footbridge",
										});

										Util.MapDebugPrint( "^5Canyon is clear, Allies donīt cross river, Bridge destroyed, Cellarentrance intact, Generator destroyed, Footbridge destroyed" );
									}
								}
								else	//Generator built
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, {
										"PLANT_Cellar_Entrance",
										"ATTACK_Allied_NearCellarEntrance_.*",
									});

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

									Util.MapDebugPrint( "^5Canyon is clear, Allies donīt cross river, Bridge destroyed, Cellarentrance intact, Generator built" );
								}
							}
							else	//Cellarentrance destroyed
							{
								if ( Map.Generator == 0 )	//Generator destroyed
								{
									if ( Map.Footbridge == 0 )	//Footbridge destroyed
									{
										SetAvailableMapGoals( TEAM.ALLIES, false, {
											"PLANT_Communications_Radio",
											"PLANT_Complex_Roof_MG42",
											"PLANT_Cellar_MG42",
											".*_Allied_Radio_.*",
											"AMMOCAB_south_ammocabinet_1",
											"HEALTHCAB_south_healthcabinet_1",
										});

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

										SetAvailableMapGoals( TEAM.ALLIES, true, {
											".*_Allied_NearFootBridge_.*",
											"BUILD_Footbridge",
										});

										Util.MapDebugPrint( "^5Canyon is clear, Allies donīt cross river, Bridge destroyed, Cellarentrance destroyed, Generator destroyed, Footbridge destroyed" );
									}
								}
								else	//Generator built
								{
									SetAvailableMapGoals( TEAM.ALLIES, false, {
										"PLANT_Communications_Radio",
										"PLANT_Complex_Roof_MG42",
										"PLANT_Cellar_MG42",
										".*_Allied_Radio_.*",
										"AMMOCAB_south_ammocabinet_1",
										"HEALTHCAB_south_healthcabinet_1",
									});

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

									Util.MapDebugPrint( "^5Canyon is clear, Allies donīt cross river, Bridge destroyed, Cellarentrance destroyed, Generator built" );
								}
							}

							if ( Map.AlliedFlag == 0 )	//Bunker is Axis
							{
								SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Axis_NearBridge_.*" );

								Util.MapDebugPrint( "^5BComplex and Area behind River are clear, Bridge destroyed, Bunker is Axis." );
							}
							else
							{
								SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_Allied_NearBridge_.*" );

								Util.MapDebugPrint( "^5BComplex and Area behind River are clear, Bridge destroyed, Bunker is Allied." );
							}
						}
					}
				}

				if ( Map.AlliesPastRiver == 0 and Map.BridgeBuild == 0 and Map.AlliesInCanyon == 0 and Map.Generator == 1 and Map.AlliedFlag == 0 )
				{
					if ( Map.AxisChangeSpawn == 1 )
					{
						Util.ChangeSpawn( TEAM.AXIS, 3 );
						Map.ReSpawn = 1;

						Map.AxisChangeSpawn = 0;

						SetAvailableMapGoals( TEAM.AXIS, false, {
							".*_Axis_Radio_.*",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							"MOUNTMG42_Complex_Roof_MG42",
							"REPAIRMG42_Complex_Roof_MG42",
							"BUILD_Complex_Roof_MG42",
							"MOUNTMG42_Cellar_MG42",
							"REPAIRMG42_Cellar_MG42",
							"BUILD_Cellar_MG42",
							".*_Axis_NearBridge_.*",
							".*_Axis_NearFootBridge_.*",
							".*_Axis_CellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.ALLIES, false, {
							".*_Allied_Radio_.*",
							"PLANT_Communications_Radio",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							"PLANT_Complex_Roof_MG42",
							"PLANT_Cellar_MG42",
							"PLANT_Cellar_Entrance",
							".*_Allied_NearBridge_.*",
							".*_Allied_NearFootBridge_.*",
							".*_Allied_NearCellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*_Axis_Start_.*",
							".*_Axis_StartBack_.*",
							"AMMOCAB_south_ammocabinet",
							"HEALTHCAB_south_healthcabinet",
						});

						if ( Map.garagedoor2 )
						{
							if ( Map.garagedoor1 )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
							}
							else
							{
								if ( Map.AxisChangeSpawn == 0 )
								{
									SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
								}
								else
								{
									if ( Map.ReSpawn == 1 )
									{
										SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
									}
								}
							}
						}

						if ( !Map.garagedoor1 )
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								"PLANTMINE_Axis_Start_1.*",
								"SMOKEBOMB_Axis_Start_13",
								"AIRSTRIKE_Axis_Start_1",
								"AIRSTRIKE_Axis_Start_6",
								"ARTILLERY_S_Axis_Start_5",
								"ARTILLERY_S_Axis_Start_8",
								"CALLARTILLERY_Axis_Start_4",
								"CALLARTILLERY_Axis_Start_10",
							});
						}
						else
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								"SMOKEBOMB_Axis_Start_25",
								"AIRSTRIKE_Axis_Start_28",
								"ARTILLERY_S_Axis_Start_27",
								"CALLARTILLERY_Axis_Start_26",
								".*_Axis_Start_7",
								".*_Axis_Start_9",
								".*_Axis_Start_10",
								".*_Axis_Start_11",
								".*_Axis_Start_12",
								".*_Axis_Start_14",
							});
						}

						if ( !Map.garagedoor2 )
						{
							if ( !Map.garagedoor1 or !Map.AxisDoor )
							{
								SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_GarageDoor2" );
							}
						}

						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"CHECKPOINT_checkpoint",
							".*_Allied_Start_.*",
							".*_Allied_StartBack_.*",
							"BUILD_Bridge",
							"PLANT_Generator",
						});

						if ( Map.garagedoor1 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Door" );
						}

						if ( Map.AxisDoor )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_Door" );
						}

						if ( Map.WindowMG42 == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Window_MG42" );
						}
						else
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"REPAIRMG42_Window_MG42",
								"MOUNTMG42_Window_MG42",
							});
						}

						if ( Map.CabinMG42 == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Cabin_MG42" );
						}
						else
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"REPAIRMG42_Cabin_MG42",
								"MOUNTMG42_Cabin_MG42",
							});
						}

						Util.MapDebugPrint( "^5Axis_Re-Captured_Garage" );
					}
					else
					{
						SetAvailableMapGoals( TEAM.AXIS, false, {
							".*_Axis_Radio_.*",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							"MOUNTMG42_Complex_Roof_MG42",
							"REPAIRMG42_Complex_Roof_MG42",
							"BUILD_Complex_Roof_MG42",
							"MOUNTMG42_Cellar_MG42",
							"REPAIRMG42_Cellar_MG42",
							"BUILD_Cellar_MG42",
							".*_Axis_NearBridge_.*",
							".*_Axis_NearFootBridge_.*",
							".*_Axis_CellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.ALLIES, false, {
							".*_Allied_Radio_.*",
							"PLANT_Communications_Radio",
							"AMMOCAB_south_ammocabinet_1",
							"HEALTHCAB_south_healthcabinet_1",
							"PLANT_Complex_Roof_MG42",
							"PLANT_Cellar_MG42",
							"PLANT_Cellar_Entrance",
							".*_Allied_NearBridge_.*",
							".*_Allied_NearFootBridge_.*",
							".*_Allied_NearCellarEntrance_.*",
						});

						SetAvailableMapGoals( TEAM.AXIS, true, {
							".*_Axis_Start_.*",
							".*_Axis_StartBack_.*",
							"AMMOCAB_south_ammocabinet",
							"HEALTHCAB_south_healthcabinet",
						});

						if ( Map.garagedoor2 )
						{
							if ( Map.garagedoor1 )
							{
								SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
							}
							else
							{
								if ( Map.AxisChangeSpawn == 0 )
								{
									SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
								}
								else
								{
									if ( Map.ReSpawn == 1 )
									{
										SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_GarageDoor2" );
									}
								}
							}
						}

						if ( !Map.garagedoor1 )
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								"PLANTMINE_Axis_Start_1.*",
								"SMOKEBOMB_Axis_Start_13",
								"AIRSTRIKE_Axis_Start_1",
								"AIRSTRIKE_Axis_Start_6",
								"ARTILLERY_S_Axis_Start_5",
								"ARTILLERY_S_Axis_Start_8",
								"CALLARTILLERY_Axis_Start_4",
								"CALLARTILLERY_Axis_Start_10",
							});
						}
						else
						{
							SetAvailableMapGoals( TEAM.AXIS, false, {
								"SMOKEBOMB_Axis_Start_25",
								"AIRSTRIKE_Axis_Start_28",
								"ARTILLERY_S_Axis_Start_27",
								"CALLARTILLERY_Axis_Start_26",
								".*_Axis_Start_7",
								".*_Axis_Start_9",
								".*_Axis_Start_10",
								".*_Axis_Start_11",
								".*_Axis_Start_12",
								".*_Axis_Start_14",
							});
						}

						if ( !Map.garagedoor2 )
						{
							if ( !Map.garagedoor1 or !Map.AxisDoor )
							{
								SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_GarageDoor2" );
							}
						}

						SetAvailableMapGoals( TEAM.ALLIES, true, {
							"CHECKPOINT_checkpoint",
							".*_Allied_Start_.*",
							".*_Allied_StartBack_.*",
							"BUILD_Bridge",
							"PLANT_Generator",
						});

						if ( Map.garagedoor1 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Garage_Door" );
						}

						if ( Map.AxisDoor )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_Door" );
						}

						if ( Map.WindowMG42 == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Window_MG42" );
						}
						else
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"REPAIRMG42_Window_MG42",
								"MOUNTMG42_Window_MG42",
							});
						}

						if ( Map.CabinMG42 == 0 )
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Cabin_MG42" );
						}
						else
						{
							SetAvailableMapGoals( TEAM.ALLIES, true, {
								"REPAIRMG42_Cabin_MG42",
								"MOUNTMG42_Cabin_MG42",
							});
						}

						Util.MapDebugPrint( "^5FFFF" );
					}
				}
				else
				{
					SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_Complex_Roof_MG42" );

					if ( Map.AlliesInComplex == 0 )
					{
						SetAvailableMapGoals( TEAM.AXIS, true, ".*_Axis_NearBridge_.*" );
					}

					Util.MapDebugPrint( "^5VVVV" );
				}
			}
			else
			{
				if ( GetEntClass(ent) == CLASS.ENGINEER )
				{
					Map.AxisEngInCanyon -= 1;
				}
			}
		},
	},
};

global OnMapLoad = function()
{
	// Register callback functions
	OnTrigger( "Allies have Constructed the Bridge", Map.Bridge_Built );
	OnTrigger( "Outdoor Cabin MG42 Constructed!", Map.Cabin_MG42_Built );
	OnTrigger( "Cellar MG42 Constructed!", Map.Cellar_MG42_Built );
	OnTrigger( "Axis have Constructed the Lab MG42", Map.Complex_Roof_MG42_Built );
	OnTrigger( "Allies have Constructed the Foot Bridge", Map.Footbridge_Built );
	OnTrigger( "Axis have Constructed the Garage MG42", Map.Axis_Garage_Roof_MG42_Built );
	OnTrigger( "Allies have Constructed the Garage MG42", Map.Allied_Garage_Roof_MG42_Built );
	OnTrigger( "The Generator has been constructed!", Map.Generator_Built );
	OnTrigger( "Indoor Cabin MG42 Constructed!", Map.Window_MG42_Built );
	OnTrigger( "Planted at the Axis Door.", Map.Axis_Door_Planted );
	OnTrigger( "Planted at Axis Door.", Map.Axis_Door_Planted );	//for nitmod
	OnTrigger( "Planted at the Bridge.", Map.Bridge_Planted );
	OnTrigger( "Planted at Bridge.", Map.Bridge_Planted );	//for nitmod
	OnTrigger( "Planted at the Cabin MG42.", Map.Cabin_MG42_Planted );
	OnTrigger( "Planted at Cabin MG42.", Map.Cabin_MG42_Planted );	//for nitmod
	OnTrigger( "Planted at the Cellar Entrance.", Map.Cellar_Entrance_Planted );
	OnTrigger( "Planted at Cellar Entrance.", Map.Cellar_Entrance_Planted );	//for nitmod
	OnTrigger( "Planted at the Cellar MG42.", Map.Cellar_MG42_Planted );
	OnTrigger( "Planted at Cellar MG42.", Map.Cellar_MG42_Planted );	//for nitmod
	OnTrigger( "Planted at the Command Post.", Map.Command_Post_Planted );
	OnTrigger( "Planted at Command Post.", Map.Command_Post_Planted );	//for nitmod
	OnTrigger( "Planted at the Communications Radio.", Map.Communications_Radio_Planted );
	OnTrigger( "Planted at Communications Radio.", Map.Communications_Radio_Planted );	//for nitmod
	OnTrigger( "Planted at the Complex Roof MG42.", Map.Complex_Roof_MG42_Planted );
	OnTrigger( "Planted at Complex Roof MG42.", Map.Complex_Roof_MG42_Planted );	//for nitmod
	OnTrigger( "Planted at the Footbridge.", Map.Footbridge_Planted );
	OnTrigger( "Planted at Footbridge.", Map.Footbridge_Planted );	//for nitmod
	OnTrigger( "Planted at the Garage Door.", Map.Garage_Door_Planted );
	OnTrigger( "Planted at Garage Door.", Map.Garage_Door_Planted );	//for nitmod
	OnTrigger( "Planted at the Garage Roof MG42.", Map.Garage_Roof_MG42_Planted );
	OnTrigger( "Planted at Garage Roof MG42.", Map.Garage_Roof_MG42_Planted );	//for nitmod
	OnTrigger( "Planted at the Generator.", Map.Generator_Planted );
	OnTrigger( "Planted at Generator.", Map.Generator_Planted );	//for nitmod
	OnTrigger( "Planted at the Window MG42.", Map.Window_MG42_Planted );
	OnTrigger( "Planted at Window MG42.", Map.Window_MG42_Planted );	//for nitmod
	OnTrigger( "Defused at the Axis Door.", Map.Axis_Door_Defused );
	OnTrigger( "Defused at Axis Door.", Map.Axis_Door_Defused );	//for nitmod
	OnTrigger( "Defused at the Bridge.", Map.Bridge_Defused );
	OnTrigger( "Defused at Bridge.", Map.Bridge_Defused );	//for nitmod
	OnTrigger( "Defused at the Cabin MG42.", Map.Cabin_MG42_Defused );
	OnTrigger( "Defused at Cabin MG42.", Map.Cabin_MG42_Defused );	//for nitmod
	OnTrigger( "Defused at the Cellar Entrance.", Map.Cellar_Entrance_Defused );
	OnTrigger( "Defused at Cellar Entrance.", Map.Cellar_Entrance_Defused );	//for nitmod
	OnTrigger( "Defused at the Cellar MG42.", Map.Cellar_MG42_Defused );
	OnTrigger( "Defused at Cellar MG42.", Map.Cellar_MG42_Defused );	//for nitmod
	OnTrigger( "Defused at the Command Post.", Map.Command_Post_Defused );
	OnTrigger( "Defused at Command Post.", Map.Command_Post_Defused );	//for nitmod
	OnTrigger( "Defused at the Communications Radio.", Map.Communications_Radio_Defused );
	OnTrigger( "Defused at Communications Radio.", Map.Communications_Radio_Defused );	//for nitmod
	OnTrigger( "Defused at the Complex Roof MG42.", Map.Complex_Roof_MG42_Defused );
	OnTrigger( "Defused at Complex Roof MG42.", Map.Complex_Roof_MG42_Defused );	//for nitmod
	OnTrigger( "Defused at the Footbridge.", Map.Footbridge_Defused );
	OnTrigger( "Defused at Footbridge.", Map.Footbridge_Defused );	//for nitmod
	OnTrigger( "Defused at the Garage Door.", Map.Garage_Door_Defused );
	OnTrigger( "Defused at Garage Door.", Map.Garage_Door_Defused );	//for nitmod
	OnTrigger( "Defused at the Garage Roof MG42.", Map.Garage_Roof_MG42_Defused );
	OnTrigger( "Defused at Garage Roof MG42.", Map.Garage_Roof_MG42_Defused );	//for nitmod
	OnTrigger( "Defused at the Generator.", Map.Generator_Defused );
	OnTrigger( "Defused at Generator.", Map.Generator_Defused );	//for nitmod
	OnTrigger( "Defused at the Window MG42.", Map.Window_MG42_Defused );
	OnTrigger( "Defused at Window MG42.", Map.Window_MG42_Defused );	//for nitmod
	OnTrigger( "Allies have Breached the Back Garage Door", Map.Axis_Door_Destroyed );
	OnTrigger( "Axis have destroyed the Foot Bridge", Map.Bridge_Destroyed );
	OnTrigger( "Outdoor Cabin MG42 Destroyed!", Map.Cabin_MG42_Destroyed );
	OnTrigger( "Allies have breached the cellar!", Map.Cellar_Entrance_Destroyed );
	OnTrigger( "Cellar MG42 Destroyed!", Map.Cellar_MG42_Destroyed );
	OnTrigger( "Allies destroyed the communications radio!", Map.Communications_Radio_Destroyed );
	OnTrigger( "Allies have Destroyed the Lab MG42", Map.Complex_Roof_MG42_Destroyed );
	OnTrigger( "Axis have Damaged the Foot Bridge", Map.Footbridge_Destroyed );
	OnTrigger( "Allies have breached the Garage Door", Map.Garage_Door_Destroyed );
	OnTrigger( "Axis have Destroyed the Garage MG42", Map.Allied_Garage_Roof_MG42_Destroyed );
	OnTrigger( "Allies have Destroyed the Garage MG42", Map.Axis_Garage_Roof_MG42_Destroyed );
	OnTrigger( "The Generator has been damaged!", Map.Generator_Destroyed );
	OnTrigger( "Indoor Cabin MG42 Destroyed!", Map.Window_MG42_Destroyed );
	OnTrigger( "Axis reclaim the Garage!", Map.checkpoint_Axis_Captured );
	OnTrigger( "Allies capture the Garage!", Map.checkpoint_Allies_Captured );
	OnTrigger( "Allied Command Post constructed. Charge speed increased!", Map.Allied_CP_Built );
	OnTrigger( "Axis team has destroyed the Allied Command Post!", Map.Allied_CP_Destroyed );
	OnTrigger( "Axis Command Post constructed. Charge speed increased!", Map.Axis_CP_Built );
	OnTrigger( "Allied team has destroyed the Axis Command Post!", Map.Axis_CP_Destroyed );
	OnTrigger( "garagedoor2_lever_goto", Map.garage_door2_lever );
	OnTrigger( "garagedoor2_goto", Map.garage_door2 );

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

	ETUtil.SwitchWeapon(WEAPON.MP40);
	ETUtil.SwitchWeapon(WEAPON.THOMPSON);
	ETUtil.SwitchWeapon(WEAPON.STEN);

	SetAvailableMapGoals( TEAM.AXIS, true, {
		"AMMOCAB_south_ammocabinet",
		"HEALTHCAB_south_healthcabinet",
		"BUILD_Command_Post",
		"BUILD_Garage_Roof_MG42",
		".*_Axis_Start_.*",
		".*_Axis_StartFront_.*",
		".*_Axis_StartBack_.*",
	});

	SetAvailableMapGoals( TEAM.AXIS, false, {
		"DEFEND_Axis_Start_.*",
		"SMOKEBOMB_Axis_Start_25",
		"AIRSTRIKE_Axis_Start_28",
		"ARTILLERY_S_Axis_Start_27",
		"CALLARTILLERY_Axis_Start_26",
	});

	SetAvailableMapGoals( TEAM.ALLIES, true, {
		"BUILD_Cabin_MG42",
		"BUILD_Window_MG42",
		"PLANT_Garage_Door",
		"PLANT_Axis_Door",
		"BUILD_Bridge",
		".*_Allied_Start_.*",
		".*_Allied_StartBack_.*",
	});

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

	SetGoalPriority( "PLANT_.*", 0.6, 0, CLASS.ENGINEER );

	SetGoalPriority( "AIRSTRIKE_Axis_Start_28", 0.81, TEAM.AXIS, CLASS.FIELDOPS );
	SetGoalPriority( "BUILD_Command_Post", 0.49, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "BUILD_Generator", 0.91, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "BUILD_Complex_Roof_MG42", 0.94, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "DEFEND_Axis_StartBack_.*", 0.5, TEAM.AXIS, 0 );
	SetGoalPriority( "DEFEND_Axis_StartFront_1", 0.505, TEAM.AXIS, 0 );
	SetGoalPriority( "DEFEND_Axis_StartFront_3", 0.505, TEAM.AXIS, 0 );
	SetGoalPriority( "DEFEND_Axis_Start_.*", 0.51, TEAM.AXIS, 0 );
	SetGoalPriority( "DEFEND_Axis_InfrontofWall_.*", 0.53, TEAM.AXIS, 0 );
	SetGoalPriority( "DEFEND_Axis_Radio_.*", 0.55, TEAM.AXIS, 0 );
	SetGoalPriority( "DEFEND_Axis_NearFootBridge_.*", 0.53, TEAM.AXIS, 0 );
	SetGoalPriority( "DEFEND_Axis_NearBridge_.*", 0.53, TEAM.AXIS, 0 );
	Util.LimitToClass( "DEFEND_Axis_NearFootBridge_1", TEAM.AXIS, CLASS.SOLDIER );
	SetGoalPriority( "DEFEND_Axis_NearFootBridge_1", 0.535, TEAM.AXIS, CLASS.SOLDIER );
	SetGoalPriority( "CHECKPOINT_checkpoint", 0.75, TEAM.AXIS, 0 );
	SetGoalPriority( "MOUNTMG42_Cellar_MG42", 0.72, TEAM.AXIS, CLASS.SOLDIER );
	SetGoalPriority( "MOUNTMG42_Complex_Roof_MG42", 0.72, TEAM.AXIS, CLASS.SOLDIER  );
	SetGoalPriority( "PLANT_Bridge", 0.94, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_Footbridge", 0.835, TEAM.AXIS, CLASS.COVERTOPS );
	Util.LimitToClass( "PLANT_Garage_Roof_MG42", TEAM.AXIS, CLASS.COVERTOPS );
	SetGoalPriority( "PLANT_Garage_Roof_MG42", 0.82, TEAM.AXIS, CLASS.COVERTOPS );
	SetGoalPriority( "PLANTMINE_Axis_Start_2.*", 0.8, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "PLANTMINE_Axis_CellarEntrance_6", 0.92, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "PLANTMINE_Axis_CellarEntrance_7", 0.92, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "PLANTMINE_Axis_CellarEntrance_8", 0.92, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "PLANTMINE_Axis_CellarEntrance_1", 0.925, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "PLANTMINE_Axis_CellarEntrance_5", 0.925, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "PLANTMINE_Axis_CellarEntrance_2", 0.93, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "PLANTMINE_Axis_CellarEntrance_3", 0.93, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "PLANTMINE_Axis_CellarEntrance_4", 0.93, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "PLANTMINE_Axis_NearBridge_.*", 0.93, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "REPAIRMG42_Cellar_MG42", 0.935, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "REPAIRMG42_Complex_Roof_MG42", 0.94, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "SMOKEBOMB_Axis_Start_13", 0.82, TEAM.AXIS, CLASS.COVERTOPS );
	SetGoalPriority( "SMOKEBOMB_Axis_GarageRoofMG42", 0.825, TEAM.AXIS, CLASS.COVERTOPS );
	SetGoalPriority( "SMOKEBOMB_Axis_StartFront_4", 0.826, TEAM.AXIS, CLASS.COVERTOPS );
	SetGoalPriority( "SMOKEBOMB_Axis_GarageDoorPlanted", 0.828, TEAM.AXIS, CLASS.COVERTOPS );
	SetGoalPriority( "SMOKEBOMB_Axis_NearBridge_12", 0.83, TEAM.AXIS, CLASS.COVERTOPS );


	SetGoalPriority( "ATTACK_Allied_StartBack_.*", 0.49, TEAM.ALLIES, 0 );
	SetGoalPriority( ".*_Allied_NearBridge_.*", 0.51, TEAM.ALLIES, 0 );
	SetGoalPriority( ".*_Allied_NearFootBridge_.*", 0.51, TEAM.ALLIES, 0 );

	//set up according to priorities of "PLANT_Cellar_Entrance" and PLANT_Communications_Radio
	SetGoalPriority( ".*_Allied_NearCellarEntrance_.*", 0.54, TEAM.ALLIES, 0 );
	SetGoalPriority( ".*_Allied_Radio_.*", 0.53, TEAM.ALLIES, 0 );

	SetGoalPriority( "BUILD_Bridge", 0.8, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "BUILD_Cabin_MG42", 0.92, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "BUILD_Window_MG42", 0.92, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_Garage_Door", 0.91, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_Generator", 0.92, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "PLANT_Axis_Door", 0.81, TEAM.ALLIES, CLASS.ENGINEER );

	//maybe decrease ? => but this is second route into complex
	SetGoalPriority( "PLANT_Cellar_Entrance", 0.82, TEAM.ALLIES, CLASS.ENGINEER );
	//maybe increase ? => main goal of map
	SetGoalPriority( "PLANT_Communications_Radio", 0.81, TEAM.ALLIES, CLASS.ENGINEER );
	///////////////////

	SetGoalPriority( "PLANT_Complex_Roof_MG42", 0.7, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_Complex_Roof_MG42", 0.85, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "PLANT_Cellar_MG42", 0.68, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_Cellar_MG42", 0.83, TEAM.ALLIES, CLASS.COVERTOPS );
	SetGoalPriority( "REPAIRMG42_Garage_Roof_MG42", 0.92, TEAM.ALLIES, CLASS.ENGINEER );

	// Max users per goal
	Util.SetMaxUsers( 1, "DEFEND_.*" );
	Util.SetMaxUsers( 1, "GRENADE_.*" );
	Util.SetMaxUsers( 1, "SMOKEBOMB_.*" );
	Util.SetMaxUsers( 1, "MOUNTMG42_.*" );
	Util.SetMaxUsers( 1, "REPAIRMG42_.*" );
	Util.SetMaxUsers( 1, "SWITCH_.*" );
	Util.SetMaxUsers( 4, "CHECKPOINT_.*" );

	// Camp times
	SetMapGoalProperties( "MOBILEMG42_.*", {MinCampTime=10, MaxCampTime=60} );

	Util.SetGoalPosition(451.329834, 2386.473389, 904.127625, "PLANT_Complex_Roof_MG42");
	Util.SetGoalPosition(-1212.830688, 1262.514282, 476.125000, "PLANT_Footbridge");
	Util.SetGoalPosition(1841.874878, -1408.765015, 552.125000, "PLANT_Command_Post");
	Util.SetGoalPosition(1029.013062, -1273.654663, 744.125549, "PLANT_Generator");
	Util.SetGoalPosition(1176.203125, -3015.928711, 542.125000, "PLANT_Window_MG42");
	Util.SetGoalPosition(514.973999, -2997.071045, 566.404846, "PLANT_Cabin_MG42");
	Util.SetGoalPosition(-87.861336, 3073.100830, 232.125000, "PLANT_Cellar_MG42");

	Util.AddUseWp( "PLANT_Axis_Door", "Axis_Door_Outdoor" );
	Util.AddUseWp( "PLANT_Axis_Door", "Axis_Door_Indoor" );
	Util.AddUseWp( "MOUNTMG42_Cellar_MG42", "cellarmg" );
	Util.AddUseWp( "REPAIRMG42_Cellar_MG42", "cellarmg" );
	Util.AddUseWp( "PLANT_Garage_Door", "garagedoor_1" );
	Util.AddUseWp( "PLANT_Garage_Door", "garagedoor_2" );
	Util.AddUseWp( "PLANT_Garage_Door", "garagedoor_3" );
	Util.AddUseWp( "PLANT_Bridge", "plantbridge" );

	Wp.SetWaypointFlag( "Axis_Door_1", "axis", true);
	Wp.SetWaypointFlag( "Axis_Door_1", "door", true);
	Wp.SetWaypointFlag( "Axis_Door", "axis", true);
	Wp.SetWaypointFlag( "Axis_Door", "door", true);
	Wp.SetWaypointFlag( "Axis_Tower", "closed", true);
	Wp.SetWaypointFlag( "Tower_1", "closed", true);
	Wp.SetWaypointFlag( "Tower_2", "closed", true);
	Wp.SetWaypointFlag( "JumpDown", "closed", true);

	NP1 = OnTriggerRegion(AABB(230.387,-1205.128,689.129,776.171,2016.875,1107.125), RegionTrigger.DisableBotPush);
	NP2 = OnTriggerRegion(AABB(256.526,-1388.904,721.125,320.875,-1293.956,1007.805), RegionTrigger.DisableBotPush);
	NP3 = OnTriggerRegion(AABB(-697.958,2625.805,358.125,-447.173,2829.505,666.479), RegionTrigger.DisableBotPush);
	NP4 = OnTriggerRegion(AABB(-292.202,2556.340,689.125,-209.597,2673.562,984.533), RegionTrigger.DisableBotPush);
	NP5 = OnTriggerRegion(AABB(341.177,2341.962,881.125,417.196,2411.823,1177.312), RegionTrigger.DisableBotPush);
	DCM1 = OnTriggerRegion(AABB(230.387,-1205.128,689.129,776.171,2016.875,1107.125), RegionTrigger.DisableCombatMovement);
	DCM2 = OnTriggerRegion(AABB(341.177,2341.962,881.125,417.196,2411.823,1177.312), RegionTrigger.DisableCombatMovement);
	DCMTrigger1 = OnTriggerRegion(AABB(166.399,-2566.056,550.369,360.259,-2447.125,668.621), RegionTrigger.DisableCombatMovement);
	DCM6 = OnTriggerRegion(AABB(-643.725,2006.483,359.186,-398.874,3598.632,811.125), RegionTrigger.DisableCombatMovement);
	NP6 = OnTriggerRegion(AABB(-643.725,2006.483,359.186,-398.874,3598.632,811.125), RegionTrigger.DisableBotPush);
	NP7 = OnTriggerRegion(AABB(435.329,3343.973,621.281,569.410,3480.874,763.125), RegionTrigger.DisableBotPush);
	DCM7 = OnTriggerRegion(AABB(435.329,3343.973,621.281,569.410,3480.874,763.125), RegionTrigger.DisableCombatMovement);
	trigger_PastRiver = OnTriggerRegion(AABB(-447.035,1274.117,209.125,1445.441,3681.839,1468.555), Map.Trigger_Past_River);
	trigger_AlliesInComplexUnderground = OnTriggerRegion(AABB(-384.875,1839.125,209.125,1408.875,3712.875,1533.159), Map.Trigger_AllyInComplex);
	trigger_AlliesInCanyon = OnTriggerRegion(AABB(-1557.835,1269.484,358.125,-447.125,3488.875,883.399), Map.Trigger_AllyInCanyon);


	MapRoutes =
	{
		CHECKPOINT_checkpoint =
		{
			ROUTE_Axis_ComplexSpawn =
			{
				ROUTE_Axis_Canyon_1 =
				{
					ROUTE_Wall =
					{
						ROUTE_Axis_Canyon_2 =
						{
							ROUTE_Axis_Canyon_3 =
							{
								ROUTE_Axis_Canyon_4 =
								{
									ROUTE_Axis_Canyon_5 =
									{
										ROUTE_Axis_NearGarage =
										{

										},
									},
								},
							},
						},
					},
				},
			},
			ROUTE_SmokebombAxis =
			{
				ROUTE_Axis_Canyon_1 =
				{
					ROUTE_Wall =
					{
						ROUTE_Axis_Canyon_2 =
						{
							ROUTE_Axis_Canyon_3 =
							{
								ROUTE_Axis_Canyon_4 =
								{
									ROUTE_Axis_Canyon_5 =
									{
										ROUTE_Axis_NearGarage =
										{

										},
									},
								},
							},
						},
					},
				},
			},
			ROUTE_PlantFootbridge =
			{
				ROUTE_Footbridge =
				{
					ROUTE_Wall =
					{
						ROUTE_Axis_Canyon_2 =
						{
							ROUTE_Axis_Canyon_3 =
							{
								ROUTE_Axis_Canyon_4 =
								{
									ROUTE_Axis_Canyon_5 =
									{
										ROUTE_Axis_NearGarage =
										{

										},
									},
								},
							},
						},
					},
				},
			},
			ROUTE_DestroyFootbridge_1 =
			{
				ROUTE_Wall =
				{
					ROUTE_Axis_Canyon_2 =
					{
						ROUTE_Axis_Canyon_3 =
						{
							ROUTE_Axis_Canyon_4 =
							{
								ROUTE_Axis_Canyon_5 =
								{
									ROUTE_Axis_NearGarage =
									{

									},
								},
							},
						},
					},
				},
			},
			ROUTE_DestroyFootbridge_2 =
			{
				ROUTE_Wall =
				{
					ROUTE_Axis_Canyon_2 =
					{
						ROUTE_Axis_Canyon_3 =
						{
							ROUTE_Axis_Canyon_4 =
							{
								ROUTE_Axis_Canyon_5 =
								{
									ROUTE_Axis_NearGarage =
									{

									},
								},
							},
						},
					},
				},
			},
		},
		DEFEND_Axis_Radio_1 =
		{
			ROUTE_Axis_ComplexSpawn =
			{
				ROUTE_InsideLadder =
				{
					ROUTE_Jump =	//the shortest way
					{

					},
					ROUTE_Stairs1 =
					{
						ROUTE_Stairs =
						{

						},
					},
				},
				ROUTE_Cellarentrance =
				{
					ROUTE_Cellarmg42 =
					{

					},
				},
				ROUTE_Sheetmetal_stairs =
				{
					ROUTE_Sheetmetal_stairs2 =
					{
						ROUTE_Radio =
						{

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

	MapRoutes.BUILD_Generator = MapRoutes.CHECKPOINT_checkpoint;
	MapRoutes.PLANT_Garage_Roof_MG42 = MapRoutes.CHECKPOINT_checkpoint;
	MapRoutes.DEFEND_Axis_Radio_2 = MapRoutes.DEFEND_Axis_Radio_1;
	MapRoutes.DEFEND_Axis_Radio_3 = MapRoutes.DEFEND_Axis_Radio_1;
	MapRoutes.DEFEND_Axis_Radio_4 = MapRoutes.DEFEND_Axis_Radio_1;
	MapRoutes.DEFEND_Axis_Radio_5 = MapRoutes.DEFEND_Axis_Radio_1;
	MapRoutes.DEFEND_Axis_Radio_6 = MapRoutes.DEFEND_Axis_Radio_1;
	MapRoutes.DEFEND_Axis_Radio_7 = MapRoutes.DEFEND_Axis_Radio_1;
	MapRoutes.DEFEND_Axis_Radio_8 = MapRoutes.DEFEND_Axis_Radio_1;
	MapRoutes.DEFEND_Axis_Radio_9 = MapRoutes.DEFEND_Axis_Radio_1;
	MapRoutes.DEFUSE_Communications_Radio_1 = MapRoutes.DEFEND_Axis_Radio_1;
	MapRoutes.DEFUSE_Communications_Radio_2 = MapRoutes.DEFEND_Axis_Radio_1;
	MapRoutes.DEFUSE_Communications_Radio_3 = MapRoutes.DEFEND_Axis_Radio_1;
	MapRoutes.DEFUSE_Communications_Radio_4 = MapRoutes.DEFEND_Axis_Radio_1;
	MapRoutes.DEFUSE_Communications_Radio_5 = MapRoutes.DEFEND_Axis_Radio_1;

	Util.Routes(MapRoutes);

	SetAvailableMapGoals( TEAM.AXIS, false, {
		"ROUTE_Footbridge",
		"ROUTE_Wall",
		"ROUTE_Cellarentrance",
	});

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

global OnBotJoin = function( bot )
{
	if ( Map.AxisChangeSpawn == 0 )
	{
		if ( Map.AlliedFlag == 0 )
		{
			Util.ChangeSpawn( TEAM.AXIS, 3 );
		}
		else
		{
			Util.ChangeSpawn( TEAM.AXIS, 2 );
		}
	}
	else
	{
		Util.ChangeSpawn( TEAM.AXIS, 2 );
	}

	bot.TargetBreakableDist = 100.0;
	bot.MaxViewDistance = 2400;
};
