global Map =
{
	Call_Artillery_571 = "CALLARTILLERY_571",
	Call_Artillery_589 = "CALLARTILLERY_589",
	Call_Artillery_604 = "CALLARTILLERY_604",
	Call_Artillery_ally_arty = "CALLARTILLERY_ally_arty",
	Call_Artillery_as1 = "CALLARTILLERY_as1",
	Call_Artillery_as2 = "CALLARTILLERY_as2",
	Call_Artillery_as3 = "CALLARTILLERY_as3",
	Call_Artillery_as4 = "CALLARTILLERY_as4",
	Call_Artillery_as5 = "CALLARTILLERY_as5",
	Artillery_D_159 = "ARTILLERY_D_159",
	Artillery_D_360 = "ARTILLERY_D_360",
	Artillery_D_590 = "ARTILLERY_D_590",
	Artillery_D_69 = "ARTILLERY_D_69",
	Artillery_D_70 = "ARTILLERY_D_70",
	Artillery_D_73 = "ARTILLERY_D_73",
	Artillery_D_82 = "ARTILLERY_D_82",
	Artillery_S_360 = "ARTILLERY_S_360",
	Artillery_S_69 = "ARTILLERY_S_69",
	Artillery_S_73 = "ARTILLERY_S_73",
	Artillery_S_82 = "ARTILLERY_S_82",
	Checkpoint_allied_flag1 = "CHECKPOINT_allied_flag1",
	Checkpoint_axis_flag1 = "CHECKPOINT_axis_flag1",
	Flag_gold_box = "FLAG_gold_box",
	Flag_radar_parts = "FLAG_radar_parts",
	Cappoint_cap_parts = "CAPPOINT_cap_parts",
	Cappoint_gold_cap = "CAPPOINT_gold_cap",
	Plant_allied_door = "PLANT_allied_door",
	Plant_axis_door = "PLANT_axis_door",
	Mount_105 = "MOUNTMG42_105",
	Mount_106 = "MOUNTMG42_106",
	Mount_43 = "MOUNTMG42_43",
	Mount_44 = "MOUNTMG42_44",
	Mount_462 = "MOUNTMG42_462",
	Repair_105 = "REPAIRMG42_105",
	Repair_106 = "REPAIRMG42_106",
	Repair_43 = "REPAIRMG42_43",
	Repair_44 = "REPAIRMG42_44",
	Repair_462 = "REPAIRMG42_462",
	Snipe_572 = "SNIPE_572",
	Snipe_ally_snipe1 = "SNIPE_ally_snipe1",
	Snipe_axis_snipe1 = "SNIPE_axis_snipe1",
	Snipe_snipe99 = "SNIPE_snipe99",
	Plant_Mine_190 = "PLANTMINE_190",
	Plant_Mine_63 = "PLANTMINE_63",

	allied_door_Destroyed = function()
	{
		SetAvailableMapGoals( TEAM.AXIS, true, {
			"FLAG_gold_box",
			"CAPPOINT_gold_cap",
		});
		 SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_ally_door" );
		 SetAvailableMapGoals( TEAM.ALLIES, true, {
		 	"DEFEND_gold5",
		 	"DEFEND_gold6",
		 	"DEFEND_s1",
		 });
		 SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_axis_flag1" );
		 SetAvailableMapGoals( TEAM.AXIS, false, "REPAIRMG42_*" );
		 SetAvailableMapGoals( TEAM.ALLIES, false, "REPAIRMG42_*" );
		 SetGoalPriority( "DEFEND_.*", 0.8, TEAM.ALLIES, CLASS.SOLDIER );

		Util.MapDebugPrint( "allied_door_Destroyed" );
	},

	axis_door_Destroyed = function()
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"FLAG_radar_parts",
			"CAPPOINT_cap_parts",
		});
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_axis_door" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_allied_flag1" );
		SetAvailableMapGoals( TEAM.AXIS, true, {
			"DEFEND_radar1",
			"DEFEND_s2",
			"DEFEND_radar2",
		});
		 SetAvailableMapGoals( TEAM.AXIS, false, "REPAIRMG42_*" );
		 SetAvailableMapGoals( TEAM.ALLIES, false, "REPAIRMG42_*" );
		 SetGoalPriority( "DEFEND_.*", 0.8, TEAM.AXIS, CLASS.SOLDIER );

		Util.MapDebugPrint( "axis_door_Destroyed" );
	},

	gold_box_Taken = function()
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_gold_box" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_gold_box.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"DEFEND_gold5",
			"DEFEND_gold6",
			"MOUNTMG42_*",
		});
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_radar1",
			"DEFEND_radar2",
		});
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_s1" );

		Util.MapDebugPrint( "gold_box_Taken" );
	},

	radar_parts_Taken = function()
	{
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radar.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_def_parts.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"DEFEND_def_parts",
			"DEFEND_def_parts2",
			"DEFEND_s2",
		});
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_gold.*" );

		Util.MapDebugPrint( "radar_parts_Taken" );
	},

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

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

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

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

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

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

	radar_returned = function()
	{
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_def_parts" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_def_parts" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_def_parts2" );
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"DEFEND_def_parts2",
			"DEFEND_s2",
		});
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_radar.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_gold.*" );

		Util.MapDebugPrint( "radar returned" );
	},

	gold_returned = function()
	{
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_gold_box" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_gold_box.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"DEFEND_gold5",
			"DEFEND_gold6",
			"MOUNTMG42_*",
		});
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_s1" );

		Util.MapDebugPrint( "gold returned" );
	},

	Ally_plant = function()
 	{
 		Util.MapDebugPrint( "Planted at axis door" );
 	},

	Axis_plant = function()
 	{
 		Util.MapDebugPrint( "Planted at allied door" );
 	},

};

