/********************************************************
Found some waypoints for C2 Missile Beta 2 by Slayer.
Upgraded them for Beta 3 and made a script to go with it.
Updates and script by :)BOK(: Naerling.
********************************************************/

global Map =
{
	Debug = false,
	Quiet = true,
	//set Talk to false if you don't want the bots talking ingame:
	Talk = true,
	Gate = false,

	Checkpoint_forwardflag = "CHECKPOINT_forwardflag",
	Flag_powersupply = "FLAG_powersupply",
	Flag_rocketcontrol = "FLAG_rocketcontrol",
	Cappoint_cap_1 = "CAPPOINT_cap_1",
	Cappoint_cap_2 = "CAPPOINT_cap_2",
	Build_Command_Post = "BUILD_Command_Post",
	Build_Rocket_Controls = "BUILD_Rocket_Controls",
	Plant_Command_Post = "PLANT_Command_Post",
	Plant_Door_Control = "PLANT_Door_Control",
	Plant_Rocket_Controls = "PLANT_Rocket_Controls",
	Mover_truck = "MOVER_truck",
	Call_Artillery_callarty_1 = "CALLARTILLERY_callarty_1",
	Artillery_S_arty_1 = "ARTILLERY_S_arty_1",
	Call_Artillery_callarty_2 = "CALLARTILLERY_callarty_2",
	Artillery_S_arty_2 = "ARTILLERY_S_arty_2",

	//Bots get stuck in this room and do selfkill.
	Navigation =
	{
		selfkill_pt =
		{
			navigate = function(_this)
			{
				sleep(3);
				_this.Bot.ExecCommand("kill");
				sleep(1);
			},
		},
		windowjump =
		{
			navigate = function(_this)
			{
				_this.Bot.PressButton(BTN.JUMP);
				sleep(0.25);
			},
		},
	},

	//Switches
	Switches =
	{
		Gate_Controls =
		{
			Enabled = true,
			Priority = 0.8,
			LimitBots = 8,
			WaypointName = "Gate_Controls",
			LimitTeam = 0, // disabled initially.
			LimitClass = Util.AllClasses,
			AimPosition = Vector3(3756.719, -3709.476, 47.896),
		},
	},

	//CP
	Command_Post_Allies_Built = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"CALLARTILLERY_callarty_1",
			"ARTILLERY_S_arty_1",
		});

		Util.MapDebugPrint( "Command_Post_Allies_Built" );
	},

	Command_Post_Allies_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, true, {
			"CALLARTILLERY_callarty_1",
			"ARTILLERY_S_arty_1",
		});

		if ( Map.Gate )
		{
			SetAvailableMapGoals( TEAM.AXIS, false, {
				"CALLARTILLERY_callarty_1",
				"ARTILLERY_S_arty_1",
			});
		}

		Util.MapDebugPrint( "Command_Post_Allies_Destroyed" );
	},

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

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

	//First Part Door
	Door_Control_Destroyed = function( trigger )
	{
		sleep(5);
		Groups.DisableAllies(Groups.group1);
		Groups.DisableAxis(Groups.group2);
		Groups.EnableAllies(Groups.group3);
		Groups.EnableAxis(Groups.group4);

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

		Util.MapDebugPrint( "Door_Control_Destroyed" );
	},

	//Rocket Controls
	Rocket_Controls_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Rocket_Controls" );
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"FLAG_rocketcontrol",
			"CAPPOINT_cap_2",
		});
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_d_cap_.*" );

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

		Util.MapDebugPrint( "Rocket_Controls_Destroyed" );
	},

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

	cap_2_Captured = function( trigger )
	{
		ETUtil.WinningChat( TEAM.ALLIES );
		ETUtil.LosingChat( TEAM.AXIS );
		Util.MapDebugPrint( "cap_2_Captured" );
	},

	//Magnetic Doors
	powersupply_Taken = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_d_supply_.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_d_alarm_.*" );

		Util.MapDebugPrint( "powersupply_Taken" );
	},

	powersupply_Returned = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_d_supply_.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_d_alarm_.*" );

		Util.MapDebugPrint( "powersupply_Returned" );
	},

	gate_Opened = function( trigger )
	{
		Gate = true;
		Map.Switches.Gate_Controls.LimitTeam = 0;
		sleep(10);
		Groups.DisableAllies(Groups.group3);
		Groups.DisableAxis(Groups.group4);
		Groups.EnableAllies(Groups.group5);
		Groups.EnableAxis(Groups.group6);
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_d_alarm_.*" );

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

		Util.MapDebugPrint( "gate_Opened" );
	},

	cap_1_Captured = function( trigger )
	{
		Map.Switches.Gate_Controls.LimitTeam = (1<<TEAM.ALLIES);

		Util.MapDebugPrint( "cap_1_Captured" );
	},

	//Flag
	forwardflag_Axis_Captured = function( trigger )
	{
		Util.MapDebugPrint( "forwardflag_Axis_Captured" );
	},

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

};

