global Map =
{

	Quiet = true, // this gets rid of all the goal initialization spam

	Switches =
	{
		door1 =
		{
			WaypointName = "door1",

			Enabled = true,
			Debug = false,
			Priority = 0.9,
			LimitTeam = (1<<TEAM.ALLIES),
			LimitClass = (1<<CLASS.COVERTOPS),
			Wait = function()
			{
				if ( Map.DoorStatus )
				{
					sleep(2);
					return true;
				}
				return false;
			},

		},





		door2 =
		{
			WaypointName = "door2",

			Enabled = true,
			Priority = 0.9,
			Debug = false,
			LimitTeam = (1<<TEAM.AXIS),
			LimitClass = (1<<CLASS.COVERTOPS),



			Wait = function()
			{
				if ( Map.DoorStatus )
				{
					sleep(2);
					return true;
				}
				return false;
			},

		},
	},









	Ammo_Cabinet_north_ammocabinet = "AMMOCAB_north_ammocabinet",
	Ammo_Cabinet_north_ammocabinet_1 = "AMMOCAB_north_ammocabinet_1",
	Ammo_Cabinet_south_ammocabinet = "AMMOCAB_south_ammocabinet",
	Health_Cabinet_north_healthcabinet = "HEALTHCAB_north_healthcabinet",
	Health_Cabinet_north_healthcabinet_1 = "HEALTHCAB_north_healthcabinet_1",
	Health_Cabinet_south_healthcabinet = "HEALTHCAB_south_healthcabinet",
	Call_Artillery_Allied_Bunker_Arty = "CALLARTILLERY_Allied_Bunker_Arty",
	Call_Artillery_Allied_Bunker_Arty_2 = "CALLARTILLERY_Allied_Bunker_Arty_2",
	Call_Artillery_Allied_Gate_Defence = "CALLARTILLERY_Allied_Gate_Defence",
	Call_Artillery_Axis_Road_Bunker_Defence = "CALLARTILLERY_Axis_Road_Bunker_Defence",
	Call_Artillery_Balcony_Arty_1 = "CALLARTILLERY_Balcony_Arty_1",
	Call_Artillery_Balcony_Arty_2 = "CALLARTILLERY_Balcony_Arty_2",
	Call_Artillery_Balcony_Arty_3 = "CALLARTILLERY_Balcony_Arty_3",
	Call_Artillery_Bridge_Arty_Target_1 = "CALLARTILLERY_Bridge_Arty_Target_1",
	Call_Artillery_MG_Arty = "CALLARTILLERY_MG_Arty",
	Call_Artillery_Main_Road_Arty_Spot_2 = "CALLARTILLERY_Main_Road_Arty_Spot_2",
	Call_Artillery_Main_Road_Arty_Spot_3 = "CALLARTILLERY_Main_Road_Arty_Spot_3",
	Call_Artillery_Main_Road_Arty_Spot_4 = "CALLARTILLERY_Main_Road_Arty_Spot_4",
	Call_Artillery_North_Radar_Defence_2 = "CALLARTILLERY_North_Radar_Defence_2",
	Call_Artillery_North_Radar_Defence_4 = "CALLARTILLERY_North_Radar_Defence_4",
	Call_Artillery_North_Radar_Defence_6 = "CALLARTILLERY_North_Radar_Defence_6",
	Call_Artillery_North_Radar_Defence_8 = "CALLARTILLERY_North_Radar_Defence_8",
	Call_Artillery_North_Radar_Defence_9 = "CALLARTILLERY_North_Radar_Defence_9",
	Call_Artillery_North_Road_Defence_1 = "CALLARTILLERY_North_Road_Defence_1",
	Call_Artillery_Road_Bunker_2 = "CALLARTILLERY_Road_Bunker_2",
	Call_Artillery_Road_Bunker_3 = "CALLARTILLERY_Road_Bunker_3",
	Call_Artillery_Road_Bunker_4 = "CALLARTILLERY_Road_Bunker_4",
	Call_Artillery_South_Radar_Defence_2 = "CALLARTILLERY_South_Radar_Defence_2",
	Call_Artillery_South_Radar_Defence_3 = "CALLARTILLERY_South_Radar_Defence_3",
	Call_Artillery_South_Radar_Defence_4 = "CALLARTILLERY_South_Radar_Defence_4",
	Call_Artillery_Supplies_Arty_Spot = "CALLARTILLERY_Supplies_Arty_Spot",
	Call_Artillery_Supply_Arty_3 = "CALLARTILLERY_Supply_Arty_3",
	Artillery_D_133 = "ARTILLERY_D_133",
	Artillery_D_188 = "ARTILLERY_D_188",
	Artillery_D_224 = "ARTILLERY_D_224",
	Artillery_D_241 = "ARTILLERY_D_241",
	Artillery_D_245 = "ARTILLERY_D_245",
	Artillery_D_249 = "ARTILLERY_D_249",
	Artillery_D_289 = "ARTILLERY_D_289",
	Artillery_D_291 = "ARTILLERY_D_291",
	Artillery_D_355 = "ARTILLERY_D_355",
	Artillery_D_367 = "ARTILLERY_D_367",
	Artillery_D_376 = "ARTILLERY_D_376",
	Artillery_D_377 = "ARTILLERY_D_377",
	Artillery_D_390 = "ARTILLERY_D_390",
	Artillery_D_516 = "ARTILLERY_D_516",
	Artillery_D_555 = "ARTILLERY_D_555",
	Artillery_D_570 = "ARTILLERY_D_570",
	Artillery_D_571 = "ARTILLERY_D_571",
	Artillery_D_989 = "ARTILLERY_D_989",
	Artillery_D_Allied_Gate_Defence = "ARTILLERY_D_Allied_Gate_Defence",
	Artillery_D_Axis_Road_Bunker_Defence = "ARTILLERY_D_Axis_Road_Bunker_Defence",
	Artillery_D_Axis_Spawn_Mine_4 = "ARTILLERY_D_Axis_Spawn_Mine_4",
	Artillery_D_Bridge_Arty_Target = "ARTILLERY_D_Bridge_Arty_Target",
	Artillery_D_Bridge_Arty_Target_1 = "ARTILLERY_D_Bridge_Arty_Target_1",
	Artillery_D_Bridge_Arty_Target_2 = "ARTILLERY_D_Bridge_Arty_Target_2",
	Artillery_D_Bridge_Arty_Target_3 = "ARTILLERY_D_Bridge_Arty_Target_3",
	Artillery_D_Bridge_Arty_Target_4 = "ARTILLERY_D_Bridge_Arty_Target_4",
	Artillery_D_Bridge_Arty_Target_5 = "ARTILLERY_D_Bridge_Arty_Target_5",
	Artillery_D_Bridge_Arty_Target_6 = "ARTILLERY_D_Bridge_Arty_Target_6",
	Artillery_D_Bridge_Arty_Target_7 = "ARTILLERY_D_Bridge_Arty_Target_7",
	Artillery_D_Bridge_Arty_Target_8 = "ARTILLERY_D_Bridge_Arty_Target_8",
	Artillery_D_Main_Road_Mine_2 = "ARTILLERY_D_Main_Road_Mine_2",
	Artillery_D_North_Radar_Defence_2 = "ARTILLERY_D_North_Radar_Defence_2",
	Artillery_D_North_Radar_Defence_4 = "ARTILLERY_D_North_Radar_Defence_4",
	Artillery_D_North_Radar_Defence_6 = "ARTILLERY_D_North_Radar_Defence_6",
	Artillery_D_North_Radar_Defence_8 = "ARTILLERY_D_North_Radar_Defence_8",
	Artillery_D_North_Radar_Defence_9 = "ARTILLERY_D_North_Radar_Defence_9",
	Artillery_D_South_Radar_Defence_4 = "ARTILLERY_D_South_Radar_Defence_4",
	Artillery_D_South_Radar_Mine_4 = "ARTILLERY_D_South_Radar_Mine_4",
	Artillery_D_Supply_Arty_2 = "ARTILLERY_D_Supply_Arty_2",
	Artillery_D_Truck_Arty_1 = "ARTILLERY_D_Truck_Arty_1",
	Artillery_D_Truck_Arty_2 = "ARTILLERY_D_Truck_Arty_2",
	Flag_docscaptured = "FLAG_docscaptured",
	Cappoint_812 = "CAPPOINT_812",
	Cappoint_835 = "CAPPOINT_835",
	Cappoint_843 = "CAPPOINT_843",
	Build_2_Allied_Quick_Access_Bridge = "BUILD_2_Allied_Quick_Access_Bridge",
	Build_Allied_Command_Post = "BUILD_Allied_Command_Post",
	Build_Allied_MG42_Construction = "BUILD_Allied_MG42_Construction",
	Build_Axis_MG42_Construction = "BUILD_Axis_MG42_Construction",
	Build_Command_Post = "BUILD_Command_Post",
	Plant_2_Allied_Quick_Access_Bridge = "PLANT_2_Allied_Quick_Access_Bridge",
	Plant_Allied_Command_Post = "PLANT_Allied_Command_Post",
	Plant_Allied_MG42_Construction = "PLANT_Allied_MG42_Construction",
	Plant_Axis_MG42_Construction = "PLANT_Axis_MG42_Construction",
	Plant_Axis_tunnel_gate = "PLANT_Axis_tunnel_gate",
	Plant_Command_Post = "PLANT_Command_Post",
	Plant_North_Radar_1 = "PLANT_North_Radar_1",
	Plant_Radar_1_door = "PLANT_Radar_1_door",
	Plant_Radar_2_door = "PLANT_Radar_2_door",
	Plant_South_Radar_2 = "PLANT_South_Radar_2",
	Mount_680 = "MOUNTMG42_680",
	Mount_818 = "MOUNTMG42_818",
	Mount_Allied_MG42_Construction = "MOUNTMG42_Allied_MG42_Construction",
	Mount_Axis_MG42_Construction = "MOUNTMG42_Axis_MG42_Construction",
	Repair_680 = "REPAIRMG42_680",
	Repair_818 = "REPAIRMG42_818",
	Repair_Allied_MG42_Construction = "REPAIRMG42_Allied_MG42_Construction",
	Repair_Axis_MG42_Construction = "REPAIRMG42_Axis_MG42_Construction",
	Mobile_MG42_168 = "MOBILEMG42_168",
	Mobile_MG42_310 = "MOBILEMG42_310",
	Mobile_MG42_325 = "MOBILEMG42_325",
	Mobile_MG42_349 = "MOBILEMG42_349",
	Mobile_MG42_513 = "MOBILEMG42_513",
	Mobile_MG42_Allied_Bunker_Arty_2 = "MOBILEMG42_Allied_Bunker_Arty_2",
	Mobile_MG42_Allied_Gate_Defence = "MOBILEMG42_Allied_Gate_Defence",
	Mobile_MG42_Allied_Tunnel_Defence = "MOBILEMG42_Allied_Tunnel_Defence",
	Mobile_MG42_Axis_Bunker_Tunnel_Defence_1 = "MOBILEMG42_Axis_Bunker_Tunnel_Defence_1",
	Mobile_MG42_Axis_Bunker_Tunnel_Defence_2 = "MOBILEMG42_Axis_Bunker_Tunnel_Defence_2",
	Mobile_MG42_Axis_Office_Defence_2 = "MOBILEMG42_Axis_Office_Defence_2",
	Mobile_MG42_Axis_Road_Bunker_Defence = "MOBILEMG42_Axis_Road_Bunker_Defence",
	Mobile_MG42_Axis_Tunnel_Defence = "MOBILEMG42_Axis_Tunnel_Defence",
	Mobile_MG42_Balcony_Arty_1 = "MOBILEMG42_Balcony_Arty_1",
	Mobile_MG42_Balcony_Arty_2 = "MOBILEMG42_Balcony_Arty_2",
	Mobile_MG42_Balcony_Arty_3 = "MOBILEMG42_Balcony_Arty_3",
	Mobile_MG42_CP_Defence_1 = "MOBILEMG42_CP_Defence_1",
	Mobile_MG42_CP_Defence_2 = "MOBILEMG42_CP_Defence_2",
	Mobile_MG42_North_Radar_Defence_1 = "MOBILEMG42_North_Radar_Defence_1",
	Mobile_MG42_North_Radar_Defence_5 = "MOBILEMG42_North_Radar_Defence_5",
	Mobile_MG42_North_Radar_Defence_7 = "MOBILEMG42_North_Radar_Defence_7",
	Mobile_MG42_North_Radar_Defence_8 = "MOBILEMG42_North_Radar_Defence_8",
	Mobile_MG42_North_Road_Defence_1 = "MOBILEMG42_North_Road_Defence_1",
	Mobile_MG42_Road_Bunker_2 = "MOBILEMG42_Road_Bunker_2",
	Mobile_MG42_South_Radar_Defence_1 = "MOBILEMG42_South_Radar_Defence_1",
	Mobile_MG42_South_Radar_Defence_2 = "MOBILEMG42_South_Radar_Defence_2",
	Mobile_MG42_South_Radar_Defence_3 = "MOBILEMG42_South_Radar_Defence_3",
	Mobile_MG42_South_Radar_Defence_4 = "MOBILEMG42_South_Radar_Defence_4",
	Mobile_MG42_Supply_Arty_2 = "MOBILEMG42_Supply_Arty_2",

	Snipe_147 = "SNIPE_147",
	Snipe_151 = "SNIPE_151",
	Snipe_168 = "SNIPE_168",
	Snipe_181 = "SNIPE_181",
	Snipe_202 = "SNIPE_202",
	Snipe_306 = "SNIPE_306",
	Snipe_310 = "SNIPE_310",
	Snipe_337 = "SNIPE_337",
	Snipe_339 = "SNIPE_339",
	Snipe_340 = "SNIPE_340",
	Snipe_349 = "SNIPE_349",
	Snipe_444 = "SNIPE_444",
	Snipe_506 = "SNIPE_506",
	Snipe_512 = "SNIPE_512",
	Snipe_513 = "SNIPE_513",
	Snipe_Allied_Bunker_Arty = "SNIPE_Allied_Bunker_Arty",
	Snipe_Allied_Bunker_Arty_2 = "SNIPE_Allied_Bunker_Arty_2",
	Snipe_Allied_Tunnel_Defence = "SNIPE_Allied_Tunnel_Defence",
	Snipe_Axis_Bunker_Tunnel_Defence_1 = "SNIPE_Axis_Bunker_Tunnel_Defence_1",
	Snipe_Axis_Bunker_Tunnel_Defence_2 = "SNIPE_Axis_Bunker_Tunnel_Defence_2",
	Snipe_Axis_Bunker_Tunnel_Defence_3 = "SNIPE_Axis_Bunker_Tunnel_Defence_3",
	Snipe_Axis_Office_Defence_1 = "SNIPE_Axis_Office_Defence_1",
	Snipe_Axis_Office_Defence_2 = "SNIPE_Axis_Office_Defence_2",
	Snipe_Axis_Road_Bunker_Defence = "SNIPE_Axis_Road_Bunker_Defence",
	Snipe_Axis_Tunnel_Defence = "SNIPE_Axis_Tunnel_Defence",
	Snipe_Balcony_Arty_1 = "SNIPE_Balcony_Arty_1",
	Snipe_Balcony_Arty_2 = "SNIPE_Balcony_Arty_2",
	Snipe_Balcony_Arty_3 = "SNIPE_Balcony_Arty_3",
	Snipe_CP_Defence_1 = "SNIPE_CP_Defence_1",
	Snipe_CP_Defence_2 = "SNIPE_CP_Defence_2",
	Snipe_Main_Road_Arty_Spot_2 = "SNIPE_Main_Road_Arty_Spot_2",
	Snipe_North_Radar_Defence_1 = "SNIPE_North_Radar_Defence_1",
	Snipe_North_Radar_Defence_3 = "SNIPE_North_Radar_Defence_3",
	Snipe_North_Radar_Defence_6 = "SNIPE_North_Radar_Defence_6",
	Snipe_North_Radar_Defence_7 = "SNIPE_North_Radar_Defence_7",
	Snipe_North_Radar_Defence_8 = "SNIPE_North_Radar_Defence_8",
	Snipe_North_Radar_Defence_9 = "SNIPE_North_Radar_Defence_9",
	Snipe_North_Road_Defence_1 = "SNIPE_North_Road_Defence_1",
	Snipe_Road_Bunker_2 = "SNIPE_Road_Bunker_2",
	Snipe_Road_Bunker_3 = "SNIPE_Road_Bunker_3",
	Snipe_Road_Bunker_4 = "SNIPE_Road_Bunker_4",
	Snipe_South_Radar_Defence_1 = "SNIPE_South_Radar_Defence_1",
	Snipe_South_Radar_Defence_2 = "SNIPE_South_Radar_Defence_2",
	Snipe_South_Radar_Defence_3 = "SNIPE_South_Radar_Defence_3",
	Snipe_South_Radar_Defence_4 = "SNIPE_South_Radar_Defence_4",
	Snipe_South_Radar_Defence_5 = "SNIPE_South_Radar_Defence_5",
	Snipe_Supplies_Arty_Spot = "SNIPE_Supplies_Arty_Spot",
	Snipe_Supply_Arty_2 = "SNIPE_Supply_Arty_2",
//~	Snipe_Waypointed_Map_by_Mandoryllyan_for_Omnibot_0.52_December_2005 = "SNIPE_Waypointed_Map_by_Mandoryllyan_for_Omnibot_0.52_December_2005",
	Plant_Mine_554 = "PLANTMINE_554",
	Plant_Mine_Axis_Spawn_Mine_1 = "PLANTMINE_Axis_Spawn_Mine_1",
	Plant_Mine_Axis_Spawn_Mine_2 = "PLANTMINE_Axis_Spawn_Mine_2",
	Plant_Mine_Axis_Spawn_Mine_3 = "PLANTMINE_Axis_Spawn_Mine_3",
	Plant_Mine_Gate_Mine_1 = "PLANTMINE_Gate_Mine_1",
	Plant_Mine_Gate_Mine_2 = "PLANTMINE_Gate_Mine_2",
	Plant_Mine_Main_Road_Mine_2 = "PLANTMINE_Main_Road_Mine_2",
	Plant_Mine_South_Radar_Mine_1 = "PLANTMINE_South_Radar_Mine_1",
	Plant_Mine_South_Radar_Mine_2 = "PLANTMINE_South_Radar_Mine_2",
	Plant_Mine_South_Radar_Mine_3 = "PLANTMINE_South_Radar_Mine_3",
	Plant_Mine_South_Radar_Mine_4 = "PLANTMINE_South_Radar_Mine_4",

	DoorStatus = 0, //closed

	BUILD__Allied_Quick_Access_Bridge_Built = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"PLANT_Radar_1_door",
			"BUILD_Allied_Command_Post",
			"PLANT_Allied_door",
			"PLANT_Radar_2_door",
			"PLANT_Axis_tunnel_gate",
		});
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_.*" );

		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"FLAG_docscaptured",
			"CAPPOINT_.*",
		});


		print( "BUILD_2_Allied_Quick_Access_Bridge_Built" );
	},

	Allied_Command_Post_Built = function( trigger )
	{
		print( "Allied_Command_Post_Built" );
	},

	Allied_MG42_Construction_Built = function( trigger )
	{
		print( "Allied_MG42_Construction_Built" );
	},

	Axis_MG42_Construction_Built = function( trigger )
	{
		print( "Axis_MG42_Construction_Built" );
	},

	Command_Post_Built = function( trigger )
	{
		print( "Command_Post_Built" );
	},

	PLANT__Allied_Quick_Access_Bridge_Destroyed = function( trigger )
	{
		print( "PLANT__Allied_Quick_Access_Bridge_Destroyed" );
	},

	Allied_Command_Post_Destroyed = function( trigger )
	{
		print( "Allied_Command_Post_Destroyed" );
	},

	Allied_MG42_Construction_Destroyed = function( trigger )
	{
		print( "Allied_MG42_Construction_Destroyed" );
	},

	Axis_MG42_Construction_Destroyed = function( trigger )
	{
		print( "Axis_MG42_Construction_Destroyed" );
	},

	Axis_tunnel_gate_Destroyed = function( trigger )
	{
		print( "Axis_tunnel_gate_Destroyed" );
	},

	Command_Post_Destroyed = function( trigger )
	{
		print( "Command_Post_Destroyed" );
	},

	North_Radar_1_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_radar_1.*",
			"MOBILEMG42_roof1",
			"MOBILEMG42_radar1mg2",
		});
		SetAvailableMapGoals( TEAM.AXIS, true, {
			"DEFEND_aux2",
			"DEFEND_aux2a",
		});
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_r1.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"MOUNTMG42_680",
			"ARTILLERY_D_rdr",
			"ARTILLERY_S_rdr",
			"CALLARTILLERY_rdr",
		});
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"ARTILLERY_D_rdr",
			"ARTILLERY_S_rdr",
			"CALLARTILLERY_rdr1",
			"ATTACK_mg.*",
		});

		print( "North_Radar_1_Destroyed" );
	},

	Radar_1_door_Destroyed = function( trigger )
	{

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


		print( "Radar_1_door_Destroyed" );
	},

	Radar_2_door_Destroyed = function( trigger )
	{

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


		print( "Radar_2_door_Destroyed" );
	},

	South_Radar_2_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radar_2.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, {
			"DEFEND_aux1",
			"DEFEND_aux1a",
		});
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_r2.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "MOBILEMG42_radar2mg" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "ARTILLERY_S_radar" );
		SetAvailableMapGoals( TEAM.AXIS, false, "ARTILLERY_S_radar" );

		print( "South_Radar_2_Destroyed" );
	},

	docscaptured_Taken = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_alien.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_cap.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_cap.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"PLANT__Allied_Quick_Access_Bridge",
			"MOUNTMG42_818",
		});

		print( "docscaptured_Taken" );
	},

	docscaptured_returned = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_alien.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_cap.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_cap.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_818" );

		print( "docscaptured returned" );
	},

