//==========================================================================================
//
//	zogscubeofdeath.gm
//
//	Who  	When		What
//------------------------------------------------------------------------------------------
//	^4Tardis	29 August 2010	Initial Script
//
//==========================================================================================
//

global Map =
{
	Debug = 0,
	Talk = true, //set Talk to false if you don't want the bots to cheer after winning game:

	Egg_Taken = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, "CAPPOINT_EGG" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_ALLIES_EGG.*" );

		Util.MapDebugPrint( "Egg_Taken" );
	},

	Egg_1_Taken = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, true, "CAPPOINT_EGG_1" );
		SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_AXIS_EGG.*" );

		Util.MapDebugPrint( "Egg_1_Taken" );
	},

	Egg_Returned = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_ALLIES_EGG.*" );

		Util.MapDebugPrint( "Egg_Returned" );
	},

	Egg_1_Returned = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_AXIS_EGG.*" );

		Util.MapDebugPrint( "Egg_1_Returned" );
	},

	Egg_Secured = function( trigger )
	{
		//allies win
		ETUtil.WinningChat( TEAM.ALLIES );
		ETUtil.LosingChat( TEAM.AXIS );
		Util.MapDebugPrint( "Egg_Secured" );
	},

	Egg_1_Secured = function( trigger )
	{
		//axis win
		ETUtil.WinningChat( TEAM.AXIS );
		ETUtil.LosingChat( TEAM.ALLIES );
		Util.MapDebugPrint( "Egg_1_Secured" );
	},
};

global OnMapLoad = function()
{
	// Register callback functions
	OnTrigger( "Allies have stolen The Egg!", Map.Egg_Taken );
	OnTrigger( "Axis have stolen The Egg!", Map.Egg_1_Taken );
	OnTrigger( "Axis have returned the Egg!", Map.Egg_Returned );
	OnTrigger( "Allies have returned the Egg!", Map.Egg_1_Returned );
	OnTrigger( "^1Allied team have secured the Egg!", Map.Egg_Secured );
	OnTrigger( "^1Axis team have secured the Egg!", Map.Egg_1_Secured );

	Util.DisableGoal( ".*", true ); // all but routes
	SetAvailableMapGoals( TEAM.AXIS, true, {
		"FLAG_Egg_1",
		"DEFEND_AXIS_EGG.*",
		"CAPPOINT_EGG_1",
	});
	SetAvailableMapGoals( TEAM.ALLIES, true, {
		"FLAG_Egg",
		"DEFEND_ALLIES_EGG.*",
		"CAPPOINT_EGG",
	});
	// 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} );

	MapRoutes =
	{
		FLAG_Egg =
		{
			ROUTE_EGG  =
			{
			},
		},
		FLAG_Egg_1 =
		{
			ROUTE_EGG_1  =
			{
			},
		},
	};

	Util.Routes(MapRoutes);

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

global OnBotJoin = function( bot )
{
};
