//==========================================================================================
//
//	venice_tcrc2_v1.gm CYBER4WOLF-EDITED => Fixed strings, goals, added DEFEND at crate for axis
//                          version 1.9C4W      Did not tweak for game play, ONLY FIXED what did not work
//                          July 31, 2019      and added DEFEND for crate. But thats another story. 
//                          August 1, 2019    Added ATTACK for the crate. added some DEFEND locations for the documents.
//                      latest=>version 2.3C4W Added tripmines for documents, tweaked a few other setting to improve
//                                               bot behavior. Have 2 C where bots need more A or D Locations.
//
//                        version 3.3C4W      Added DEFEND and ATTACK locations for the boat,
//                          August 3, 2019      Added region triggers for the boat.
//
//
//
//	Who                  	When		What
//------------------------------------------------------------------------------------------
//	maker@bigsighstudios.com	22 August 2018	Initial Script  
//
//==========================================================================================
//

global Map =
{
	Debug = 0, // please set to zero before distributing your script
	DefendingTeam = TEAM.AXIS,
	Mover_Tank = "MOVER_tank",
	Mover_tank = "MOVER_tank",
	Mover_boat = "MOVER_boat",
	CAPPOINT_boat = "Mover_boat",
	Cappoint_boat = "Mover_boat",
	Relic_Secured = 0,


gate_left = function()
	{
		Util.MapDebugPrint("gate_left");
	},
gate_right = function()
	{
		Util.MapDebugPrint("gate_right");
	},

tank_at_alley = function()
	{
		Util.MapDebugPrint("tank_at_alley");
	},
boat_at_1st_steps = function()
	{
		Util.MapDebugPrint("boat_at_1st_steps");
	},
 
boat_at_wide_steps = function()
	{
		Util.MapDebugPrint("boat_at_wide_steps");
	},
boat_is_b4_corner = function()
	{
		Util.MapDebugPrint("boat_is_b4_corner");
	},
 
boat_is_at_corner = function()
	{
		Util.MapDebugPrint("boat_is_at_corner");
	},
boat_is_below_gate = function()
	{
		Util.MapDebugPrint("boat_is_below_gate");
	},
 
boat_is_almost_done = function()
	{
		Util.MapDebugPrint("boat_is_almost_done");
	},
 
	vehicle_at_location = function( trigger )
	{
		switch(Map.VehicleLocation)
		{
			case 1:
			{ 
                                SetAvailableMapGoals( TEAM.ALLIES, true, "ESCORT_Tank" );
				Map.gate_left();
			}
			case 2:
			{   
                                SetAvailableMapGoals( TEAM.ALLIES, true, "ESCORT_boat" );
				Map.gate_right();
			}
			case 3:
			{  
                                SetAvailableMapGoals( TEAM.ALLIES, true, "ESCORT_boat" );
				Map.tank_at_alley();
			}
			case 4:
			{
                                SetAvailableMapGoals( TEAM.ALLIES, false, "MOUNT_Tank" );
                                SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Tank" );
			        SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Foot_Bridge" ); 
                                SetAvailableMapGoals( TEAM.ALLIES, false, "ESCORT_Tank" );
                                SetAvailableMapGoals( TEAM.ALLIES, true, "ESCORT_boat" );
				SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_docs_bank_1" );
				SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_docs_1" );
				SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_docs_2" );
				SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_docs_3" );
				SetAvailableMapGoals( TEAM.AXIS, false, "TRIPMINE_.*" );
				SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_docs_4" );
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_boat_1st" );
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_boat_2nd" );
				SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_boat_1st" );
				SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_boat_2nd" );
				SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_boat_3rd" );
		Util.RemoveGoal("DEFEND_docs_bank_1");
		Util.RemoveGoal("DEFEND_docs_1");
		Util.RemoveGoal("DEFEND_docs_2");
		Util.RemoveGoal("DEFEND_docs_3");
		Util.RemoveGoal("DEFEND_docs_4");
		Util.RemoveGoal("TRIPMINE_.*");
				Map.boat_at_1st_steps();
			}
			case 5:
			{   
                                SetAvailableMapGoals( TEAM.ALLIES, true, "ESCORT_boat" );
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_boat_3rd" );
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_boat_4th" );
				SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_boat_4th" );
				SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_boat_5th" );
				SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_boat_6th" );
				Map.boat_at_wide_steps();
			}
			case 6:
			{  
                                SetAvailableMapGoals( TEAM.ALLIES, true, "ESCORT_boat" );
				SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_boat_1st" );
				SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_boat_2nd" );
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_boat_5th" );
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_boat_6th" );
				SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_boat_1st" );
				SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_boat_2nd" );
				SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_boat_3rd" );
				Map.boat_is_b4_corner();
			}
			case 7:
			{ 
                                SetAvailableMapGoals( TEAM.ALLIES, true, "ESCORT_boat" );
				SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_boat_3rd" );
				SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_boat_4th" );
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_boat_gate" );
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_b4finishline_1" );
				Map.boat_is_at_corner();
			}
                        case 8:
			{   
                                SetAvailableMapGoals( TEAM.ALLIES, true, "ESCORT_boat" );
				SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_boat_5th" );
				SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_boat_6th" );
				SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_boat_7th" );
				SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_boat_8th" );
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_finishline_1" );
				SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_boat_4th" );
				SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_boat_5th" );
				SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_boat_6th" );       
				Map.boat_is_below_gate();
			}
			case 9:
			{
                                SetAvailableMapGoals( TEAM.ALLIES, true, "ESCORT_boat" );
				SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_finishline_1" );
				Map.boat_is_almost_done();
			}
		}
		Util.MapDebugPrint("vehicle at location " + Map.VehicleLocation, true);
	},

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	Tank_Crate_Planted = function( trigger )
	{
		Util.MapDebugPrint( "Tank_Crate_Planted" );
	},
	Tank_Crate_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, 1, "PLANT_Side_Entrance" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "BUILD_Axis_Command_Post" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_tankbox_1" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_tankbox_2" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_tankbox_3" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_tankbox_4" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_tankbox_5" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_tankbox_6" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "ESCORT_Tank" );
		Util.MapDebugPrint( "Tank_Crate_Destroyed" );
	},

	Tank_Built = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, 1, {
			"ESCORT_Tank",
			"MOUNT_Tank",
		});
		SetAvailableMapGoals( TEAM.AXIS, 1, {
			"MOUNT_Tank",
		});
		Util.MapDebugPrint( "Tank_Built" );
	},
	Tank_Damaged = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, 1, "BUILD_Tank" );
		Util.MapDebugPrint( "Tank_Damaged" );
	},

	Gate_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, 1, "TRIPMINE_docs_1" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "TRIPMINE_docs_2" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "TRIPMINE_docs_3" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "TRIPMINE_docs_4" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "TRIPMINE_docs_5" );
		SetAvailableMapGoals( TEAM.ALLIES, 1, "BUILD_Foot_Bridge" );
		SetAvailableMapGoals( TEAM.ALLIES, 0, "ATTACK_crate_1" );
		SetAvailableMapGoals( TEAM.ALLIES, 0, "ATTACK_crate_2" );
		SetAvailableMapGoals( TEAM.ALLIES, 0, "ATTACK_crate_3" );
		SetAvailableMapGoals( TEAM.ALLIES, 0, "ATTACK_crate_4" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "DEFEND_bank_1" );
		Util.MapDebugPrint( "Gate_Destroyed" );
	},

	Foot_Bridge_Built = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANT_Foot_Bridge" );
		Util.MapDebugPrint( "Foot_Bridge_Built" );
	},
	Foot_Bridge_Destroyed = function( trigger )
	{
		if ( !Map.Relic_Secured )
		{
			SetAvailableMapGoals( TEAM.ALLIES, 1, "BUILD_Foot_Bridge" );
		        SetAvailableMapGoals( TEAM.AXIS, 0, "PLANT_Foot_Bridge" );
		}
		Util.MapDebugPrint( "Foot_Bridge_Destroyed" );
	},

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

	Side_Entrance_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, 1, "BUILD_Foot_Bridge" );
		SetAvailableMapGoals( TEAM.ALLIES, 1, "PLANT_Side_Entrance" );
		SetAvailableMapGoals( TEAM.ALLIES, 1, "DEFEND_bank_1" );
		SetAvailableMapGoals( TEAM.ALLIES, 1, "PLANT_Library_Side_Wall" );
		Util.MapDebugPrint( "Side_Entrance_Destroyed" );
	},

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

	Library_Blown = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, 1, {
			"FLAG_relic",
			"CAPPOINT_boat",
                        "PLANT_Library_Side_Wall",
                        "MOUNT_Tank",
		});
		SetAvailableMapGoals( TEAM.ALLIES, 0, {
                        "ESCORT_Tank",
		});
		SetAvailableMapGoals( TEAM.AXIS, 1, {
			"DEFEND_bank_1",
                        "DEFEND_docs_1",
                        "DEFEND_docs_2",
                        "DEFEND_docs_3",
                        "DEFEND_docs_4",

		});
		SetAvailableMapGoals( TEAM.AXIS, 0, {
			"ESCORT_Tank",
		});
		Util.MapDebugPrint( "Library_Blown" );
	},

	Library_Side_Wall_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, 0, {
                        "PLANT_Library_Side_Wall"
		});
		SetAvailableMapGoals( TEAM.ALLIES, 1, {
                        "FLAG_relic"
		});
		SetAvailableMapGoals( TEAM.AXIS, 1, {
			"DEFEND_bank_1",
                        "DEFEND_docs_1",
                        "DEFEND_docs_2",
                        "DEFEND_docs_3",
                        "DEFEND_docs_4",

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

	relic_Taken = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, 1, {
			"CAPPOINT_boat",
		});
		Util.MapDebugPrint( "relic_Taken" );
	},

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

	relic_Secured = function( trigger )
	{
		Map.Relic_Secured = 1;
		SetAvailableMapGoals( TEAM.ALLIES, 1, {
			"ESCORT_boat",
		});
		SetAvailableMapGoals( TEAM.ALLIES, 0, {
			"ESCORT_Tank",
		});
		SetAvailableMapGoals( TEAM.AXIS, 0, {
			"DEFEND_bank_1",
                        "DEFEND_docs_1",
                        "DEFEND_docs_2",
                        "DEFEND_docs_3",
                        "DEFEND_docs_4",
                        "TRIPMINE_docs_1",
                        "TRIPMINE_docs_2",
                        "TRIPMINE_docs_3",
                        "TRIPMINE_docs_4",
                        "TRIPMINE_docs_5",
		});
		Util.MapDebugPrint( "relic_Secured" );
	},

	relic_Dropped = function( trigger )
	{
		Util.MapDebugPrint( "relic_Dropped" );
	},
	// Dual Command Post

	Allied_CP_Built = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANT_Allied_Command_Post" );
		Util.MapDebugPrint( "Allied_CP_Built" );
	},

	Allied_CP_Planted = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANT_Allied_Command_Post" );
		Util.MapDebugPrint( "Allied_CP_Planted" );
	},

	Allied_CP_Defused = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANT_Allied_Command_Post" );
		Util.MapDebugPrint( "Allied_CP_Defused" );
	},

	Allied_CP_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, 1, "BUILD_Allied_Command_Post" );
		Util.MapDebugPrint( "Allied_CP_Destroyed" );
	},

	Axis_CP_Built = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, 1, "PLANT_Axis_Command_Post" );
		Util.MapDebugPrint( "Axis_CP_Built" );
	},

	Axis_CP_Planted = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, 0, "PLANT_Axis_Command_Post" );
		Util.MapDebugPrint( "Axis_CP_Planted" );
	},

	Axis_CP_Defused = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, 1, "PLANT_Axis_Command_Post" );
		Util.MapDebugPrint( "Axis_CP_Defused" );
	},

	Axis_CP_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, 1, "BUILD_Axis_Command_Post" );
		Util.MapDebugPrint( "Axis_CP_Destroyed" );
	},


};

