//==========================================================================================
//
//	lays_of_schwarzwald_b1.gm CYBER4WOLF Edited July 24, 2019
//                                          Edited August 10, 2019 added both mines, airstrikes, more defend locations
//                                          Edited August 13, 2019 added vehicle triggers fixxed a missed wp area
//	Who                  	When	    What    VERSION 4.7c4w lots of tweaking and added Axis Artillery - Yea baby !
//                                                  TODO: the bots have some issues with the ladder at the rocket launch site
//                                                  The upper level has helped axis defence so the ladder needs tweaking.
//------------------------------------------------------------------------------------------
//	maker@bigsighstudios.com	12 September 2018	Basic working script
//
//	TODO: attack/defend goals, routes, better game logic 
//
//==========================================================================================
//

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

	DispenseHealthTime = 10.0,
	DispenseAmmoTime = 1.0,

	Switches =
	{
		SWITCH_Detonator =
		{
			Enabled = 0,
			WaypointName = "detonator",
			LimitBots = 1,
			LimitTeam = TEAM.ALLIES,
			LimitClass = 0, //(1<<CLASS.ENGINEER),
			Priority = 0.99,
		},
	},

////

	AlliesWon = function( trigger )
	{
		ETUtil.WinningChat( TEAM.ALLIES );
		ETUtil.LosingChat( TEAM.AXIS );

        Util.MapDebugPrint("AlliesWon");
	},

	AxisWon = function( trigger )
	{
		ETUtil.WinningChat( TEAM.AXIS );
		ETUtil.LosingChat( TEAM.ALLIES );

		Util.MapDebugPrint("AxisWon");
	},

//
	//Allies need to place 4 charges
	Exp_Counter = 0,
	Exp_Accum = function( )
	{
		Map.Exp_Counter += 1;
		if ( Map.Exp_Counter == 4 )
		{
			SetAvailableMapGoals( TEAM.ALLIES, 1, "BUILD_Detonator" );
		}
	},

	//Tank
	Tank_Built = function( trigger )
	{
		Util.MapDebugPrint( "Tank_Built" );
	},
	Tank_Damaged = function( trigger )
	{
		Util.MapDebugPrint( "Tank_Damaged" );
	},
