//==========================================================================================
//
//	venice_tcrc2_v1.gm
//
//	Who                	When		What
//------------------------------------------------------------------------------------------
//	^1-=-[DSK]-=-^5Classic	31 October 2015	Initial Script
//
//==========================================================================================
//

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	tank_Damaged = function( trigger )
	{
		Util.SetPositionGoal("BUILD_Tank", "MOVER_tank");
		Util.MapDebugPrint( "tank_Damaged" );
	},
};

global OnMapLoad = function()
{
	// Register callback functions
	OnTrigger( "MISSING_STRING", Map.Allied_Command_Post_Built );
	OnTrigger( "MISSING_STRING", Map.Axis_Command_Post_Built );
	OnTrigger( "MISSING_STRING", Map.Foot_Bridge_Built );
	OnTrigger( "MISSING_STRING", Map.Library_MG_Built );
	OnTrigger( "MISSING_STRING", Map.Library_Side_Wall_Built );
	OnTrigger( "MISSING_STRING", Map.Plant_Tank_Built );
	OnTrigger( "MISSING_STRING", Map.Side_Entrance_Built );
	OnTrigger( "MISSING_STRING", Map.Speedboat_Built );
	OnTrigger( "MISSING_STRING", Map.Allied_Command_Post_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Axis_Command_Post_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Foot_Bridge_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Library_MG_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Library_Side_Wall_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Plant_Tank_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Side_Entrance_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Tank_Crate_Destroyed );
	OnTrigger( "MISSING_STRING", Map.relic_Taken );
	OnTrigger( "MISSING_STRING", Map.relic_Returned );
	OnTrigger( "MISSING_STRING", Map.relic_Secured );
	OnTrigger( "The Tank has been damaged", Map.tank_Damaged );

	Util.SetGoalPosition( -1401.381, 956.593, -135.690, "PLANT_Tank_Crate" );

	GetGoal("BUILD_Tank").TraceEntity = GetGameIdFromEntity(GetEntityByName("tank_build"));

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

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

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


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

global OnBotJoin = function( bot )
{
	// Uncomment for shootable breakables
	//~bot.TargetBreakableDist = 90.0;
	// Only set MaxViewDistance on maps with limited sight (e.g. fog)
	//~bot.MaxViewDistance = 2400;
};

global InitializeRoutes = function()
{
	MapRoutes =
	{
		PLANT_Plant_Tank =
		{
		},
		BUILD_Plant_Tank =
		{
		},
		BUILD_Allied_Command_Post =
		{
		},
		PLANT_Allied_Command_Post =
		{
		},
		BUILD_Axis_Command_Post =
		{
		},
		PLANT_Axis_Command_Post =
		{
		},
		BUILD_Foot_Bridge =
		{
		},
		PLANT_Foot_Bridge =
		{
		},
		BUILD_Speedboat =
		{
		},
		FLAG_relic =
		{
		},
		BUILD_Side_Entrance =
		{
		},
		PLANT_Side_Entrance =
		{
		},
		BUILD_Library_MG =
		{
		},
		PLANT_Library_MG =
		{
		},
		BUILD_Library_Side_Wall =
		{
		},
		PLANT_Library_Side_Wall =
		{
		},
		PLANT_Tank_Crate =
		{
		},
	};
	Util.Routes(MapRoutes);
};