global OnMapLoad = function()
{
	//Triggers
	//CP
	OnTrigger( "Allied Command Post constructed. Charge speed increased!", Map.Command_Post_Allies_Built );
	OnTrigger( "Axis team has destroyed the Allied Command Post!", Map.Command_Post_Allies_Destroyed );
	OnTrigger( "Axis Command Post constructed. Charge speed increased!", Map.Command_Post_Axis_Built );
	OnTrigger( "Allied team has destroyed the Axis Command Post!", Map.Command_Post_Axis_Destroyed );

	//First Part Door
	OnTrigger( "Allies have destroyed the Door Control!", Map.Door_Control_Destroyed );

	//Rocket Controls
	OnTrigger( "The Rocket Controls have been dismantled.", Map.Rocket_Controls_Destroyed );
	OnTrigger( "Allies have stolen The Rocket control!", Map.rocketcontrol_Taken );
	OnTrigger( "Allies have transported the Rocket Control!", Map.cap_2_Captured );

	//Magnetic Gates
	OnTrigger( "Allies have stolen The Gate Power Supply!", Map.powersupply_Taken );
	OnTrigger( "Flag returned powersupply!", Map.powersupply_Returned );
	OnTrigger( "allies_hq_need_engineer", Map.gate_Opened );
	OnTrigger( "Allies have transported the Power Supply!", Map.cap_1_Captured );

	//Flag
	OnTrigger( "Axis reclaim the Forward Bunker!", Map.forwardflag_Axis_Captured );
	OnTrigger( "Allies capture the Forward Bunker!", Map.forwardflag_Allies_Captured );

	//Disable Goals
	Util.DisableGoal( ".*", true ); //All but routes

	//Enable Part 1 Goals
	Groups.EnableAllies(Groups.group1);
	Groups.EnableAxis(Groups.group2);

	//Enable Switches
	Util.UpdateSwitchData();

	//Set max users for goals
	Util.SetMaxUsersInProgress( 1, "BUILD_Command_Post" );
	Util.SetMaxUsersInProgress( 2, "BUILD_Rocket_Controls" );
	Util.SetMaxUsersInProgress( 3, "CHECKPOINT.*" );
	Util.SetMaxUsersInProgress( 2, "PLANT_.*" );
	Util.SetMaxUsersInProgress( 3, "FLAG_powersupply" );
	Util.SetMaxUsersInProgress( 8, "FLAG_rocketcontrol" );
	Util.SetMaxUsersInProgress( 1, "DEFEND_.*" );
	Util.SetMaxUsersInProgress( 1, "ATTACK_.*" );

	Util.SetMaxUsersInUse( 2, "PLANT.*" );

	SetMapGoalProperties( "ATTACK_.*", {mincamptime=60, maxcamptime=120});
	SetMapGoalProperties( "DEFEND_.*", {mincamptime=60, maxcamptime=120});

	//Priority Main Goals
	SetGoalPriority( "CHECKPOINT_forwardflag", 0.75 );
	SetGoalPriority( "PLANTMINE_.*", 0.7 );
	SetGoalPriority( "DEFEND_d_flag_.*", 0.6 );
	SetGoalPriority( "DEFEND_d_door_3", 0.53 );
	SetGoalPriority( "DEFEND_d_door_7", 0.53 );
	SetGoalPriority( "DEFEND_d_door_8", 0.53 );
	SetGoalPriority( "DEFEND_d_supply_.*", 0.53 );
	SetGoalPriority( "DEFEND_d_controls_1", 0.52 );
	SetGoalPriority( "DEFEND_d_controls_2", 0.52 );
	SetGoalPriority( "DEFEND_d_rocket_1", 0.55 );
	SetGoalPriority( "DEFEND_d_rocket_1", 0.55 );
	SetGoalPriority( "DEFEND_d_rocket_6", 0.55 );
	SetGoalPriority( "DEFEND_d_cap_.*", 0.57 );

	//Routes
	MapRoutes =
	{
		PLANT_Door_Control =
		{
			ROUTE_Allies_Spawn_1 =
			{
				ROUTE_First_Spawn_Right = {},
				ROUTE_First_Spawn_Left = {},
			},
			ROUTE_Flagspawn =
			{
				ROUTE_First_Spawn_Hallway = {},
				ROUTE_First_Spawn_Hole =
				{
					ROUTE_First_Spawn_Stairs2 =
					{
						ROUTE_Door_Hall_Back = {},
					},
				},
			},
		},

		CHECKPOINT_forwardflag =
		{
			ROUTE_Allies_Spawn_1 =
			{
				ROUTE_First_Spawn_Left = {
					ROUTE_First_Spawn_Stairs2 = {},
					ROUTE_First_Spawn_Window = {},
				},
				ROUTE_First_Spawn_Right =
				{
					Weight = 2,
					ROUTE_north = {},
					ROUTE_Door_Hall_Gallery = {},
				},
			},
			ROUTE_Axis_Spawn_2 =
			{
				ROUTE_Beyond_Door =
				{
					ROUTE_First_Spawn_Stairs2 = {},
					ROUTE_First_Spawn_Ladder = {},
				},
			},
		},

		DEFEND_d_door_1 =
		{
			ROUTE_Axis_Spawn_1 =
			{
				ROUTE_First_Spawn_Door = {},
				ROUTE_First_Spawn_Hole =
				{
					ROUTE_First_Spawn_Stairs2 =
					{
						ROUTE_Door_Hall_Back = {},
					},
				},
				ROUTE_First_Spawn_Stairs =
				{
					ROUTE_First_Spawn_Stairs2 =
					{
						ROUTE_Door_Hall_Back = {},
					},
				},
			},
		},
		DEFEND_d_door_3 =
		{
			ROUTE_Axis_Spawn_1 =
			{
				ROUTE_First_Spawn_Door = {},
			},
		},
		DEFEND_d_door_5 =
		{
			ROUTE_Axis_Spawn_1 =
			{
				ROUTE_First_Spawn_Hallway = {},
				ROUTE_First_Spawn_Window = {},
			},
		},
		DEFEND_d_door_8 =
		{
			ROUTE_Axis_Spawn_1 =
			{
				ROUTE_First_Spawn_Stairs3 = {},
			},
		},

		ATTACK_a_door_5 =
		{
			ROUTE_Flagspawn =
			{
				ROUTE_First_Spawn_Window = {},
			},
		},
		ATTACK_a_door_6 =
		{
			ROUTE_Flagspawn =
			{
				ROUTE_First_Spawn_Hole =
				{
					ROUTE_First_Spawn_Stairs2 =
					{
						ROUTE_Door_Hall_Back = {},
					},
				},
				ROUTE_First_Spawn_Stairs =
				{
					ROUTE_First_Spawn_Stairs2 =
					{
						ROUTE_Door_Hall_Back = {},
					},
				},
			},
		},
		ATTACK_a_door_7 =
		{
			ROUTE_Flagspawn =
			{
				ROUTE_First_Spawn_Window = {},
				ROUTE_First_Spawn_Hallway = {},
			},
		},
		ATTACK_a_door_8 =
		{
			ROUTE_Flagspawn =
			{
				ROUTE_First_Spawn_Window = {},
				ROUTE_First_Spawn_Stairs3 = {},
			},
		},

		BUILD_Command_Post =
		{
			ROUTE_Allies_Spawn_2 =
			{
				ROUTE_Allies_Spawn_Hall1 =
				{
					ROUTE_Allies_Spawn_Hall2 =
					{
						ROUTE_CP = {},
					},
					ROUTE_Big_Door =
					{
						ROUTE_Stairs_CP =
						{
							ROUTE_CP = {},
						},
					},
				},
			},
			ROUTE_Axis_Spawn_2 =
			{
				ROUTE_Second_Spawn_Door = {},
				ROUTE_Second_Spawn_Room = {},
				ROUTE_Second_Spawn_Hall1 = {},
			},
		},

		FLAG_powersupply =
		{
			ROUTE_Allies_Spawn_2 =
			{
				ROUTE_Allies_Spawn_Hall1 =
				{
					ROUTE_Allies_Spawn_Hall2 =
					{
						ROUTE_CP = {},
					},
				},
				ROUTE_Big_Door =
				{
					ROUTE_Objective_Room = {},
					ROUTE_Stairs_CP =
					{
						ROUTE_CP = {},
					},
				},
			},
		},

		CAPPOINT_cap_1 =
		{
			ROUTE_Objective =
			{
				ROUTE_Broken_Gate = {},
				ROUTE_To_Underground =
				{
					ROUTE_Cap_Ladder =
					{
						ROUTE_Cap_Plateau = {},
					},
					ROUTE_Cap_Hall = {},
				},
				ROUTE_Cap_Stairs =
				{
					ROUTE_Cap_Plateau = {},
				},
			},
		},

		DEFEND_d_controls_1 =
		{
			ROUTE_Axis_Spawn_2 =
			{
				ROUTE_Second_Spawn_Axis_Door = {},
				ROUTE_Second_Spawn_Room = {},
				ROUTE_Second_Spawn_Hall1 = {},
			},
		},

		ATTACK_a_controls_1 =
		{
			ROUTE_Allies_Spawn_2 =
			{
				ROUTE_Broken_Gate = {},
				ROUTE_To_Underground =
				{
					ROUTE_Cap_Ladder =
					{
						ROUTE_Cap_Plateau = {},
					},
					ROUTE_Cap_Hall = {},
				},
				ROUTE_Cap_Stairs =
				{
					ROUTE_Cap_Plateau = {},
				},
			},
			ROUTE_CP_Spawn =
			{
				ROUTE_CP_Spawn_Room = {},
				ROUTE_Broken_Gate = {},
				ROUTE_To_Underground =
				{
					ROUTE_Cap_Ladder =
					{
						ROUTE_Cap_Plateau = {},
					},
					ROUTE_Cap_Hall = {},
				},
				ROUTE_Cap_Stairs =
				{
					ROUTE_Cap_Plateau = {},
				},
			},
		},

		BUILD_Rocket_Controls =
		{
			ROUTE_Allies_Spawn_3 =
			{
				ROUTE_Magnetic_Door =
				{
					ROUTE_Side_Entrance =
					{
						ROUTE_Side_Entrance_Cave = {},
						ROUTE_Side_Entrance_Hall = {},
					},
					ROUTE_Rocket_Hall =
					{
						ROUTE_Rocket_Area1 = {},
						ROUTE_Rocket_Area2 = {},
					},
					ROUTE_Side_Cave =
					{
						ROUTE_Rocket_Area2 = {},
					},
				},
				ROUTE_Magnetic_Gate =
				{
					ROUTE_Rocket_Hall =
					{
						ROUTE_Rocket_Area1 = {},
						ROUTE_Rocket_Area2 = {},
					},
					ROUTE_Side_Cave =
					{
						ROUTE_Rocket_Area2 = {},
					},
					ROUTE_Side_Entrance =
					{
						ROUTE_Side_Entrance_Cave = {},
						ROUTE_Side_Entrance_Hall = {},
					},
				},
			},
		},

		DEFEND_d_rocket_1 =
		{
			ROUTE_Axis_Spawn_3 =
			{
				ROUTE_Third_Spawn_Exit1 = {},
				ROUTE_Third_Spawn_Exit2 = {},
				ROUTE_Third_Spawn_Exit3 =
				{
					ROUTE_Side_Entrance_Hall =
					{
						ROUTE_Side_Entrance_Cave = {},
					},
				},
			},
		},
		DEFEND_d_cap_1 =
		{
			ROUTE_Axis_Spawn_3 =
			{
				ROUTE_Third_Spawn_Exit1 = {},
				ROUTE_Third_Spawn_Exit3 = {},
			},
		},
	};

	//Copy Some Routes
	MapRoutes.PLANT_Command_Post = MapRoutes.BUILD_Command_Post;
	MapRoutes.FLAG_rocketcontrol = MapRoutes.BUILD_Rocket_Controls;
	MapRoutes.ATTACK_a_door_1 = MapRoutes.PLANT_Door_Control;
	MapRoutes.ATTACK_a_door_2 = MapRoutes.PLANT_Door_Control;
	MapRoutes.ATTACK_a_door_3 = MapRoutes.PLANT_Door_Control;
	MapRoutes.ATTACK_a_door_4 = MapRoutes.PLANT_Door_Control;
	MapRoutes.ATTACK_a_controls_2 = MapRoutes.ATTACK_a_controls_1;
	MapRoutes.ATTACK_a_controls_3 = MapRoutes.ATTACK_a_controls_1;
	MapRoutes.ATTACK_a_controls_4 = MapRoutes.ATTACK_a_controls_1;
	MapRoutes.ATTACK_a_controls_5 = MapRoutes.ATTACK_a_controls_1;
	MapRoutes.ATTACK_a_controls_6 = MapRoutes.ATTACK_a_controls_1;
	MapRoutes.ATTACK_a_controls_7 = MapRoutes.ATTACK_a_controls_1;
	MapRoutes.ATTACK_a_rocket_1 = MapRoutes.BUILD_Rocket_Controls;
	MapRoutes.ATTACK_a_rocket_2 = MapRoutes.BUILD_Rocket_Controls;
	MapRoutes.ATTACK_a_rocket_3 = MapRoutes.BUILD_Rocket_Controls;
	MapRoutes.ATTACK_a_rocket_4 = MapRoutes.BUILD_Rocket_Controls;
	MapRoutes.ATTACK_a_rocket_6 = MapRoutes.BUILD_Rocket_Controls;
	MapRoutes.ATTACK_a_rocket_7 = MapRoutes.BUILD_Rocket_Controls;
	MapRoutes.ATTACK_a_rocket_8 = MapRoutes.BUILD_Rocket_Controls;
	MapRoutes.DEFEND_d_door_2 = MapRoutes.DEFEND_d_door_1;
	MapRoutes.DEFEND_d_door_7 = MapRoutes.DEFEND_d_door_3;
	MapRoutes.DEFEND_d_door_6 = MapRoutes.DEFEND_d_door_5;
	MapRoutes.DEFEND_d_door_9 = MapRoutes.DEFEND_d_door_8;
	MapRoutes.DEFEND_d_controls_2 = MapRoutes.DEFEND_d_controls_1;
	MapRoutes.DEFEND_d_controls_3 = MapRoutes.DEFEND_d_controls_1;
	MapRoutes.DEFEND_d_controls_4 = MapRoutes.DEFEND_d_controls_1;
	MapRoutes.DEFEND_d_controls_5 = MapRoutes.DEFEND_d_controls_1;
	MapRoutes.DEFEND_d_controls_6 = MapRoutes.DEFEND_d_controls_1;
	MapRoutes.DEFEND_d_controls_7 = MapRoutes.DEFEND_d_controls_1;
	MapRoutes.DEFEND_d_supply_1 = MapRoutes.DEFEND_d_controls_1;
	MapRoutes.DEFEND_d_supply_2 = MapRoutes.DEFEND_d_controls_1;
	MapRoutes.DEFEND_d_supply_3 = MapRoutes.DEFEND_d_controls_1;
	MapRoutes.DEFEND_d_rocket_1 = MapRoutes.DEFEND_d_rocket_1;
	MapRoutes.DEFEND_d_rocket_2 = MapRoutes.DEFEND_d_rocket_1;
	MapRoutes.DEFEND_d_rocket_3 = MapRoutes.DEFEND_d_rocket_1;
	MapRoutes.DEFEND_d_rocket_5 = MapRoutes.DEFEND_d_rocket_1;
	MapRoutes.DEFEND_d_rocket_6 = MapRoutes.DEFEND_d_rocket_1;
	MapRoutes.DEFEND_d_rocket_7 = MapRoutes.DEFEND_d_rocket_1;
	MapRoutes.DEFEND_d_rocket_8 = MapRoutes.DEFEND_d_rocket_1;
	MapRoutes.DEFEND_d_cap_2 = MapRoutes.DEFEND_d_cap_1;
	MapRoutes.DEFEND_d_cap_3 = MapRoutes.DEFEND_d_cap_1;

	Util.Routes(MapRoutes);
	Util.MapDebugPrint( "Botscript for ^dC2 Missile ^7B3 ^2by ^0:)^1BOK^0(: ^1Naerling ^2was successfully loaded!" );
	Util.MapDebugPrint( "Routes Loaded", true );
};

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

