//==========================================================================================
//
//	chateau_norvegien.gm
//
//	Who                  	When		What
//------------------------------------------------------------------------------------------
//	maker@bigsighstudios.com	11 October 2017	waypoints
//	palota	5 July 2025	script, cappoint
//==========================================================================================
//

global Map =
{
	Big_Gate_Built = function()
	{
		SetAvailableMapGoals(TEAM.ALLIES, false, "CAPPOINT.*");
		Util.MapDebugPrint("Big_Gate_Built");
	},

	Big_Gate_Destroyed = function()
	{
		SetAvailableMapGoals(TEAM.ALLIES, true, "CAPPOINT.*");
		Util.MapDebugPrint("Big_Gate_Destroyed");
	},

	fence_Built = function()
	{
		SetAvailableMapGoals(TEAM.ALLIES, false, {"FLAG_radarbox", "FLAG_radarbox2"});
		Wp.SetWaypointFlag("fence", "closed", true);
		Util.MapDebugPrint("fence_Built");
	},

	fence_Destroyed = function()
	{
		SetAvailableMapGoals(TEAM.ALLIES, true, {"FLAG_radarbox", "FLAG_radarbox2"});
		Wp.SetWaypointFlag("fence", "closed", false);
		Util.MapDebugPrint("fence_Destroyed");
	},

};

global OnMapLoad = function()
{
	OnTrigger("barricade_construite", Map.fence_Built);
	OnTrigger("The fence has been destroyed!", Map.fence_Destroyed);
	OnTrigger("grosse_porte_construite", Map.Big_Gate_Built);
	OnTrigger("The Big Gate has been destroyed!", Map.Big_Gate_Destroyed);

	Util.SetGoalPosition(-24.000, 1592.000, -124.000, "PLANT_Big_Gate");
	SetGoalPriority("DEFUSE.*", 0, 0, 0, true);
	Util.MapDebugPrint("Omni-bot map script for " + GetMapName() + " executed.");
};
