global Map =
{
	Ammo_Cabinet_south_ammocabinet = "AMMOCAB_south_ammocabinet",
	Ammo_Cabinet_south_ammocabinet_1 = "AMMOCAB_south_ammocabinet_1",
	Health_Cabinet_south_healthcabinet = "HEALTHCAB_south_healthcabinet",
	Health_Cabinet_south_healthcabinet_1 = "HEALTHCAB_south_healthcabinet_1",
	Call_Artillery_184 = "CALLARTILLERY_184",
	Call_Artillery_320 = "CALLARTILLERY_320",
	Call_Artillery_527 = "CALLARTILLERY_527",
	Call_Artillery_58 = "CALLARTILLERY_58",
	Artillery_S_114 = "ARTILLERY_S_114",
	Artillery_S_arty1 = "ARTILLERY_S_arty1",
	Checkpoint_bunker_flag = "CHECKPOINT_bunker_flag",
	Flag_allied_gold = "FLAG_allied_gold",
	Cappoint_235 = "CAPPOINT_235",
	Build_Anty_Spawn_Killer = "BUILD_Anty_Spawn_Killer",
	Build_Command_Post = "BUILD_Command_Post",
	Plant_Alter_Pass = "PLANT_Alter_Pass",
	Plant_Anty_Spawn_Killer = "PLANT_Anty_Spawn_Killer",
	Plant_Church_Door = "PLANT_Church_Door",
	Plant_Command_Post = "PLANT_Command_Post",
	Plant_Getto_Wall = "PLANT_Getto_Wall",
	Plant_Sacristy_Window = "PLANT_Sacristy_Window",
	Plant_Towers_Secret_Entrance = "PLANT_Towers_Secret_Entrance",
	Mount_173 = "MOUNTMG42_173",
	Mount_268 = "MOUNTMG42_268",
	Repair_173 = "REPAIRMG42_173",
	Repair_268 = "REPAIRMG42_268",

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

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

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

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

	Church_Door_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"FLAG_allied_gold",
			"CAPPOINT_235",
			"PLANT_Sacristy_Window",
		});
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_church.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_door.*" );

		Util.MapDebugPrint( "Church_Door_Destroyed" );
	},

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

	Getto_Wall_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_dyno.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"CHECKPOINT_bunker_flag",
			"PLANT_Alter_Pass",
			"PLANT_Church_Door",
			"ATTACK_at.*",
		});

		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_wall.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_door.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "MOBILEMG42_axismg1" );

		Util.MapDebugPrint( "Getto_Wall_Destroyed" );
	},

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

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

	allied_gold_Taken = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_church.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_obj_.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_at.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_cap_.*" );

		Util.MapDebugPrint( "allied_gold_Taken" );
	},

	gold_returned = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_church.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_at.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_cap_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_obj_.*" );

		Util.MapDebugPrint( "allied_gold_returned" );
	},

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

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

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

