/********************************************************
Original Waypoints and Script by MetalHead
Updated by  >WES< P!NNAN & >WES< GRANNY
********************************************************/

global Map =
{
	Talk = true, //set this to false if you wont bots talking ingame
	Quiet = true,
	NorthDoorStatus = "Allies!",
	SouthDoorStatus = "Allies!",
	GenDoorStatus = "Allies!",

	Ammo_Cabinet_t51 = "AMMOCAB_t51",
	Ammo_Cabinet_t65 = "AMMOCAB_t65",
	Ammo_Cabinet_t67 = "AMMOCAB_t67",
	Ammo_Cabinet_t69 = "AMMOCAB_t69",
	Ammo_Cabinet_t70 = "AMMOCAB_t70",
	Health_Cabinet_t52 = "HEALTHCAB_t52",
	Health_Cabinet_t64 = "HEALTHCAB_t64",
	Health_Cabinet_t66 = "HEALTHCAB_t66",
	Health_Cabinet_t68 = "HEALTHCAB_t68",
	Health_Cabinet_t71 = "HEALTHCAB_t71",
	Call_Artillery_ar_al_call_hill = "CALLARTILLERY_ar_al_call_hill",
	Call_Artillery_ar_al_call_start_1 = "CALLARTILLERY_ar_al_call_start_1",
	Call_Artillery_ar_al_call_start_2 = "CALLARTILLERY_ar_al_call_start_2",
	Call_Artillery_ar_al_call_beach = "CALLARTILLERY_ar_al_call_beach",
	Call_Artillery_ar_al_call_beachroof = "CALLARTILLERY_ar_al_call_beachroof",
	Call_Artillery_ally_fops_def2 = "CALLARTILLERY_ally_fops_def2",
	Call_Artillery_axis_arty_att1 = "CALLARTILLERY_axis_arty_att1",
	Call_Artillery_axis_fops1 = "CALLARTILLERY_axis_fops1",
	Artillery_D_arty_def3 = "ARTILLERY_D_arty_def3",
	Artillery_D_ar_al_hill = "ARTILLERY_D_ar_al_hill",
	Artillery_D_ar_al_beach = "ARTILLERY_D_ar_al_beach",
	Artillery_S_ar_al_start = "ARTILLERY_S_ar_al_start",
	Artillery_S_ar_al_beach_1 = "ARTILLERY_S_ar_al_beach_1",
	Artillery_S_ally_arty_att1 = "ARTILLERY_S_ally_arty_att1",
	Artillery_S_arty_att_def_1 = "ARTILLERY_S_arty_att_def_1",
	Artillery_S_arty_def1 = "ARTILLERY_S_arty_def1",
	Artillery_S_axis_arty_att = "ARTILLERY_S_axis_arty_att",
	Artillery_S_mine10 = "ARTILLERY_S_mine10",
	Checkpoint_forward_spawn = "CHECKPOINT_forward_spawn",
	Flag_amplifier_flag = "FLAG_amplifier_flag",
	Cappoint_Dropoff = "CAPPOINT_Dropoff",
	Build_Beach_Command_Post = "BUILD_Beach_Command_Post",
	Build_HQ_Command_Post = "BUILD_HQ_Command_Post",
	Build_fence_door = "BUILD_fence_door",
	Build_generator = "BUILD_generator",
	Build_generator_teamdoor = "BUILD_generator_teamdoor",
	Build_heavy_door_reinforcement = "BUILD_heavy_door_reinforcement",
	Build_ladder = "BUILD_ladder",
	Build_north_teamdoor = "BUILD_north_teamdoor",
	Build_south_teamdoor = "BUILD_south_teamdoor",
	Build_north_teamdoor_1 = "BUILD_north_teamdoor_1",
	Build_south_teamdoor_1 = "BUILD_south_teamdoor_1",
	Build_tower = "BUILD_tower",
	Plant_Beach_Command_Post = "PLANT_Beach_Command_Post",
	Plant_HQ_Command_Post = "PLANT_HQ_Command_Post",
	Plant_fence_door = "PLANT_fence_door",
	Plant_generator = "PLANT_generator",
	Plant_generator_teamdoor = "PLANT_generator_teamdoor",
	Plant_heavy_door_reinforcement = "PLANT_heavy_door_reinforcement",
	Plant_heavy_door = "PLANT_heavy_door",
	Plant_ladder = "PLANT_ladder",
	Plant_tower = "PLANT_tower",
	Mount_681 = "MOUNTMG42_681",
	Mount_682 = "MOUNTMG42_682",
	Mount_683 = "MOUNTMG42_683",
	Mount_684 = "MOUNTMG42_684",
	Mount_HQ_Command_Post = "MOUNTMG42_HQ_Command_Post",
	Repair_681 = "REPAIRMG42_681",
	Repair_682 = "REPAIRMG42_682",
	Repair_683 = "REPAIRMG42_683",
	Repair_684 = "REPAIRMG42_684",
	Repair_HQ_Command_Post = "REPAIRMG42_HQ_Command_Post",
	Mobile_MG42_al_mg_tunnel = "MOBILEMG42_al_mg_tunnel",
	Mobile_MG42_al_mg_hill = "MOBILEMG42_al_mg_hill",
	Mobile_MG42_ally_fops_def1 = "MOBILEMG42_ally_fops_def1",
	Mobile_MG42_ally_fops_def2 = "MOBILEMG42_ally_fops_def2",
	Mobile_MG42_ally_snipe1 = "MOBILEMG42_ally_snipe1",
	Mobile_MG42_ally_snipe_def1 = "MOBILEMG42_ally_snipe_def1",
	Mobile_MG42_ally_snipe_def2 = "MOBILEMG42_ally_snipe_def2",
	Mobile_MG42_axis_snipe1 = "MOBILEMG42_axis_snipe1",
	Mobile_MG42_bunker_def_1 = "MOBILEMG42_bunker_def_1",
	Mobile_MG42_bunker_def_2 = "MOBILEMG42_bunker_def_2",
	Mobile_MG42_bunker_def_al1 = "MOBILEMG42_bunker_def_al1",
	Mobile_MG42_bunker_def_ax1 = "MOBILEMG42_bunker_def_ax1",
	MobileMortar_mo_al_beach = "MOBILEMORTAR_mo_al_beach",
	Snipe_ally_fops_def1 = "SNIPE_ally_fops_def1",
	Snipe_ally_snipe1 = "SNIPE_ally_snipe1",
	Snipe_ally_snipe_def1 = "SNIPE_ally_snipe_def1",
	Snipe_ally_snipe_def2 = "SNIPE_ally_snipe_def2",
	Snipe_axis_snipe1 = "SNIPE_axis_snipe1",
	Snipe_bunker_def_1 = "SNIPE_bunker_def_1",
	Snipe_bunker_def_2 = "SNIPE_bunker_def_2",

	Navigation =
	{
		towerpt =
		{
			navigate = function(_this)
			{
				_this.Bot.HoldButton(BTN.FORWARD, 3.5);
				sleep(3.5);
			},
		},
		outerladderpt =
		{
			navigate = function(_this)
			{
				_this.Bot.HoldButton(BTN.FORWARD, 3);
				sleep(3);
			},
		},
		ropept =
		{
			navigate = function(_this)
			{
				_this.Bot.HoldButton(BTN.FORWARD, 6);
				sleep(6);
			},
		},
		fencegate =
		{
			navigate = function(_this)
			{
				_this.Bot.HoldButton(BTN.CROUCH, 3);
				sleep(1);
			},
		},
		waterexitpt =
		{
			navigate = function(_this)
			{
				_this.Bot.HoldButton(BTN.FORWARD, 3);
				sleep(3);
			},
		},
		waterentrancept =
		{
			navigate = function(_this)
			{
				_this.Bot.HoldButton(BTN.FORWARD, 3);
				sleep(3);
			},
		},
	},

	//CP stuff
	Allied_Beach_Command_Post_Built = function()
	{
		Util.MapDebugPrint( "Beach_Command_Post_Built" );
	},

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

	Allied_HQ_Command_Post_Built = function()
	{
		SetGoalPriority( Map.Build_HQ_Command_Post, 0.9, TEAM.ALLIES );

		Util.MapDebugPrint( "HQ_Command_Post_Built" );
	},

	Axis_HQ_Command_Post_Built = function()
	{
		//axis secured bunker spawn
		Groups.DisableAllies(Groups.group3);
		Groups.EnableAllies(Groups.group5);
		Groups.DisableAxis(Groups.group4);
		Groups.EnableAxis(Groups.group6);

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

		SetGoalPriority( Map.Plant_HQ_Command_Post, 0.79, TEAM.ALLIES, CLASS.ENGINEER );
		SetGoalPriority( Map.Plant_HQ_Command_Post, 0.7, TEAM.ALLIES, CLASS.COVERTOPS );

		Util.MapDebugPrint( "HQ_Command_Post_Built" );
	},

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

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

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

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

	SetDoor = function(name,axis)
	{
		Wp.SetWaypointFlag(name + "door", "team1", axis);
		Wp.SetWaypointFlag(name + "door", "team2", !axis);
	},

	//teamdoors and doors
	generator_teamdoor_Built = function()
	{
		SetAvailableMapGoals(TEAM.ALLIES, true, "BUILD_generator_teamdoor_allied");

		Map.GenDoorStatus = "Axis!";

		//close path for allies now
		Map.SetDoor("generator", true);

		Util.MapDebugPrint( "GenDoor is now hold by " + Map.GenDoorStatus );
	},

	generator_teamdoor_Destroyed = function()
	{
		SetAvailableMapGoals(TEAM.ALLIES, false, "BUILD_generator_teamdoor_allied");

		Map.GenDoorStatus = "Allies!";

		//open path for allies now
		Map.SetDoor("generator", false);

		Util.MapDebugPrint( "GenDoor is now hold by " + Map.GenDoorStatus );
	},

	north_teamdoor_Built = function()
	{
		Map.NorthDoorStatus = "Axis!";

		//open path now for axis
		Map.SetDoor("north", true);

		if ( Map.Talk && MAP_TALK )
		{
			foreach ( id and bot in BotTable )
			{
				if ( bot.GetTeam() == TEAM.AXIS )
				{
					r = RandRange(0,10);
					if( r < 2 )
					{
						bot.SayVoice(VOICE.PATH_CLEARED);
					}
					else if( r > 8 )
					{
						sleep(1.2);
						bot.ExecCommand("vsay_team FTAttack");
					}
				}
				if ( bot.GetTeam() == TEAM.ALLIES )
				{
					r = RandRange(0,10);
					if( r < 2 )
					{
						bot.SayVoice(VOICE.REINFORCE_DEF);
					}
					else if( r > 8 )
					{
						sleep(1.2);
						bot.ExecCommand("vsay_team FTFallBack");
					}
				}
			}
		}

		Util.MapDebugPrint( "NorthDoor is now hold by " + Map.NorthDoorStatus );
	},

	north_teamdoor_1_Built = function()
	{
		Map.NorthDoorStatus = "Allies!";

		//open path now for allies
		Map.SetDoor("north", false);

		Util.MapDebugPrint( "NorthDoor is now hold by " + Map.NorthDoorStatus );
	},

	south_teamdoor_Built = function()
	{
		SetAvailableMapGoals(TEAM.ALLIES, true, "BUILD_south_teamdoor_allied");

		Map.SouthDoorStatus = "Axis!";
		Map.SetDoor("south", true);

		if ( Map.Talk && MAP_TALK )
		{
			foreach ( id and bot in BotTable )
			{
				if ( bot.GetTeam() == TEAM.AXIS )
				{
					r = RandRange(0,10);
					if( r < 2 )
					{
						bot.SayVoice(VOICE.PATH_CLEARED);
					}
					else if( r > 8 )
					{
						sleep(1.2);
						bot.ExecCommand("vsay_team FTAttack");
					}
				}
				if ( bot.GetTeam() == TEAM.ALLIES )
				{
					r = RandRange(0,10);
					if( r < 2 )
					{
						bot.SayVoice(VOICE.REINFORCE_DEF);
					}
					else if( r > 8 )
					{
						sleep(1.2);
						bot.ExecCommand("vsay_team FTFallBack");
					}
				}
			}
		}

		Util.MapDebugPrint( "SouthDoor is now hold by " + Map.SouthDoorStatus );
	},

	south_teamdoor_Destroyed = function()
	{
		SetAvailableMapGoals(TEAM.ALLIES, false, "BUILD_south_teamdoor_allied");

		Map.SouthDoorStatus = "Allies!";
		//open path now for axis
		Map.SetDoor("south", false);

		Util.MapDebugPrint( "SouthDoor is now hold by " + Map.SouthDoorStatus );
	},

	fence_door_Built = function()
	{
		Wp.SetWaypointFlag("Fencedoor","team2",true);

		Util.MapDebugPrint( "fence_door_Built" );
	},

	fence_door_Destroyed = function()
	{
		Wp.SetWaypointFlag("Fencedoor","team2",false);

		Util.MapDebugPrint( "fence_door_Destroyed" );
	},

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

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

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

	//tower and ladder
	ladder_Built = function()
	{
		Util.MapDebugPrint( "ladder_Built" );
	},

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

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

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

	//Obj stuff
	roof_Destroyed = function()
	{
		SetAvailableMapGoals(TEAM.AXIS, false, "DYNAMITE_roof");

		if ( Map.Talk && MAP_TALK )
		{
			foreach ( id and bot in BotTable )
			{
				if ( bot.GetTeam() == TEAM.AXIS )
				{
					r = RandRange(0,10);
					if( r < 2 )
					{
						bot.SayVoice(VOICE.LETS_GO);
					}
					else if( r > 8 )
					{
						sleep(1.2);
						bot.ExecCommand("vsay_team FTAttack");
					}
				}
				if ( bot.GetTeam() == TEAM.ALLIES )
				{
					r = RandRange(0,10);
					if( r < 2 )
					{
						bot.SayVoice(VOICE.INCOMING);
					}
					else if( r > 8 )
					{
						sleep(1.2);
						bot.ExecCommand("vsay_team FTFallBack");
					}
				}
			}
		}

		Util.MapDebugPrint( "roof_Destroyed" );
	},

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

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

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

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

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

	//spawnstuff
	forward_spawn_Axis_Captured = function()
	{
		Util.MapDebugPrint( "forward_spawn_Axis_Captured" );
	},

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

	//OnAxisWin
	count_off = function()
	{
		ETUtil.WinningChat( TEAM.AXIS );
		ETUtil.LosingChat( TEAM.ALLIES );
		Util.MapDebugPrint( "count_off", true );
	},
};

