//==========================================================================================
//
//	sector47_final.gm
//
//	Who       	When				What
//------------------------------------------------------------------------------------------
//	^1[UJE]^3Niek	21 December 2013	Initial Script
//	MickyP		22 December 2013	Added UsePoints so bots can plant
//
//==========================================================================================
//

global Map =
{
	Debug = 0, // please set to zero before distributing your script

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

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

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

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

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

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

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

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

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

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

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

};

global OnMapLoad = function()
{
	// Register callback functions
	OnTrigger( "Axis Command Post constructed. Charge speed increased!", Map.Axis_Command_Post_Built );
	OnTrigger( "Allied team has destroyed the Axis Command Post!", Map.Axis_Command_Post_Destroyed );
	OnTrigger( "Allies have breached the main gate!", Map.Main_Gate_Destroyed );
	OnTrigger( "The main gate has been repaired!", Map.Main_Gate_Built );
	OnTrigger( "Allied fortification constructed!", Map.allied_command_post_Built );
	OnTrigger( "Allied fortification destroyed!", Map.allied_command_post_Destroyed );
	OnTrigger( "Allies have destroyed the communications tower!", Map.communications_tower_Destroyed );
	OnTrigger( "The vault door has been destroyed!", Map.vault_door_Destroyed );
	OnTrigger( "Allies have stolen the Omega v0.10 keycard!", Map.keycard_Taken );
	OnTrigger( "Flag returned keycard!", Map.keycard_Returned );
	OnTrigger( "Allied team escaped with the Omega V0.10!", Map.keycard_Secured );

	//~Util.DisableGoal( ".*", true ); // all but routes
	//~SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_.*" );
	//~SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_.*" );

	// Max users per goal
	//Util.SetMaxUsers( 1, "DEFEND_.*" );
	//Util.SetMaxUsers( 1, "GRENADE_.*" );
	//Util.SetMaxUsers( 1, "MOUNTMG42_.*" );

	// Camp times
	SetMapGoalProperties( "MOUNTMG42_.*", {MinCampTime=15, MaxCampTime=90} );
	SetMapGoalProperties( "MOBILEMG42_.*", {MinCampTime=10, MaxCampTime=60} );

	Util.AddUsePoint( "PLANT_Main_Gate", { Vector3(-3423,4536,363), Vector3(-3503,4478,365) } );
	Util.AddUsePoint( "PLANT_vault_door", Vector3(-4452,4000,88));

	Util.DisableGoal( "BUILD_Allied_Forest_MG.*");
	Util.DisableGoal( "MOUNTMG42_.*");
	Util.DisableGoal( "REPAIRMG42_.*");

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

global OnBotJoin = function( bot )
{
};

global InitializeRoutes = function()
{
	MapRoutes =
	{
		BUILD_Allied_Forest_MG =
		{
		},
		BUILD_allied_command_post =
		{
		},
		BUILD_Axis_Command_Post =
		{
		},
		BUILD_Main_Gate =
		{
		},
		PLANT_Main_Gate =
		{
		},
		PLANT_communications_tower =
		{
		},
		PLANT_vault_door =
		{
		},
		PLANT_Axis_Command_Post =
		{
		},
		PLANT_Allied_Forest_MG =
		{
		},
		PLANT_allied_command_post =
		{
		},
		FLAG_keycard =
		{
		},
	};
	Util.Routes(MapRoutes);
};