/*

	CAPPOINT_812_Captured = function( trigger )
	{
		print( "CAPPOINT_812_Captured" );
	},
*/
	CAPPOINT_835_Captured = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_cap.*",
			"DEFEND_alien.*",
		});
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"ATTACK_cap.*",
			"SNIPE_spawnsnipe",
		});
		SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_680" );
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"PLANT__Allied_Quick_Access_Bridge",
			"PLANT_Allied_Command_Post",
			"SNIPE_spawn1",
			"MOUNTMG42_818",
			"PLANTMINE_al.*",
		});
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_mg.*" );



		print( "CAPPOINT_835_Captured" );
	},

	CAPPOINT_843_Captured = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_cap.*",
			"DEFEND_alien.*",
		});
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"ATTACK_cap.*",
			"SNIPE_spawnsnipe",
		});
		SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_680" );
		print( "CAPPOINT_843_Captured" );
	},

/*
	base_gate1_goto = function(trigger)
	{
			// disable the switch immediately
			Map.Switches.door1.Enabled = false;
			Map.Switches.door2.Enabled = true;
			print( "Door off" );
	},
*/
	door_open = function(trigger)
	{

		vel = ToVector(trigger.Action);

		if ( vel.z > 0 )
		{



				Map.Switches.door2.Enabled = true;
				Map.Switches.door1.Enabled = false;
				SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Axis_tunnel_gate" );
				Map.DoorStatus = 1;
				print( "Open" );
		}

		else if ( vel.z < 0 )
		{
				Map.Switches.door2.Enabled = false;
				Map.Switches.door1.Enabled = true;
			//~	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Axis_tunnel_gate" );
				Map.DoorStatus = 0;
				print("^1Closed");
		}


	},





};