global OnMapLoad = function()
{
	OnTrigger( "The Allied Door has been Destroyed!", Map.allied_door_Destroyed );
	OnTrigger( "The Axis door has been Destroyed!", Map.axis_door_Destroyed );
	OnTrigger( "Axis have stolen The Gold!", Map.gold_box_Taken );
	OnTrigger( "Allies have stolen the Secret Documents!", Map.radar_parts_Taken );
	OnTrigger( "MISSING_STRING", Map.cap_parts_Captured );
	OnTrigger( "MISSING_STRING", Map.gold_cap_Captured );
	OnTrigger( "MISSING_STRING", Map.allied_flag1_Axis_Captured );
	OnTrigger( "MISSING_STRING", Map.allied_flag1_Allies_Captured );
	OnTrigger( "MISSING_STRING", Map.axis_flag1_Axis_Captured );
	OnTrigger( "MISSING STRING", Map.axis_flag1_Allies_Captured );
	OnTrigger( "Planted at The axis door.", Map.Ally_plant );
	OnTrigger( "Planted at The allied door.", Map.Axis_plant );
	OnTrigger( "Flag returned radar_parts!", Map.radar_returned );
	OnTrigger( "Flag returned gold_box!", Map.gold_returned );

	Util.SetGoalPosition( 3340, 375.4, 96.125, Map.Plant_axis_door ) ;
	Util.SetGoalPosition( 2818.1, 8267.9, 96.125, Map.Plant_allied_door ) ;

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

//~	SetAvailableMapGoals( TEAM.ALLIES, true, "MOBILEMG42_.*" );
//~	SetAvailableMapGoals( TEAM.AXIS, true, "MOBILEMG42_.*" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_ally_door" );
	SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_axis_door" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "MOUNTMG42_.*" );
	SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_.*" );
	SetAvailableMapGoals( TEAM.AXIS, false, {
		"MOUNTMG42_43",
		"MOUNTMG42_44",
	});
	SetAvailableMapGoals( TEAM.AXIS, true, "MOBILEMORTAR_mortar1" );
	SetAvailableMapGoals( TEAM.ALLIES, false, {
		"MOUNTMG42_105",
		"MOUNTMG42_106",
	});

	Util.DisableGoal("REPAIRMG42_.*");

	SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_allied_door" );
	SetAvailableMapGoals( TEAM.ALLIES, true, {
		"PLANT_axis_door",
		"ROUTE_.*",
	});
	SetAvailableMapGoals( TEAM.AXIS, true, {
		"ROUTE_.*",
		"SNIPE_axis_snipe1",
	});
	SetAvailableMapGoals( TEAM.ALLIES, true, {
		"SNIPE_ally_snipe1",
		"SNIPE_snipe99",
		"MOBILEMORTAR_mortar2",
	});

//~	Util.EnableGoal("MOBILEMORTAR_.*");
//~	MOBILEMORTAR

	SetAvailableMapGoals( TEAM.ALLIES, true, "CALLARTILLERY_.*" );
	SetAvailableMapGoals( TEAM.AXIS, true, {
		"CALLARTILLERY_.*",
		"ARTILLERY_.*",
	});
	SetAvailableMapGoals( TEAM.AXIS, false, "ARTILLERY_D_82" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "ARTILLERY_.*" );
	SetAvailableMapGoals( TEAM.ALLIES, false, {
		"ARTILLERY_D_69",
		"ARTILLERY_S_69",
	});

	SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_.*" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_.*" );

//~	"ARTILLERY_D_159"
	Util.SetMaxUsersInProgress( 1, "DEFEND_*" );
	Util.SetMaxUsersInProgress( 2, "PLANT_*" );
	Util.SetMaxUsersInProgress( 1, "MOUNTMG42_.*" );
	Util.SetMaxUsersInProgress( 2, "CHECKPOINT_.*" );
	SetGoalPriority( "PLANT_axis_door", 0.9, TEAM.ALLIES, CLASS.ENGINEER );
	SetGoalPriority( "PLANT_allied_door", 0.9, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "CHECKPOINT_.*", 0.0, 0, CLASS.ENGINEER );
	SetGoalPriority( "MOUNTMG42_.*", 0.5, 0, 0 );
	SetGoalPriority( "MOUNTMG42_.*", 0.2, 0, CLASS.FIELDOPS );