global OnMapLoad = function()
{
	// Register callback functions //cyber4wolf EDITED - added many, many strings that did not exist.
	OnTrigger( "Planted at the Tank Crate.", Map.Tank_Crate_Planted );
	OnTrigger( "Allies have destroyed the Tank crate", Map.Tank_Crate_Destroyed );

	OnTrigger( "The Tank has been repaired", Map.Tank_Built );
	OnTrigger( "The Tank has been damaged", Map.Tank_Damaged );

	OnTrigger( "Allied team has captured the Outpost!", Map.Gate_Destroyed );

	OnTrigger( "Allied team has constructed the Foot Bridge!", Map.Foot_Bridge_Built );
	OnTrigger( "Axis team has destroyed the Foot Bridge!", Map.Foot_Bridge_Destroyed );

	OnTrigger( "Allies have destroyed the Library Side Wall!", Map.Library_Side_Wall_Destroyed ); //not rebuildable
	OnTrigger( "Planted at Library Side Wall.", Map.Library_Side_Wall_Planted ); //not rebuildable
	//OnTrigger( "MISSING_STRING", Map.Library_Side_Wall_Defused ); //not rebuildable
	

	OnTrigger( "Axis team has constructed the Library MG Nest!", Map.Library_MG_Built );
	OnTrigger( "Allied team has destroyed the Library MG Nest!", Map.Library_MG_Destroyed );

	//OnTrigger( "MISSING_STRING", Map.Library_Side_Wall_Built ); //not rebuildable
	OnTrigger( "Allied team has destroyed the main and back Library Doors!", Map.Library_Blown ); //not working

	//OnTrigger( "MISSING_STRING", Map.Side_Entrance_Built ); //not rebuildable
	OnTrigger( "Planted at Side Entrance.", Map.Side_Entrance_Planted ); //not rebuildable
	OnTrigger( "Allies have destroyed the Side Entrance!", Map.Side_Entrance_Destroyed ); //not rebuildable

	OnTrigger( "MISSING_STRING", Map.Speedboat_Built );//not rebuildable
	OnTrigger( "MISSING_STRING", Map.Speedboat_Damaged );//cant be damaged

	OnTrigger( "Flag dropped relic!", Map.relic_Dropped );
	OnTrigger( "Allies have stolen The Relic!", Map.relic_Taken );
	OnTrigger( "axis_hq_objective_secure", Map.relic_Returned );
	OnTrigger( "Allied team has secured the Relic!", Map.relic_Secured );
	//Allied team is escaping with the Relic!
	//"The Allies have stolen the boat!"

	OnTrigger( "axis_hq_compost_constructed_allies", Map.Allied_CP_Built );
	OnTrigger( "Planted at the Allied Command Post.", Map.Allied_CP_Planted );
	OnTrigger( "Defused at the Allied Command Post.", Map.Allied_CP_Defused );
	OnTrigger( "allies_hq_compost_damaged", Map.Allied_CP_Destroyed );

	OnTrigger( "allies_hq_compost_constructed_axis", Map.Axis_CP_Built );
	OnTrigger( "Planted at the Axis Command Post.", Map.Axis_CP_Planted );
	OnTrigger( "Defused at the Axis Command Post.", Map.Axis_CP_Defused );
	OnTrigger( "axis_hq_compost_damaged", Map.Axis_CP_Destroyed );




	OnTrigger( "boat at location", Map.vehicle_at_location );



       OnTriggerRegion(AABB(3012.150,691.263,-382.698,3456.875,2272.875,-188.875), RegionTrigger.VehicleTrigger);
       OnTriggerRegion(AABB(2909.550,-859.793,-382.875,3582.924,512.875,-148.875), RegionTrigger.VehicleTrigger);
       OnTriggerRegion(AABB(2647.184,-1636.935,-382.870,3570.130,-426.475,-164.875), RegionTrigger.VehicleTrigger);
       OnTriggerRegion(AABB(887.125,-1777.656,-382.874,2661.972,-682.521,-6.532), RegionTrigger.VehicleTrigger);
       OnTriggerRegion(AABB(895.125,-1012.753,-382.856,1408.875,854.694,-136.875), RegionTrigger.VehicleTrigger);
       OnTriggerRegion(AABB(383.126,832.639,-382.873,1448.875,2480.423,-103.156), RegionTrigger.VehicleTrigger);




	Util.AddUsePoint( "PLANT_Tank_Crate", Vec3(-1393,948,-150) );
	GetGoal("BUILD_Tank").TraceEntity = GetGameIdFromEntity(GetEntityByName("tank_build"));

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

	Util.LimitToClass( "PLANT_Axis_Command_Post", 2, 5 );
	Util.LimitToClass( "PLANT_Allied_Command_Post", 1, 5 );
	SetGoalPriority( "ESCORT_boat", 1.10, TEAM.ALLIES );
	SetGoalPriority( "BUILD_Tank", 1.10, TEAM.ALLIES );
	SetGoalPriority( "ESCORT_Tank", 0.89, TEAM.ALLIES );
	SetGoalPriority( "DEFUSE_.*", 0.99, TEAM.AXIS );
	SetGoalPriority( "DEFEND_tankbox_1", 0.98, TEAM.AXIS );
	SetGoalPriority( "DEFEND_tankbox_2", 0.98, TEAM.AXIS );
	SetGoalPriority( "DEFEND_tankbox_3", 0.98, TEAM.AXIS );
	SetGoalPriority( "DEFEND_tankbox_4", 0.98, TEAM.AXIS );
	SetGoalPriority( "DEFEND_tankbox_5", 0.98, TEAM.AXIS );
	SetGoalPriority( "DEFEND_tankbox_6", 0.98, TEAM.AXIS );
	//SetGoalPriority( "DEFEND_bank_1", 0.98, TEAM.AXIS );
	//SetGoalPriority( "DEFEND_docs_1", 0.98, TEAM.AXIS );
	//SetGoalPriority( "DEFEND_docs_2", 0.98, TEAM.AXIS );
	//SetGoalPriority( "DEFEND_docs_3", 0.98, TEAM.AXIS );
	//SetGoalPriority( "DEFEND_docs_4", 0.98, TEAM.AXIS );
          SetGoalPriority( "DEFEND_boat_gate", 0.98, TEAM.AXIS );
          SetGoalPriority( "DEFEND_finishline_1", 1.10, TEAM.AXIS );
	SetGoalPriority( "DEFEND_b4finishline_1", 1.10, TEAM.AXIS );
	SetGoalPriority( "ATTACK_crate_1", 0.98, TEAM.ALLIES );
	SetGoalPriority( "ATTACK_crate_2", 0.98, TEAM.ALLIES );
	SetGoalPriority( "ATTACK_crate_3", 0.98, TEAM.ALLIES );
	SetGoalPriority( "ATTACK_crate_4", 0.98, TEAM.ALLIES );
	SetGoalPriority( "PLANT_Tank_Crate", 0.99, TEAM.ALLIES );
	SetGoalPriority( "PLANT_Library_Side_Wall", 0.98, TEAM.ALLIES, CLASS.ENGINEER, true );

	//Allies
	SetAvailableMapGoals( TEAM.ALLIES, 1, {
		//"CAMP_b1_.*",
		"BUILD_Allied_Command_Post",
		"PLANT_Tank_Crate",
                "PLANT_Side_Entrance",
                "ATTACK_crate_1",
                "ATTACK_crate_2",
                "ATTACK_crate_3",
                "ATTACK_crate_4",
	});
		SetAvailableMapGoals( TEAM.ALLIES, 0, {
			"DEFEND_bank_1",
                        "DEFEND_docs_1",
                        "DEFEND_docs_2",
                        "DEFEND_docs_3",
                        "DEFEND_docs_4",
                         "DEFEND_bank_1",
                        "DEFEND_b4finishline_1",
                        "DEFEND_finishline_1",
                        "DEFEND_boat_1st",
                        "DEFEND_boat_2nd",
                        "DEFEND_boat_3rd",
                        "DEFEND_boat_4th",
                        "DEFEND_boat_5th",
                        "DEFEND_boat_6th",
                        "DEFEND_boat_gate",
                        "ATTACK_boat_1st",
                        "ATTACK_boat_2nd",
                        "ATTACK_boat_3rd",
                        "ATTACK_boat_4th",
                        "ATTACK_boat_5th",
                        "ATTACK_boat_6th",
                        "ATTACK_boat_7th",
	                "ATTACK_boat_8th",
		});



	//Axis
	SetAvailableMapGoals( TEAM.AXIS, 1, {
		//"CAMP_r1_.*",
                "DEFEND_tankbox_1",
                "DEFEND_tankbox_2",
                "DEFEND_tankbox_3",
                "DEFEND_tankbox_4",
                "DEFEND_tankbox_5",
                "DEFEND_tankbox_6",
	});
		SetAvailableMapGoals( TEAM.AXIS, 0, {
			"DEFEND_bank_1",
                        "DEFEND_docs_1",
                        "DEFEND_docs_2",
                        "DEFEND_docs_3",
                        "DEFEND_docs_4",
                        "DEFEND_b4finishline_1",
                        "DEFEND_finishline_1",
                        "DEFEND_boat_1st",
                        "DEFEND_boat_2nd",
                        "DEFEND_boat_3rd",
                        "DEFEND_boat_4th",
                        "DEFEND_boat_5th",
                        "DEFEND_boat_6th",
                        "DEFEND_boat_gate",
                        "ATTACK_boat_1st",
                        "ATTACK_boat_2nd",
                        "ATTACK_boat_3rd",
                        "ATTACK_boat_4th",
                        "ATTACK_boat_5th",
                        "ATTACK_boat_6th",
                        "ATTACK_boat_7th",
	                "ATTACK_boat_8th",
		});
	SetAvailableMapGoals( TEAM.AXIS, 1, {
		"BUILD_Axis_Command_Post",
	});

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

	// Camp times
	SetMapGoalProperties( "MOUNTMG42_.*", {MinCampTime=60, MaxCampTime=200} );
	//SetMapGoalProperties( "CAMP_.*", {MinCampTime=60, MaxCampTime=900} );
	SetMapGoalProperties( "DEFEND_tankbox_1", {MinCampTime=160, MaxCampTime=200} );
	SetMapGoalProperties( "DEFEND_tankbox_2", {MinCampTime=160, MaxCampTime=200} );
	SetMapGoalProperties( "DEFEND_tankbox_3", {MinCampTime=160, MaxCampTime=200} );
	SetMapGoalProperties( "DEFEND_tankbox_4", {MinCampTime=160, MaxCampTime=200} );
	SetMapGoalProperties( "DEFEND_tankbox_5", {MinCampTime=160, MaxCampTime=200} );
	SetMapGoalProperties( "DEFEND_tankbox_6", {MinCampTime=160, MaxCampTime=200} );
	SetMapGoalProperties( "DEFEND_bank_1", {MinCampTime=160, MaxCampTime=200} );
	SetMapGoalProperties( "DEFEND_docs_1", {MinCampTime=160, MaxCampTime=200} );
	SetMapGoalProperties( "DEFEND_docs_2", {MinCampTime=160, MaxCampTime=200} );
	SetMapGoalProperties( "DEFEND_docs_3", {MinCampTime=160, MaxCampTime=200} );
	SetMapGoalProperties( "DEFEND_docs_4", {MinCampTime=160, MaxCampTime=200} );
	SetMapGoalProperties( "ATTACK_crate_1", {MinCampTime=160, MaxCampTime=900} );
	SetMapGoalProperties( "ATTACK_crate_2", {MinCampTime=160, MaxCampTime=200} );
	SetMapGoalProperties( "ATTACK_crate_3", {MinCampTime=160, MaxCampTime=200} );
	SetMapGoalProperties( "ATTACK_crate_4", {MinCampTime=160, MaxCampTime=200} );
	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_TANK_Plant =
		{
		},
		BUILD_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);
};
