//==========================================================================================
//
//  6flags.gm
//
// Who   	When		What
//------------------------------------------------------------------------------------------
// palota	16 August 2025	Initial Script
//
//==========================================================================================
//

global Map =
{
	Navigation =
	{
		chimney =
		{
			navigate = function()
			{
				this.AddAimRequest(Priority.VeryHigh, "facing", Vec3(-0.023, 0.425, 0.905));
				sleep(2.5);
			}
		},
	},

	flag1_Axis_Captured = function()
	{
		SetGoalPriority("CHECKPOINT_flag[16]", 0.7, TEAM.AXIS);
		Util.LimitToTeam(TEAM.AXIS, ".*MG42_mg1");
		Util.MapDebugPrint("flag1_Axis_Captured");
	},

	flag1_Allies_Captured = function()
	{
		SetGoalPriority("CHECKPOINT_flag[16]", 0.7, TEAM.ALLIES);
		Util.LimitToTeam(TEAM.ALLIES, ".*MG42_mg1");
		Util.MapDebugPrint("flag1_Allies_Captured");
	},

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

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

	flag3_Axis_Captured = function()
	{
		Util.LimitToTeam(TEAM.AXIS, ".*MG42_mg3");
		Util.MapDebugPrint("flag3_Axis_Captured");
	},

	flag3_Allies_Captured = function()
	{
		Util.LimitToTeam(TEAM.ALLIES, ".*MG42_mg3");
		Util.MapDebugPrint("flag3_Allies_Captured");
	},

	flag4_Axis_Captured = function()
	{
		Util.LimitToTeam(TEAM.AXIS, ".*MG42_mg4");
		Util.MapDebugPrint("flag4_Axis_Captured");
	},

	flag4_Allies_Captured = function()
	{
		Util.LimitToTeam(TEAM.ALLIES, ".*MG42_mg4");
		Util.MapDebugPrint("flag4_Allies_Captured");
	},

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

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

	flag6_Axis_Captured = function()
	{
		SetGoalPriority("CHECKPOINT_flag[16]", 0.7, TEAM.AXIS);
		Util.LimitToTeam(TEAM.AXIS, ".*MG42_mg6");
		Util.MapDebugPrint("flag6_Axis_Captured");
	},

	flag6_Allies_Captured = function()
	{
		SetGoalPriority("CHECKPOINT_flag[16]", 0.7, TEAM.ALLIES);
		Util.LimitToTeam(TEAM.ALLIES, ".*MG42_mg6");
		Util.MapDebugPrint("flag6_Allies_Captured");
	},

	base_Axis_Captured = function()
	{
		SetGoalPriority("CHECKPOINT_flag[16]", 0.82, TEAM.ALLIES);
		Util.MapDebugPrint("base_Axis_Captured");
	},

	base_Allies_Captured = function()
	{
		SetGoalPriority("CHECKPOINT_flag[16]", 0.82, TEAM.AXIS);
		Util.MapDebugPrint("base_Allies_Captured");
	},

};

global OnMapLoad = function()
{
	OnTrigger("^1AXIS ^7HAVE CAPTURED BOTH BASES!", Map.base_Axis_Captured);
	OnTrigger("^dALLIES ^7HAVE CAPTURED BOTH BASES!", Map.base_Allies_Captured);
	OnTrigger("CHECKPOINT_flag1 to team 1", Map.flag1_Axis_Captured);
	OnTrigger("CHECKPOINT_flag1 to team 2", Map.flag1_Allies_Captured);
	OnTrigger("CHECKPOINT_flag2 to team 1", Map.flag2_Axis_Captured);
	OnTrigger("CHECKPOINT_flag2 to team 2", Map.flag2_Allies_Captured);
	OnTrigger("CHECKPOINT_flag3 to team 1", Map.flag3_Axis_Captured);
	OnTrigger("CHECKPOINT_flag3 to team 2", Map.flag3_Allies_Captured);
	OnTrigger("CHECKPOINT_flag4 to team 1", Map.flag4_Axis_Captured);
	OnTrigger("CHECKPOINT_flag4 to team 2", Map.flag4_Allies_Captured);
	OnTrigger("CHECKPOINT_flag5 to team 1", Map.flag5_Axis_Captured);
	OnTrigger("CHECKPOINT_flag5 to team 2", Map.flag5_Allies_Captured);
	OnTrigger("CHECKPOINT_flag6 to team 1", Map.flag6_Axis_Captured);
	OnTrigger("CHECKPOINT_flag6 to team 2", Map.flag6_Allies_Captured);

	OnTriggerRegion(Vec3(9379,11954,512), 300, RegionTrigger.DisableCombatMovement); //jump to mg3

	Util.LimitToTeam(TEAM.AXIS, ".*MG42_mg[13]");
	Util.LimitToTeam(TEAM.ALLIES, ".*MG42_mg[46]");
	Util.SetMaxUsers(1, "MOUNTMG42.*");

	Util.MapDebugPrint("Omni-bot map script for " + GetMapName() + " executed.");
};