//~	SetGoalPriority( "DEFEND_.*", 0.6, 0, CLASS.SOLDIER );
//~	SetGoalPriority( "CHECKPOINT_.*", 0.6, 0, 0 );

	SetGoalPriority( "MOBILEMORTAR_.*", 0.85, 0, CLASS.SOLDIER );
	SetGoalPriority( "MOBILEMG42_.*", 0.26, 0, CLASS.SOLDIER );
	SetMapGoalProperties( "DEFEND_.*", {MinCampTime=40, MaxCampTime=80} );
	SetMapGoalProperties( "MOUNTMG42_.*", {MinCampTime=10, MaxCampTime=90} );
	SetMapGoalProperties( "MOBILEMORTAR_.*", {MinCampTime=10, MaxCampTime=55} );
	SetMapGoalProperties( "MOBILEMG42_.*", {MinCampTime=25, MaxCampTime=55} );

	MapRoutes =
	{
		PLANT_axis_door =
		{
			ROUTE_ally2  =
			{
				ROUTE_stairs  =
				{
					ROUTE_s1  =
					{
						ROUTE_tunnel  =
						{
							ROUTE_tunnel4  =
							{
								ROUTE_tunnel3  =
								{
									ROUTE_tunnel2  =
									{
										ROUTE_stairs1  =
										{
											ROUTE_axis_flag  =
											{
												ROUTE_allyplant  =
												{
													ROUTE_allyplant2  =
													{
													},
												},
											},
										},
									},
								},
							},
						},
					},
				},
				ROUTE_ally3  =
				{
					ROUTE_axisplant2  =
					{
						ROUTE_ally_dyno1  =
						{
							ROUTE_ar2  =
							{
								ROUTE_ally_dyno2d  =
								{
									ROUTE_axis_dyno1  =
									{
										ROUTE_axis_flag2  =
										{
											ROUTE_allyplant2  =
											{
											},
										},
									},
								},
								ROUTE_axis_dyno3  =
								{
									ROUTE_axis_dyno1  =
									{
										ROUTE_axis_flag2  =
										{
											ROUTE_allyplant2  =
											{
											},
										},
									},
								},
							},
						},
					},
				},
			},
		},

		PLANT_allied_door =
		{
			ROUTE_axis1  =
			{
				ROUTE_stairs1  =
				{
					ROUTE_tunnel2  =
					{
						ROUTE_tunnel3  =
						{
							ROUTE_tunnel4  =
							{
								ROUTE_tunnel  =
								{
									ROUTE_s1  =
									{
										ROUTE_stairs  =
										{
											ROUTE_axisplant2  =
											{
											},
										},
									},
								},
							},
						},
					},
					ROUTE_axis_dyno1  =
					{
						ROUTE_axis_dyno3  =
						{
							ROUTE_ally_dyno2c  =
							{
								ROUTE_ar2  =
								{
									ROUTE_ally_dyno1  =
									{
										ROUTE_axisplant2  =
										{
										},
									},
								},
							},
						},
					},
				},
			},
			ROUTE_axis2  =
			{
				ROUTE_axis_flag  =
				{
					ROUTE_stairs1  =
					{
						ROUTE_tunnel3  =
						{
							ROUTE_tunnel4  =
							{
								ROUTE_tunnel  =
								{
									ROUTE_s1  =
									{
										ROUTE_stairs  =
										{
											ROUTE_axisplant1  =
											{
												ROUTE_axisplant2  =
												{
												},
											},
										},
									},
								},
							},
						},
					},
				},
				ROUTE_axis_flag2  =
				{
					ROUTE_axis_dyno1  =
					{
						ROUTE_axis_dyno3  =
						{
							ROUTE_ally_dyno2c  =
							{
								ROUTE_ar2  =
								{
									ROUTE_ally_dyno1  =
									{
										ROUTE_axisplant2  =
										{
										},
									},
								},
							},
						},
					},
				},
			},
		},
		CALLARTILLERY_as1 =
		{
			ROUTE_ally1  =
			{
				ROUTE_s1  =
				{
					ROUTE_tunnel  =
					{
						ROUTE_tunnel4  =
						{
							ROUTE_ladder1  =
							{
							},
						},
					},
				},
			},
			ROUTE_ally2  =
			{
				ROUTE_axisplant1  =
				{
					ROUTE_stairs  =
					{
						ROUTE_s1  =
						{
							ROUTE_tunnel  =
							{
								ROUTE_tunnel4  =
								{
									ROUTE_ladder1  =
									{
									},
								},
							},
						},
					},
				},
				ROUTE_ally3  =
				{
					ROUTE_ally_dyno1  =
					{
						ROUTE_ar2  =
						{
						},
					},
				},
			},
		},
	};

	MapRoutes.FLAG_gold_box = MapRoutes.PLANT_allied_door;
	MapRoutes.FLAG_radar_parts = MapRoutes.PLANT_axis_door;
	MapRoutes.CALLARTILLERY_as5 = MapRoutes.PLANT_axis_door;
	MapRoutes.CALLARTILLERY_as4 = MapRoutes.PLANT_axis_door;
	MapRoutes.CALLARTILLERY_as2 = MapRoutes.CALLARTILLERY_as1;

	Util.Routes(MapRoutes);

	Util.MapDebugPrint( "OnMapLoad" );
};

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