//==========================================================================================
//
//	uje_skull_fight.gm
//
//	     Who       	       When		             What
//------------------------------------------------------------------------------------------
//	^1[UJE]^3Niek	   14 October 2018	  Initial Script
//	^1[UJE]^3Captain	   15 October 2018	  Add Attack/Routes/Improvements..
//
//==========================================================================================
//

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

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

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

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

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

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

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

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

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

};

global OnMapLoad = function()
{
	// Register callback functions
	OnTrigger( "Allies have stolen ^5ALLIES^7's Skulls!", Map.gold_al_Taken );
	OnTrigger( "Flag dropped gold_al!", Map.gold_al_dropped_Taken );
	OnTrigger( "Flag returned gold_al!", Map.gold_al_dropped_Secured );
	OnTrigger( "^5ALLIES ^7--- ^32 points", Map.gold_al_Secured );

	OnTrigger( "Axis have stolen ^6AXIS^7's Skulls!", Map.gold_ax_Taken );
	OnTrigger( "^6AXIS^7's Skulls dropped.", Map.gold_ax_dropped_Taken );
	OnTrigger( "Flag returned gold_ax!", Map.gold_ax_dropped_Secured );
	OnTrigger( "^5AXIS ^7--- ^32 points", Map.gold_ax_Secured );

      // all but routes
	Util.DisableGoal( ".*", true );


	//Allies goals activation
	SetAvailableMapGoals( TEAM.ALLIES, true, {
		"CAPPOINT_Allied_flag*",
		"FLAG_Gold_al.*",
		"ATTACK_Axis.*",
		".*CAB.*"
	});
      //Axis goals activation
	SetAvailableMapGoals( TEAM.AXIS, true, {
		"CAPPOINT_Axis_flag*",
		"FLAG_Gold_ax.*",
		"ATTACK_Allied.*",
		".*CAB.*"
	});
	// Max users per goal
	Util.SetMaxUsers( 1, "ATTACK.*" );
	Util.SetMaxUsers( 1, "FLAG.*" );

      //SetGoalPriority
	SetGoalPriority( "ATTACK.*", 0.96);
	SetGoalPriority( "FLAG.*", 0.96);

	// Camp times
	SetMapGoalProperties( "ATTACK.*", {MinCampTime=40, MaxCampTime=90});


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

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

global InitializeRoutes = function()
{
	MapRoutes =
	{
	CAPPOINT_Allied_flag =
		{
			ROUTE_Flag_All  =
			{
				ROUTE_R1  =
				{
					ROUTE_Allied_Left  =
					{
					},
					ROUTE_Allied_Front_C  =
					{
					},
					ROUTE_Allied_C  =
					{
					},
				},
				ROUTE_R2  =
				{
					ROUTE_Allied_Left  =
					{
					},
					ROUTE_Allied_Front_C  =
					{
					},
					ROUTE_Allied_C  =
					{
					},
				},
			},
		},
	CAPPOINT_Axis_flag =
		{
			ROUTE_Flag_All  =
			{
				ROUTE_R1  =
				{
					ROUTE_Axis_Left  =
					{
					},
					ROUTE_Axis_Front_C  =
					{
					},
					ROUTE_Axis_C  =
					{
					},
				},
				ROUTE_R2  =
				{
					ROUTE_Axis_Left  =
					{
					},
					ROUTE_Axis_Front_C  =
					{
					},
					ROUTE_Axis_C  =
					{
					},
				},
			},
		},
	};
	MapRoutes["FLAG_gold_al.*"] =
		{
			ROUTE_Allied_S_1  =
			{
				ROUTE_R1  =
				{
					ROUTE_Flag_All  =
					{
					},
				},
				ROUTE_R2  =
				{
					ROUTE_Flag_All  =
					{
					},
				},
			},
			ROUTE_Allies_S_0  =
			{
				ROUTE_R1  =
				{
					ROUTE_Flag_All  =
					{
					},
				},
				ROUTE_R2  =
				{
					ROUTE_Flag_All  =
					{
					},
				},
			},
			ROUTE_Basket_Axis  =
			{
				ROUTE_R1  =
				{
					ROUTE_Flag_All  =
					{
					},
				},
				ROUTE_R2  =
				{
					ROUTE_Flag_All  =
					{
					},
				},
			},
		};

	MapRoutes["FLAG_gold_ax.*"] =
		{
			ROUTE_Axis_S_1  =
			{
				ROUTE_R1  =
				{
					ROUTE_Flag_All  =
					{
					},
				},
				ROUTE_R2  =
				{
					ROUTE_Flag_All  =
					{
					},
				},
			},
			ROUTE_Axis_S_0  =
			{
				ROUTE_R1  =
				{
					ROUTE_Flag_All  =
					{
					},
				},
				ROUTE_R2  =
				{
					ROUTE_Flag_All  =
					{
					},
				},
			},
			ROUTE_Basket_Allied  =
			{
				ROUTE_R1  =
				{
					ROUTE_Flag_All  =
					{
					},
				},
				ROUTE_R2  =
				{
					ROUTE_Flag_All  =
					{
					},
				},
			},
		};
	Util.Routes(MapRoutes);
};