global OnMapLoad = function()
{
	OnTrigger( "MISSING_STRING", Map.Anty_Spawn_Killer_Built );
	OnTrigger( "MISSING_STRING", Map.Command_Post_Built );
	OnTrigger( "The Allies are able to use The Alter Pass now!", Map.Alter_Pass_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Anty_Spawn_Killer_Destroyed );
	OnTrigger( "Allies has destroyed The Church Doors!", Map.Church_Door_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Command_Post_Destroyed );
	OnTrigger( "Allies has destroyed Getto Wall!", Map.Getto_Wall_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Sacristy_Window_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Towers_Secret_Entrance_Destroyed );
	OnTrigger( "Allies have taken The Radio Parts!", Map.allied_gold_Taken );
	OnTrigger( "Flag returned allied_gold!", Map.gold_returned );
	OnTrigger( "MISSING_STRING", Map.CAPPOINT_235_Captured );
	OnTrigger( "MISSING_STRING", Map.bunker_flag_Axis_Captured );
	OnTrigger( "MISSING_STRING", Map.bunker_flag_Allies_Captured );

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

	SetAvailableMapGoals( TEAM.ALLIES, true, {
		"PLANT_Getto_Wall",
		"ATTACK_dyno.*",
	});

	SetAvailableMapGoals( TEAM.AXIS, true, {
		"DEFEND_wall.*",
		"MOBILEMG42_axismg1",
	});

	Util.SetMaxUsers( 1, "DEFEND_.*" );
	Util.SetMaxUsers( 1, "MOUNTMG42_.*" );

//	SetMapGoalProperties( "DEFEND_.*", {MinCampTime=30, MaxCampTime=90} );
	SetMapGoalProperties( "MOUNT_.*", {MinCampTime=15, MaxCampTime=40} );
	SetMapGoalProperties( "MOBILEMG42_.*", {MinCampTime=60, MaxCampTime=90} );
//	SetMapGoalProperties( "ATTACK_.*", {MinCampTime=25, MaxCampTime=60} );

	Util.EnableGoal("ROUTE.*"); //enables for both teams

	Util.EnableGoal("AMMOCAB_.*"); //enables for both teams

	Util.EnableGoal("HEALTHCAB_.*"); //enables for both teams
	Util.SetGoalPosition( 1038, 3491, 63.4, "PLANT_Getto_Wall" );
	Util.SetGoalPosition( 3094, 4106.4, 29.2, "PLANT_Alter_Pass" );

	MapRoutes =
	{
		PLANT_Getto_Wall =
		{
			ROUTE_firstspawn  =
			{
				ROUTE_rt1  =
				{
					ROUTE_rt2  =
					{
						ROUTE_rt3  =
						{
							ROUTE_rt200  =
							{
							},
						},
						ROUTE_rt99  =
						{
							ROUTE_rt100  =
							{
							},
						},
					},
					ROUTE_rt3  =
					{
						ROUTE_rt200  =
						{
						},
					},
				},
			},
		},

		FLAG_allied_gold =
		{
			ROUTE_secondspawn  =
			{
				ROUTE_ch1  =
				{
					ROUTE_ch99  =
					{
						ROUTE_ch51  =
						{
							ROUTE_ch49  =
							{
								ROUTE_ch4  =
								{
									ROUTE_ch48  =
									{
										ROUTE_ch47  =
										{
										},
									},
								},
							},
						},
					},
					ROUTE_ch2  =
					{
						ROUTE_ch88  =
						{
							ROUTE_ch84  =
							{
								ROUTE_ch83  =
								{
									ROUTE_ch82  =
									{
										ROUTE_ch81  =
										{
											ROUTE_ch79  =
											{
											},
										},
									},
								},
								ROUTE_ch89  =
								{
									ROUTE_ch79  =
									{
									},
								},
							},
						},
					},
					ROUTE_ch3  =
					{
					},
				},
			},
		},

		CAPPOINT_235 =
		{
			ROUTE_parts  =
			{
				ROUTE_parts1  =
				{
					ROUTE_parts2  =
					{
						ROUTE_parts3  =
						{
							ROUTE_ch99  =
							{
								ROUTE_parts5  =
								{
									ROUTE_parts6  =
									{
										ROUTE_parts7  =
										{
										},
									},
								},
							},
						},
						ROUTE_ch47  =
						{
							ROUTE_ch48  =
							{
								ROUTE_ch4  =
								{
									ROUTE_ch49  =
									{
										ROUTE_ch51  =
										{
											ROUTE_parts5  =
											{
												ROUTE_parts6  =
												{
												},
											},
										},
									},
								},
							},
						},
					},
				},
				ROUTE_ch79  =
				{
					ROUTE_parts8  =
					{
						ROUTE_ch80  =
						{
							ROUTE_ch85  =
							{
								ROUTE_ch81  =
								{
									ROUTE_ch3  =
									{
										ROUTE_ch2  =
										{
											ROUTE_parts6  =
											{
											},
										},
									},
								},
							},
						},
					},
				},
			},
		},

	};

	MapRoutes.ATTACK_dyno1 = MapRoutes.PLANT_Getto_Wall;
	MapRoutes.ATTACK_dyno2 = MapRoutes.PLANT_Getto_Wall;
	MapRoutes.ATTACK_dyno3 = MapRoutes.PLANT_Getto_Wall;
	MapRoutes.ATTACK_dyno9 = MapRoutes.PLANT_Getto_Wall;
	MapRoutes.ATTACK_dyno10 = MapRoutes.PLANT_Getto_Wall;
	MapRoutes.ATTACK_at1 = MapRoutes.FLAG_allied_gold;
	MapRoutes.ATTACK_at2 = MapRoutes.FLAG_allied_gold;
	MapRoutes.ATTACK_at3 = MapRoutes.FLAG_allied_gold;
	MapRoutes.ATTACK_at4 = MapRoutes.FLAG_allied_gold;
	MapRoutes.ATTACK_at5 = MapRoutes.FLAG_allied_gold;
	MapRoutes.PLANT_Church_Door = MapRoutes.FLAG_allied_gold;

	Util.Routes(MapRoutes);

	Util.MapDebugPrint( "OnMapLoad" );
};

global OnBotJoin = function( bot )
{
	 bot.TargetBreakableDist = 100.0;
	 bot.MaxViewDistance = 2100.0;
};