global OnMapLoad = function()
{
	OnTrigger( "Allied have built the Allied Spawn Bridge!", Map.BUILD__Allied_Quick_Access_Bridge_Built );
	OnTrigger( "MISSING_STRING", Map.Allied_Command_Post_Built );
	OnTrigger( "MISSING_STRING", Map.Allied_MG42_Construction_Built );
	OnTrigger( "MISSING_STRING", Map.Axis_MG42_Construction_Built );
	OnTrigger( "MISSING_STRING", Map.Command_Post_Built );
	OnTrigger( "MISSING_STRING", Map.PLANT__Allied_Quick_Access_Bridge_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Allied_Command_Post_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Allied_MG42_Construction_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Axis_MG42_Construction_Destroyed );
	OnTrigger( "The Allies have destroyed the Axis tunnel gate!", Map.Axis_tunnel_gate_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Command_Post_Destroyed );
	OnTrigger( "Allied team has disabled the North Radar 1!", Map.North_Radar_1_Destroyed );
	OnTrigger( "^1Allied have blown Radar 1 door!!", Map.Radar_1_door_Destroyed );
	OnTrigger( "^1Allied have blown Radar 2 door!!", Map.Radar_2_door_Destroyed );
	OnTrigger( "Allied team has disabled the South Radar!", Map.South_Radar_2_Destroyed );
	OnTrigger( "Allies have stolen the Baby Alien!", Map.docscaptured_Taken );
	OnTrigger( "Flag returned docscaptured!", Map.docscaptured_returned );
//~	OnTrigger( "MISSING_STRING", Map.CAPPOINT_812_Captured );
	OnTrigger( "Allies have transmitted the documents!", Map.CAPPOINT_835_Captured );
//~	OnTrigger( "base_gate1_goto", Map.base_gate1_goto );
	OnTrigger( "base_lever1_goto", Map.door_open );

	SetAvailableMapGoals( TEAM.AXIS, false, ".*" );
	SetAvailableMapGoals( TEAM.ALLIES, false, ".*" );
	SetAvailableMapGoals( TEAM.AXIS, true, "SNIPE_spawn1" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD__Allied_Quick_Access_Bridge" );
	SetAvailableMapGoals( TEAM.AXIS, true, {
		"DEFEND_radar.*",
		"MOBILEMG42_roof1",
		"MOBILEMG42_radar1mg2",
		"DEFEND_alien.*",
		"HEALTHCAB_.*",
		"ARTILLERY_D_rdr",
		"ARTILLERY_S_rdr",
		"CALLARTILLERY_rdr",
		"ARTILLERY_S_radar",
		"CALLARTILLERY_axis1",
		"AMMOCAB_.*",
		"PLANT__Allied_Quick_Access_Bridge",
		"MOBILEMG42_radar2mg",
		"MOUNTMG42_818",
		"PLANTMINE_al.*",
	});
	SetAvailableMapGoals( TEAM.ALLIES, true, {
		"HEALTHCAB_.*",
		"AMMOCAB_.*",
		"ATTACK_r1.*",
		"ATTACK_r2.*",
		"ARTILLERY_D_rdr",
		"ARTILLERY_S_rdr",
		"ARTILLERY_S_radar",
		"CALLARTILLERY_rdr1",
		"CALLARTILLERY_allied1",
	});


	Util.SetMaxUsersInProgress( 1, "DEFEND_.*" );
	Util.SetMaxUsersInProgress( 1, "PLANT_.*" );
	Util.SetMaxUsersInProgress( 1, "BUILD_.*" );
	Util.SetMaxUsersInProgress( 1, "MOUNT_.*" );
	Util.SetMaxUsersInProgress( 1, "ATTACK_.*" );
	Util.SetMaxUsersInProgress( 1, "MOUNTMG42_.*" );

	Util.SetGoalPosition( -598,2035,32.1, "PLANT_Axis_tunnel_gate" );
	Util.SetGoalPosition( 1093,1831,404, "MOBILEMG42_radar1mg2" );
	Util.SetGoalPosition( -3100,1529,-168, "DEFEND_cap4" );
	Util.SetGoalPosition( -3037,940,-168, "DEFEND_cap2" );
	Util.SetGoalPosition( -3655,744,-168, "DEFEND_cap1" );
	Util.SetGoalPosition( 1434.5,269,344, "ATTACK_r2a" );
	SetMapGoalProperties( "DEFEND_.*", {mincamptime=25, maxcamptime=90} );
	SetMapGoalProperties( "MOUNT_.*", {mincamptime=15, maxcamptime=40} );
	SetMapGoalProperties( "MOBILEMG42_.*", {mincamptime=25, maxcamptime=90} );
	SetMapGoalProperties( "ATTACK_.*", {mincamptime=25, maxcamptime=90} );
	SetMapGoalProperties( "CAMP_.*", {mincamptime=35, maxcamptime=90} );

//~	SetGoalPriority( "DEFEND_cap.*", 0.99 );
//~	SetGoalPriority( "DEFEND_alien.*", 0.99 );
	SetGoalPriority( "PLANT_Axis_tunnel_gate", 0.95 );
    SetGoalPriority( "PLANT_Allied_door", 0.93 );




		Map.Switches.door1.Enabled = true;
			Map.Switches.door2.Enabled = false;


	Util.UpdateSwitchData();
	Util.MapDebugPrint ();

	print( "OnMapLoad" );
};


global OnBotJoin = function( bot )
{
	 bot.TargetBreakableDist = 300.0;
};