global OnMapLoad = function()
{
	OnTrigger( "^6Axis Beach Command Post constructed.", Map.Axis_Beach_Command_Post_Built );
	OnTrigger( "^6Allied Beach Command Post constructed.", Map.Allied_Beach_Command_Post_Built );
	OnTrigger( "^6Axis HQ Command Post constructed. Charge speed increased!", Map.Axis_HQ_Command_Post_Built );
	OnTrigger( "^6Allied HQ Command Post constructed. Charge speed increased!", Map.Allied_HQ_Command_Post_Built );
	OnTrigger( "^1Allied team has rebuild the fence door!", Map.fence_door_Built );
	OnTrigger( "^1Axis team has fixed the generator!", Map.generator_Built );
	OnTrigger( "^1Axis team has fixed the generator teamdoor!", Map.generator_teamdoor_Built );
	OnTrigger( "^1Allied team has reinforced the heavy door!", Map.heavy_door_reinforcement_Built );
	OnTrigger( "^1Axis team has built the ladder!", Map.ladder_Built );
	OnTrigger( "^1Axis team has fixed the north teamdoor!", Map.north_teamdoor_Built );
	OnTrigger( "^1Allied team has fixed the north teamdoor!", Map.north_teamdoor_1_Built );
	OnTrigger( "^1Axis team has fixed the south teamdoor!", Map.south_teamdoor_Built );
	OnTrigger( "^1Axis team has built the tower!", Map.tower_Built );
	OnTrigger( "^6Axis team has destroyed the Allied Beach Command Post!", Map.Allied_Beach_Command_Post_Destroyed );
	OnTrigger( "^6Axis team has destroyed the Allied HQ Command Post!", Map.Allied_HQ_Command_Post_Destroyed );
	OnTrigger( "^6Allied team has destroyed the Axis Beach Command Post.", Map.Axis_Beach_Command_Post_Destroyed );
	OnTrigger( "^6Allied team has destroyed the Axis HQ Command Post!", Map.Axis_HQ_Command_Post_Destroyed );
	OnTrigger( "^1Axis team has blown the fence door!", Map.fence_door_Destroyed );
	OnTrigger( "^1Allied team has disabled the generator!", Map.generator_Destroyed );
	OnTrigger( "^1Axis have destroyed the bunker roof!", Map.roof_Destroyed );
	OnTrigger( "^1Allied team has fixed the generator teamdoor!", Map.generator_teamdoor_Destroyed );
	OnTrigger( "^1Allied team has fixed the south teamdoor!", Map.south_teamdoor_Destroyed );
	OnTrigger( "^1Axis team has destroyed the heavy door reinforcement!", Map.heavy_door_reinforcement_Destroyed );
	OnTrigger( "^1Axis have destroyed the heavy door!", Map.heavy_door_Destroyed );
	OnTrigger( "^1Allied team has destroyed the ladder!", Map.ladder_Destroyed );
	OnTrigger( "^1Allied team has destroyed the tower!", Map.tower_Destroyed );
	OnTrigger( "^1Axis has taken the amplifier", Map.amplifier_flag_Taken );
	OnTrigger( "^1The amplifier has been returned", Map.amplifier_flag_Returned );
	OnTrigger( "^1The amplifier has been taken to the relay-station", Map.CAPPOINT_Dropoff_Captured );
	OnTrigger( "^1Axis captured the old shed!", Map.forward_spawn_Axis_Captured );
	OnTrigger( "^1Axis lost the old shed!", Map.forward_spawn_Allies_Captured );
	OnTrigger( "^1Artillery on beach ^1!^3!^1!^3!^1!^3!^1!^3!^1!^3!", Map.count_off );

	//Priority Main goals
	SetGoalPriority( "DYNAMITE_roof", 0.9 );
	SetGoalPriority( "FLAG_amplifier_flag", 0.7 );
	SetGoalPriority( Map.Plant_HQ_Command_Post, 0.9 );
	SetGoalPriority( Map.Build_HQ_Command_Post, 0.91, TEAM.ALLIES );

	//set offset for better reachable
	Util.SetGoalOffset( 1000, 0, -100, "PLANT_tower" );
	Util.AddUsePoint( "BUILD_south_teamdoor", {Vec3(254.125, -2074.529, -147.875), Vec3(204.079, -2068.382, -147.875),});
	Util.AddUsePoint( "BUILD_north_teamdoor", {Vec3(206.088, -1367.528, -147.875), Vec3(255.107, -1367.565, -147.875),});
	Util.AddUsePoint( "BUILD_north_teamdoor_1", {Vec3(206.088, -1367.528, -147.875), Vec3(255.107, -1367.565, -147.875),});
	Util.AddUsePoint( "BUILD_generator_teamdoor", {Vec3(-2319.241, -2675.350, -555.875), Vec3(-2323.889, -2589.581, -555.640),});
	Util.AddUsePoint( "PLANT_fence_door", {Vec3(-1763.873, -2387.850, -555.875), Vec3(-1756.495, -2453.593, -551.875),});

	//close path , we will open it later if maindoors are destroyed
	Map.SetDoor("north", false);
	Map.SetDoor("south", false);
	Map.SetDoor("generator", false);
	Wp.SetWaypointFlag("Fencedoor","team2",false);

	//set max users for goals
	Util.SetMaxUsersInProgress( 2, "BUILD.*" );
	Util.SetMaxUsersInProgress( 1, "BUILD.*teamdoor.*" );
	Util.SetMaxUsersInProgress( 2, "PLANT.*" );
	Util.SetMaxUsersInProgress( 1, "DEFEND_.*" );
	Util.SetMaxUsersInProgress( 2, "CHECKPOINT_.*" );
	Util.SetMaxUsersInProgress( 1, ".*MG42.*" );

	SetMapGoalProperties( "MOBILEMG42_.*", {MinCampTime=120, MaxCampTime=120});
	SetMapGoalProperties( "SNIPE_.*", {MinCampTime=60, MaxCampTime=120});
	SetMapGoalProperties( "ATTACK_.*", {MinCampTime=30, MaxCampTime=60});
	SetMapGoalProperties( "DEFEND_.*", {MinCampTime=60, MaxCampTime=120});

	Util.DisableGoal(".*", true);
	Util.EnableGoal("AMMOCAB.*");
	Util.EnableGoal("HEALTHCAB.*");
	SetAvailableMapGoals(TEAM.ALLIES, false, "HEALTHCAB_t64"); //hack to fix stuckage at north door

	//enable part 1 goals
	Groups.EnableAllies(Groups.group1);
	Groups.EnableAllies(Groups.group3);
	Groups.EnableAxis(Groups.group2);
	Groups.EnableAxis(Groups.group4);

	//Routes
	MapRoutes =
	{
		PLANT_HQ_Command_Post =
		{
			ROUTE_axis_spawn =
			{
				ROUTE_ladd_tow = { ROUTE_tower = {}, },
			},
			ROUTE_axis_spawn2 =
			{
				ROUTE_ladd_tow = { ROUTE_tower = {}, },
			},
			ROUTE_axis_flag =
			{
				ROUTE_tower = {},
			},
			ROUTE_a_beach_1 =
			{
				ROUTE_beach_cp =
				{
					ROUTE_water_exit2 =
					{
						ROUTE_water_exit1 =
						{
							ROUTE_r_hq_exit = {},
						},
					},
				},
			},
			ROUTE_bunker_inside =
			{
				ROUTE_bunker_door_front =
				{
					ROUTE_r_hq_exit = {},
				},
			},
			ROUTE_allyspawn =
			{
				ROUTE_tunnel_entrance =
				{
					ROUTE_tunnel_exit = { ROUTE_r_hq_exit = {}, },
				},
			},
		},
		FLAG_amplifier_flag =
		{
			ROUTE_axis_spawn =
			{
				ROUTE_axis_water = {},
			},
			ROUTE_axis_spawn2 =
			{
				ROUTE_axis_water = {},
			},
			ROUTE_axis_flag =
			{
				ROUTE_axis_water = {},
			},
			ROUTE_bunker_inside =
			{
				ROUTE_tunnel_exit =
				{
					ROUTE_tunnel_entrance = { ROUTE_cabinet = {}, },
				},
			},
		},
		CAPPOINT_Dropoff =
		{
			ROUTE_r_obj =
			{
				ROUTE_r_obj_split =
				{
					ROUTE_r_beach_top =
					{
						ROUTE_r_water_way =
						{
							ROUTE_r_water_tunnel =
							{
								ROUTE_r_water_exit = { ROUTE_arty_att_1 = {}, },
							},
						},
					},
				},
			},
		},
		PLANT_generator =
		{
			ROUTE_allyspawn =
			{
				ROUTE_tunnel_entrance =
				{
					ROUTE_tunnel_exit = { ROUTE_r_generator_room = {}, },
				},
			},
		},
	};
	Util.Routes(MapRoutes);
	Util.MapDebugPrint( "Omni-bot map script for " + GetMapName() + " executed." );
};

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