//Groups
global Groups =
{
	//Allies part 1 - Flag and Door.
	group1 =
	{
		Map.Plant_Door_Control,
		Map.Checkpoint_forwardflag,
		"ATTACK_a_door_.*",
	},

	//Axis part 1 - Flag and Door.
	group2 =
	{
		Map.Build_Command_Post,
		Map.Checkpoint_forwardflag,
		"DEFEND_d_door_.*",
		"DEFEND_d_flag_.*",
	},

	//Allies part 2 - Magnetic Gate and CP.
	group3 =
	{
		Map.Build_Command_Post,
		Map.Plant_Command_Post,
		Map.Flag_powersupply,
		Map.Cappoint_cap_1,
		"ATTACK_a_controls_.*",
	},

	//Axis part 2 - Magnetic Gate and CP.
	group4 =
	{
		Map.Build_Command_Post,
		Map.Plant_Command_Post,
		"DEFEND_d_supply_.*",
		"DEFEND_d_controls_.*",
		"PLANTMINE_mine_controls_.*",
		"CALLARTILLERY_callarty_1",
		"ARTILLERY_S_arty_1",
	},

	//Allies part 3 - The Rocket Controls.
	group5 =
	{
		Map.Build_Rocket_Controls,
		Map.Build_Command_Post,
		Map.Plant_Command_Post,
		"ATTACK_a_rocket_.*",
	},

	//Axis part 3 - The Rocket Controls.
	group6 =
	{
		"DEFEND_d_rocket_.*",
		"PLANTMINE_mine_rocket_.*",
		"CALLARTILLERY_callarty_2",
		"ARTILLERY_S_arty_2",
	},

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

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

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

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