Tunnel_Gate_Destroyed = function( trigger )
{
	        SetAvailableMapGoals( TEAM.AXIS, 0, "MOBILEMORTAR_195" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "BUILD_Command_Post" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "AIRSTRIKE_b4tunnel" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "AIRSTRIKE_barrier1" );
		Util.RemoveGoal("BUILD_Tank_Barrier");
		Util.RemoveGoal("AIRSTRIKE_barrier1");
		Util.MapDebugPrint( "Tunnel_Gate_Destroyed" );
},
	Tank_Barrier_Built = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, 1, "PLANT_Tank_Barrier" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "BUILD_Command_Post" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel9" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel8" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel7" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel6" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel5" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel4" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel3" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel2" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel1" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_cp1" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_cp2" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_cp3" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_cp4" );
		//SetAvailableMapGoals( TEAM.AXIS, 1, "AIRSTRIKE_barrier1" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "AIRSTRIKE_b4barrier1" );
		Util.MapDebugPrint( "Tank_Barrier_Built" );
	},
	Tank_Barrier_Destroyed = function( trigger )
	{

	        SetAvailableMapGoals( TEAM.AXIS, 1, "BUILD_Tank_Barrier" );
		SetAvailableMapGoals( TEAM.ALLIES, 1, "BUILD_Command_Post" );
		//SetAvailableMapGoals( TEAM.AXIS, 1, "AIRSTRIKE_barrier1" );
		//SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_tank" );
		//SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_trax" );
		//SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_tank" );
		Util.MapDebugPrint( "Tank_Barrier_Destroyed" );
	},

	Tunnel_Secure = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, 0, {
			"BUILD_Tank",
			"ESCORT_Tank",
		});
		SetAvailableMapGoals( TEAM.ALLIES, 1, {
			"FLAG_.*",
			"CAPPOINT_.*",
		});

		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel11" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel10" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel9" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel8" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel7" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel6" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel5" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel4" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel3" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel2" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_cptunnel1" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_.*" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_cp1" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_cp2" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_cp3" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_cp4" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ESCORT_Tank" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tank_.*" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "CALLARTILLERY_fuhut" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "ARTILLERY_S_fu" );
		Util.MapDebugPrint( "Tunnel_Secure" );
	},

	//Detonator
	Detonator_Built = function( trigger )
	{
		//end round
		sleep(3);
		Map.Switches.SWITCH_Detonator.Enabled = 1;
		SetAvailableMapGoals( TEAM.ALLIES, 1, "SWITCH_Detonator" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANT_Detonator" );
		Util.MapDebugPrint( "Detonator_Built" );
	},
	Detonator_Destroyed = function( trigger )
	{
		Util.MapDebugPrint( "Detonator_Destroyed" );
	},

	//Explosive 1
	expl_mat1_Taken = function( trigger )
	{

		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_1tank" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_2tank" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_3tank" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_4tank" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_5tank" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_6tank" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_dyno_3" );
                //Util.SetMaxUsers( 1, "CALLARTILLERY_fuhut", TEAM.AXIS, true );
                //Util.SetMaxUsers( 1, "ARTILLERY_S_fu", TEAM.AXIS, true ); 
		Util.MapDebugPrint( "expl_mat1_Taken" );
	},
	expl_mat1_Returned = function( trigger )
	{
		Util.MapDebugPrint( "expl_mat1_Returned" );
	},
	expl_mat1_Secured = function( trigger )
	{
		Map.Exp_Accum();
		Util.MapDebugPrint( "expl_mat1_Secured" );
	},

	//Explosive 2
	expl_mat2_Taken = function( trigger )
	{
		Util.MapDebugPrint( "expl_mat2_Taken" );
	},
	expl_mat2_Returned = function( trigger )
	{
		Util.MapDebugPrint( "expl_mat2_Returned" );
	},
	expl_mat2_Secured = function( trigger )
	{
		Map.Exp_Accum();
		Util.MapDebugPrint( "expl_mat2_Secured" );
	},

	//Explosive 3
	expl_mat3_Taken = function( trigger )
	{
		Util.MapDebugPrint( "expl_mat3_Taken" );
	},
	expl_mat3_Returned = function( trigger )
	{
		Util.MapDebugPrint( "expl_mat3_Returned" );
	},
	expl_mat3_Secured = function( trigger )
	{
		Map.Exp_Accum();
		Util.MapDebugPrint( "expl_mat3_Secured" );
	},

	//Explosive 4
	expl_mat4_Taken = function( trigger )
	{
		Util.MapDebugPrint( "expl_mat4_Taken" );
	},
	expl_mat4_Returned = function( trigger )
	{
		Util.MapDebugPrint( "expl_mat4_Returned" );
	},
	expl_mat4_Secured = function( trigger )
	{
		Map.Exp_Accum();
		Util.MapDebugPrint( "expl_mat4_Secured" );
	},


	// Neutral Command Post
	CP_Owner = 0,
	CP_Dyno = 0,

	Set_CP = function(_p) // p = TEAM.ALLIES or TEAM.AXIS or 0 (unbuilt)
	{
		switch(_p)
		{
			case 0:
			{
				Map.CP_Owner = 0;
				SetAvailableMapGoals( TEAM.ALLIES, 1, "BUILD_Command_Post" );
				SetAvailableMapGoals( TEAM.ALLIES, 0, "PLANT_Command_Post" );
				SetAvailableMapGoals( TEAM.AXIS,   1, "BUILD_Command_Post" );
				SetAvailableMapGoals( TEAM.AXIS,   0, "PLANT_Command_Post" );
			}
			case TEAM.ALLIES:
			{
				Map.CP_Owner = TEAM.ALLIES;
				SetAvailableMapGoals( TEAM.ALLIES, 0, "BUILD_Command_Post" );
				SetAvailableMapGoals( TEAM.ALLIES, 0, "PLANT_Command_Post" );
				SetAvailableMapGoals( TEAM.AXIS,   0, "PLANT_Command_Post" );
				SetAvailableMapGoals( TEAM.AXIS,   0, "BUILD_Command_Post" );

			}
			case TEAM.AXIS:
			{
				Map.CP_Owner = TEAM.AXIS;
				SetAvailableMapGoals( TEAM.ALLIES, 0, "BUILD_Command_Post" );
				SetAvailableMapGoals( TEAM.ALLIES, 1, "PLANT_Command_Post" );
				SetAvailableMapGoals( TEAM.AXIS,   0, "PLANT_Command_Post" );
				SetAvailableMapGoals( TEAM.AXIS,   0, "BUILD_Command_Post" );
			}
		}
		Util.MapDebugPrint("CP Owner: " + Map.CP_Owner );
	},
	Allied_CP_Built = function( trigger )
	{
		Map.Set_CP(TEAM.ALLIES);
		Util.MapDebugPrint( "Allied_CP_Built" );
	},
	Allied_CP_Destroyed = function( trigger )
	{
		Map.CP_Dyno = 0;
		Map.Set_CP(0);
		Util.MapDebugPrint( "Allied_CP_Destroyed" );
	},
	Axis_CP_Built = function( trigger )
	{
		Map.Set_CP(TEAM.AXIS);
		Util.MapDebugPrint( "Axis_CP_Built" );
	},
	Axis_CP_Destroyed = function( trigger )
	{
		Map.CP_Dyno = 0;
		Map.Set_CP(0);
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_barrier_1e" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tank_done" );
		Util.MapDebugPrint( "Axis_CP_Destroyed" );
	},
	CP_Planted = function( trigger )
	{
		Map.CP_Dyno += 1;
		Util.MapDebugPrint( "CP_Planted" );
	},
	CP_Defused = function( trigger )
	{
		Map.CP_Dyno -= 1;
		Util.MapDebugPrint( "CP_Defused" );
	},