global Groups =
{
	//Allied
	group1 =
	{
		Map.Build_HQ_Command_Post,
		Map.Plant_HQ_Command_Post,
		Map.Build_Beach_Command_Post,
		Map.Plant_Beach_Command_Post,
		Map.Plant_generator,
		Map.Build_heavy_door_reinforcement,
		Map.Build_fence_door,
		"PLANTMINE_.*",
		Map.Mobile_MG42_al_mg_hill,
	},

	//Axis
	group2 =
	{
		Map.Build_HQ_Command_Post,
		Map.Plant_HQ_Command_Post,
		Map.Build_Beach_Command_Post,
		Map.Cappoint_Dropoff,
	},

	//Allied east
	group3 =
	{
		Map.Plant_ladder,
		Map.Plant_tower,
		Map.Checkpoint_forward_spawn,
		Map.Build_north_teamdoor_1,
		Map.Call_Artillery_ar_al_call_start_1,
		Map.Call_Artillery_ar_al_call_start_2,
		Map.Artillery_S_arty_def1,
		Map.Artillery_S_ar_al_start,
		Map.Artillery_D_arty_def3,
		Map.Mobile_MG42_al_mg_hill,
		"DEFEND_roof.*",
		"DEFEND_bunker1.*",
		"DEFEND_ally_def.*",
	},

	//Axis east
	group4=
	{
		"DYNAMITE_roof",
		Map.Build_ladder,
		Map.Build_tower,
		Map.Checkpoint_forward_spawn,
		Map.Build_north_teamdoor,
		Map.Build_south_teamdoor,
		"ATTACK_a_bunker.*",
		"SNIPE_axis.*"
	},

	//Allied west
	group5 =
	{
		Map.Mobile_MG42_al_mg_tunnel,
		Map.Call_Artillery_ar_al_call_hill,
		Map.Call_Artillery_ar_al_call_beach,
		Map.Call_Artillery_ar_al_call_beachroof,
		Map.Artillery_S_ally_arty_att1,
		Map.Artillery_D_ar_al_hill,
		Map.Artillery_D_ar_al_beach,
		"MOBILEMORTAR_mo_al_beach.*",
		Map.Mobile_MG42_al_mg_tunnel,
		"DEFEND_beach_cp.*",
		"SNIPE_ally.*"
	},

	//Axis west
	group6=
	{
		Map.Plant_Beach_Command_Post,
		Map.Flag_amplifier_flag,
		Map.Build_generator,
		Map.Plant_heavy_door_reinforcement,
		Map.Plant_fence_door,
		Map.Build_generator_teamdoor,
		".*MG42_338",
		".*MG42_339",
		"ATTACK_a_Beach.*",
		"SNIPE_bunker.*",
		"MOBILEMG42_bunker_def_1",
	},

	EnableAllies = function(group)
	{
		foreach (goal in group)
		{
			SetAvailableMapGoals( TEAM.ALLIES, true, goal );
			Util.MapDebugPrint("EnableAllies: enabling " + goal, true);
		}
	},

	EnableAxis = function(group)
	{
		foreach (goal in group)
		{
			SetAvailableMapGoals( TEAM.AXIS, true, goal );
			Util.MapDebugPrint("EnableAxis: enabling " + goal, true);
		}
	},

	DisableAllies = function(group)
	{
		foreach (goal in group)
		{
			SetAvailableMapGoals( TEAM.ALLIES, false, goal );
			Util.MapDebugPrint("DisableAllies: disabling " + goal, true);
		}
	},

	DisableAxis = function(group)
	{
		foreach (goal in group)
		{
			SetAvailableMapGoals( TEAM.AXIS, false, goal );
			Util.MapDebugPrint("DisableAxis: disabling " + goal, true);
		}
	},
};