// Command Post END
// vehicletriggerpart_1

tank_at_barricade = function()
	{
		Util.MapDebugPrint("tank_at_barricade");
	},
 
tank_past_barricade = function()
	{
		Util.MapDebugPrint("tank_past_barricade");
	},
tank_is_b4_tunnel = function()
	{
		Util.MapDebugPrint("tank_is_b4_tunnel");
	},
  tank_at_tunnel = function()
	{
		Util.MapDebugPrint("tank_at_tunnel");
	},
///// noticevehicleatlocationfunctiontrigger  
	vehicle_at_location = function( trigger )
	{
		switch(Map.VehicleLocation)
		{
			case 1: 
			{ 
      SetAvailableMapGoals( TEAM.AXIS, true, "ESCORT_tank" );

		SetAvailableMapGoals( TEAM.AXIS, 1, "ARTILLERY_S_tankbarricade" );
      SetAvailableMapGoals( TEAM.AXIS, true, "AIRSTRIKE_barrier1" );
      SetAvailableMapGoals( TEAM.AXIS, false, "AIRSTRIKE_b4barrier1" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_tank" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tank_1" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_trax" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tank_2" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_cornertrax" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tank_3" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_telephonepole_1" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tank_4" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "CALLARTILLERY_telephonepole_2" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "ARTILLERY_S_tank_5" );
				Map.tank_at_barricade();
			}
			case 2:
			{   
      SetAvailableMapGoals( TEAM.AXIS, true, "ESCORT_tank" );
      SetAvailableMapGoals( TEAM.AXIS, false, "AIRSTRIKE_barrier1" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_telephonepole_1" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tank_4" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_telephonepole_2" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tank_5" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "CALLARTILLERY_barrier_1a" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "ARTILLERY_S_tank_6" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "CALLARTILLERY_barrier_1b" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "ARTILLERY_S_tank_7" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "CALLARTILLERY_barrier_1c" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "ARTILLERY_S_tank_8" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANTMINE_1tank" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANTMINE_2tank" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANTMINE_3tank" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANTMINE_4tank" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANTMINE_5tank" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANTMINE_6tank" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANTMINE_7tank" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANTMINE_8tank" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "TRIPMINE_cptunnel15" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "TRIPMINE_cptunnel14" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "TRIPMINE_cptunnel13" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "TRIPMINE_cptunnel12" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANTMINE_sidepath_1" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANTMINE_sidepath_2" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANTMINE_sidepath_3" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "PLANTMINE_sidepath_4" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "TRIPMINE_sidepath_1" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "DEFEND_dyno_1" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "DEFEND_dyno_6" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "DEFEND_omgdyno1" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "DEFEND_6thlinedef" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "DEFEND_7thlinedef" );
				Map.tank_past_barricade();
			}
			case 3:
			{		                            
                SetAvailableMapGoals( TEAM.AXIS, true, "ESCORT_tank" );
                SetAvailableMapGoals( TEAM.AXIS, true, "AIRSTRIKE_b4tunnel" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_barrier_1a" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tank_6" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_barrier_1b" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tank_7" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_barrier_1c" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tank_8" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "CALLARTILLERY_barrier_1d" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "ARTILLERY_S_tank_9" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "DEFEND_dyno_2" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "DEFEND_dyno_3" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_dyno_4" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "DEFEND_omgdyno2" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "DEFEND_omgdyno3" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "DEFEND_omgdyno4" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_1stlinedef" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_2ndlinedef" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_4thlinedef" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_5thlinedef" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_tankbarricadecall" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tankbarricade" );
				Map.tank_is_b4_tunnel();
                          }
                         case 4:
			{		                            
                SetAvailableMapGoals( TEAM.AXIS, true, "ESCORT_tank" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_firstlinedef" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_3rdlinedef" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_6thlinedef" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_7thlinedef" );
                SetAvailableMapGoals( TEAM.AXIS, 0, "AIRSTRIKE_b4tunnel" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "CALLARTILLERY_barrier_1d" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tank_9" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "CALLARTILLERY_barrier_1e" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "ARTILLERY_S_tank_done" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "DEFEND_dyno_5" );
				Map.tank_at_tunnel();
                          }
		}
		Util.MapDebugPrint("vehicle at location " + Map.VehicleLocation, true);
	},

//

};

global OnMapLoad = function()
{
	// Register callback functions

        // winning - Losing chat
	OnTrigger( "rocket_base_script_trigger", Map.AlliesWon );
	OnTrigger( "Timelimit hit!", Map.AxisWon );
///////////////////////////////////////////////////////////////////////



	OnTrigger( "^aThe tank has been repaired.", Map.Tank_Built );
	OnTrigger( "^aThe tank has been damaged.", Map.Tank_Damaged );

	OnTrigger( "^aTank Barrier has been constructed.", Map.Tank_Barrier_Built );
	OnTrigger( "MISSING_STRING", Map.Tank_Barrier_Destroyed );
	OnTrigger( "^aThe tank has passed the barrier!", Map.Tank_Barrier_Destroyed );

	//"^aThe tank is approaching to the Tunnel Gate!"
	OnTrigger( "^aTunnel gate has been destroyed!", Map.Tunnel_Gate_Destroyed );

	SetAvailableMapGoals( TEAM.AXIS,   1, "BUILD_Command_Post" );
	//"^aAllies lost control over the Tunnel!" "^aAxis foward spawns are now available!"

	OnTrigger( "^aAllies have permanently secured the tunnel!", Map.Tunnel_Secure );
	//"^aAllies Have secured the Tunnel!"

	OnTrigger( "^aDynamite detonator has been constructed.", Map.Detonator_Built );
	OnTrigger( "MISSING_STRING", Map.Detonator_Destroyed );

	//Explosive 1
	OnTrigger( "^aExplosion Materials have been stolen!", Map.expl_mat1_Taken );
	OnTrigger( "^aExplosion Materials have been returned!", Map.expl_mat1_Returned );
	OnTrigger( "^aExplosion Materials have been delivered to Rocket Base!", Map.expl_mat1_Secured );

	//Explosive 2 same wm_announce as mat1
	OnTrigger( "MISSING_STRING", Map.expl_mat2_Taken );
	OnTrigger( "MISSING_STRING", Map.expl_mat2_Returned );
	OnTrigger( "MISSING_STRING", Map.expl_mat2_Secured );

	//Explosive 3 same wm_announce as mat1
	OnTrigger( "MISSING_STRING", Map.expl_mat3_Taken );
	OnTrigger( "MISSING_STRING", Map.expl_mat3_Returned );
	OnTrigger( "MISSING_STRING", Map.expl_mat3_Secured );

	//Explosive 4 same wm_announce as mat1
	OnTrigger( "MISSING_STRING", Map.expl_mat4_Taken );
	OnTrigger( "MISSING_STRING", Map.expl_mat4_Returned );
	OnTrigger( "MISSING_STRING", Map.expl_mat4_Secured );

	//"^aAllied team set up all explosion materials!"

	OnTrigger( "^aAllied Command Post constructed. Charge speed increased!",  Map.Allied_CP_Built );
	OnTrigger( "^aAxis team has destroyed the Allied Command Post!",          Map.Allied_CP_Destroyed );
	OnTrigger( "^aAxis Command Post constructed. Charge speed increased!",    Map.Axis_CP_Built );
	OnTrigger( "^aAllied team has destroyed the Axis Command Post!",          Map.Axis_CP_Destroyed );
	OnTrigger( "Planted at the Command Post.",                              Map.CP_Planted  );
	OnTrigger( "Defused at the Command Post.",                              Map.CP_Defused  );

// vehicletriggerpart_2

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



OnTriggerRegion(AABB(-5096.326,1282.586,-182.875,-3583.879,1866.586,-92.875), RegionTrigger.VehicleTrigger);
OnTriggerRegion(AABB(-5564.021,2074.496,-183.972,-4879.126,3175.162,-92.875), RegionTrigger.VehicleTrigger);
OnTriggerRegion(AABB(-6413.490,3260.568,-190.846,-5089.109,3852.032,-92.875), RegionTrigger.VehicleTrigger);
OnTriggerRegion(AABB(-7320.583,3242.993,-187.765,-6520.584,3764.105,-92.875), RegionTrigger.VehicleTrigger);
/////
	// Setup Map Start
	//--------------------------------------------------------------

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

	Util.UpdateSwitchData();

	//Allies do -------------------------------------------------------
	SetAvailableMapGoals( TEAM.ALLIES, 1, {
		"ATTACK_.*",
		"BUILD_Tank",
		"ESCORT_Tank",
	});
	Util.SetMaxUsers( 4, "ESCORT_Tank" );

            // allies dont do --------------------------------------------------------
		SetAvailableMapGoals( TEAM.ALLIES, 0, {
			"PLANTMINE_1tank",
			"PLANTMINE_2tank",
			"PLANTMINE_3tank",
			"PLANTMINE_4tank",
			"PLANTMINE_5tank",
			"PLANTMINE_6tank",
			"PLANTMINE_7tank",
			"PLANTMINE_8tank",
                        "ARTILLERY_S_tank_.*",
			"AIRSTRIKE_b4barrier1",
			"AIRSTRIKE_b4tunnel",
			"AIRSTRIKE_barrier1",
			"PLANTMINE_cp1",
			"PLANTMINE_cp2",
			"PLANTMINE_cp3",
			"PLANTMINE_cp4",
                        "PLANTMINE_sidepath_.*",
                        "TRIPMINE_sidepath_1",
                        "ARTILLERY_S_tankbarricade",
                        "DEFEND_.*",
		});

	//Axis do ---------------------------------------------------------
	       SetAvailableMapGoals( TEAM.AXIS, 1, {
		        "BUILD_Tank_Barrier",
		        "ESCORT_Tank",
                        "MOBILEMORTAR_195",
			"DEFEND_firstlinedef",

	});
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_tank" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tank_1" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_trax" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tank_2" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "CALLARTILLERY_cornertrax" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "ARTILLERY_S_tank_3" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "CALLARTILLERY_telephonepole_1" );
		SetAvailableMapGoals( TEAM.AXIS, 1, "ARTILLERY_S_tank_4" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "CALLARTILLERY_tankbarricadecall" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "ARTILLERY_S_tankbarricade" );

      // axis dont do  --------------------------------------------------------------------
	        SetAvailableMapGoals( TEAM.AXIS, 0, {
			"AIRSTRIKE_b4tunnel",
			"AIRSTRIKE_barrier1",
			"PLANTMINE_cp1",
			"PLANTMINE_cp2",
			"PLANTMINE_cp3",
			"PLANTMINE_cp4",
			"DEFEND_6thlinedef",
			"DEFEND_7thlinedef",
			"DEFEND_1stlinedef",
			"DEFEND_2ndlinedef",
			"DEFEND_3rdlinedef",
			"DEFEND_4thlinedef",
			"DEFEND_5thlinedef",
			"DEFEND_6thlinedef",
			"DEFEND_7thlinedef",
	});
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_dyno_.*" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "DEFEND_omgdyno.*" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_sidepath_1" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_sidepath_2" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_sidepath_3" );
		SetAvailableMapGoals( TEAM.AXIS, 0, "PLANTMINE_sidepath_4" );
	//Common -------------------------------------------------------
	Util.LimitToClass( "PLANT_Command_Post", 0, 5 );
	//Util.LimitToClass( "DEFEND_.*", TEAM.AXIS, CLASS.MEDIC, CLASS.COVERTOPS, CLASS.SOLDIER, true );
	Util.LimitToClass( "ESCORT_tank", TEAM.AXIS, CLASS.MEDIC, CLASS.COVERTOPS, CLASS.SOLDIER, true );

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

	// Camp times
	//SetMapGoalProperties( "MOUNTMG42_.*", {MinCampTime=15, MaxCampTime=90} );
	SetMapGoalProperties( "DEFEND_.*", {MinCampTime=900, MaxCampTime=990} );
	SetMapGoalProperties( "DEFEND_dyno_.*", {MinCampTime=900, MaxCampTime=990} );
	SetGoalPriority( "ARTILLERY_S_tank_.*", 3.00, TEAM.AXIS, true );
	SetGoalPriority( "CALLARTILLERY_.*", 3.00, TEAM.AXIS, true );
	SetGoalPriority( "AIRSTRIKE_b4barrier1", 1.00, TEAM.AXIS, true );
	SetGoalPriority( "AIRSTRIKE_barrier1", 1.00, TEAM.AXIS, true );
	SetGoalPriority( "AIRSTRIKE_b4tunnel", .90, TEAM.AXIS, true );
	SetGoalPriority( "DEFEND_omgdyno4", .98, TEAM.AXIS, true );
	SetGoalPriority( "DEFEND_omgdyno3", .98, TEAM.AXIS, true );
	SetGoalPriority( "DEFEND_omgdyno2", 3.00, TEAM.AXIS, true );
	SetGoalPriority( "DEFEND_omgdyno1", 1.10, TEAM.AXIS, true );
	SetGoalPriority( "DEFEND_dyno_5", .99, TEAM.AXIS, true );
	SetGoalPriority( "DEFEND_dyno_6", 3.00, TEAM.AXIS, true );

	SetGoalPriority( "PLANTMINE_1tank", 1.95, TEAM.AXIS, CLASS.ENGINEER, true );
	SetGoalPriority( "PLANTMINE_2tank", 1.95, TEAM.AXIS, CLASS.ENGINEER, true );
	SetGoalPriority( "PLANTMINE_7tank", 1.99, TEAM.AXIS, CLASS.ENGINEER, true );
	SetGoalPriority( "PLANTMINE_8tank", 1.99, TEAM.AXIS, CLASS.ENGINEER, true );

	SetGoalPriority( "TRIPMINE_cptunnel15", 3.00, TEAM.AXIS, CLASS.ENGINEER, true );
	SetGoalPriority( "TRIPMINE_cptunnel14", 2.99, TEAM.AXIS, CLASS.ENGINEER, true );
	SetGoalPriority( "TRIPMINE_cptunnel13", 2.00, TEAM.AXIS, CLASS.ENGINEER, true );
	SetGoalPriority( "TRIPMINE_cptunnel12", 2.00, TEAM.AXIS, CLASS.ENGINEER, true );

	SetGoalPriority( "DEFUSE_.*", 3.00, TEAM.AXIS, true );
	Util.SetMaxUsers( 1, "BUILD_Command_Post" );
        Util.SetMaxUsers( 1, "DEFUSE_.*", TEAM.AXIS, true );



	print( "^3Omni-bot map script ^3Edited by ^1C^2Y^3B^6E^5R^04^1W^2O^3L^6F for map: ^7" + GetMapName() );
	
	Util.BotChat( 0, "say", "^3Omni-bot map script ^3Edited by ^1C^2Y^3B^6E^5R^04^1W^2O^3L^6F ^3for ^3map ^7" + GetMapName(), 1 );

	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 =
	{
		BUILD_Tank =
		{
		},

		BUILD_Tank_Barrier =
		{
		},
		PLANT_Tank_Barrier =
		{
		},

		BUILD_Command_Post =
		{
		},
		PLANT_Command_Post =
		{
		},

		BUILD_Detonator =
		{
		},
		PLANT_Detonator =
		{
		},

		FLAG_expl_mat1 =
		{
		},
		FLAG_expl_mat2 =
		{
		},
		FLAG_expl_mat3 =
		{
		},
		FLAG_expl_mat4 =
		{
		},

	};
	Util.Routes(MapRoutes);
};
