//==========================================================================================
//
//	et_tank_beta3.gm
//
//	Who       	When		What
//------------------------------------------------------------------------------------------
//	^6BOTZ^3R^jUS
// Things to do: #1. Put in entity region triggers, this should solve the issue with no 
// trigger strings for the 2 breakable entity's in the 2 of the 3 route paths to the documants.
//  #2. Need to attempt to fix the LONG ladder waypoints, too many bots falling to their death.
//
// WHAT IS INCORRECT WITH THE MAP:
// AirTunnel: the game has no ICON's displayed for this entity, the game has 
// NO trigger strings linked to the AirTunnel entity getting BROKEN or BUILT. 
// It is BREAKABLE, not destructable. Planting dyno does nothing to the AirTunnel cover. 
// A Satchel, bullets or a grenade will BREAK the AirTunnel cover. 
// This is NOT normal, the dyno explosion should break entity just like windows.
// 
// The Destructable bridge is meaningless, the bridge is still crossable after destruction. 
// Which is a good thing because the Axis NEED to cross it. But Destroying it is an Axis objective.
//
// Hopefully done with these files for now, May 20, 2020 3:56PM Ver. 1.08
//
// 
// CYBER4WOLF C4W BOTZRUS Version 1.2 April 17, 2022 
// Tweaked a few waypoints and named one airboom for the PLANT PLANT_AirTunel Goal
// ROFL allies normally win, a few \kills still & needs more tweaking but files work
//==========================================================================================
//

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

    MainEntranceDestroyed = false,

// this seems to make bots give out health packs and ammo better than DEFAULT does
	DispenseHealthTime = 15.0,
	DispenseAmmoTime = 1.0,

	Roles =
	{
		ALLIES =
		{
			AllBots = true, // each bot is considered for a role
			DEFENDER =
			{
				
				numbots = 3,
				crucialClass = CLASS.ENGINEER, CLASS.MEDIC,
			},
			DEFENDER1 =
			{
				
				numbots = 3,
				crucialClass = CLASS.ENGINEER, CLASS.MEDIC,
			},
			DEFENDER2 =
			{
				
				numbots = 3,
				//crucialClass = CLASS.ENGINEER, CLASS.MEDIC,
			},

		},

		AXIS =
		{
			AllBots = true, // each bot is considered for a role
			ATTACKER =
			{
				numbots = 3,
				//crucialClass = CLASS.ENGINEER, CLASS.MEDIC,
			},
			ATTACKER1 =
			{
				//spawnpt = 4,
				numbots = 3,
				crucialClass = CLASS.ENGINEER, CLASS.MEDIC,
			},
			ATTACKER2 =
			{
				spawnpt = 3,
				numbots = 3,
				crucialClass = CLASS.ENGINEER, CLASS.MEDIC,
			},
		},
	},

	AirTunel_Built = function( trigger )
	{
	SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_AirTunel" );	
        SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_AirTunel" );

		Util.MapDebugPrint( "^6AirTunel_Built" );
	},

	Allied_Ladder_Built = function( trigger )
	{
	SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Allied_Ladder" );
	SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Allied_Ladder" );
		Util.MapDebugPrint( "^6Allied_Ladder_Built" );
	},

	Base_MG_Built = function( trigger )
	{
	SetAvailableMapGoals( TEAM.AXIS, true, "MOUNT_Base_MG" );
	SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Base_MG" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Base_MG" );
		Util.MapDebugPrint( "^6Base_MG_Built" );
	},

	Bridge_Built = function( trigger )
	{
	SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Bridge" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Bridge" );
		Util.MapDebugPrint( "^6Bridge_Built" );
	},

//////////////////////////GO UP////////////////////////////////////////////////////////////////////

// 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;
				//SetGoalPriority( "FLAG_Allies_War_Documents", 1.50, TEAM.AXIS);
	                        //SetGoalPriority( "PLANT_Prototype_Tank", 2.00, TEAM.ALLIES);
				SetAvailableMapGoals( TEAM.ALLIES, 0, "BUILD_Command_Post" );
				SetAvailableMapGoals( TEAM.ALLIES, 0, "PLANT_Command_Post" );
				SetAvailableMapGoals( TEAM.AXIS, 1, "PLANT_Command_Post" );
			}
			case TEAM.AXIS:
			{
				Map.CP_Owner = TEAM.AXIS;
	                        //SetGoalPriority( "FLAG_Allies_War_Documents", 2.00, TEAM.AXIS);
	                        //SetGoalPriority( "PLANT_Prototype_Tank", 0.97, TEAM.ALLIES);				
				SetAvailableMapGoals( TEAM.ALLIES, 0, "BUILD_Command_Post" );
				SetAvailableMapGoals( TEAM.ALLIES, 1, "PLANT_Command_Post" );
				SetAvailableMapGoals( TEAM.AXIS, 0, "PLANT_Command_Post" );
			}
		}
		//Util.MapDebugPrint("CP Owner: " + Map.CP_Owner );
	},
	Allied_CP_Built = function( trigger )
	{
		Map.Set_CP(TEAM.ALLIES);
		Util.MapDebugPrint( "^6Allied_CP_Built" );
	},
	Allied_CP_Destroyed = function( trigger )
	{
		Map.CP_Dyno = 0;
		Map.Set_CP(0);
		Util.MapDebugPrint( "^6Allied_CP_Destroyed" );
	},
	Axis_CP_Built = function( trigger )
	{
		Map.Set_CP(TEAM.AXIS);
		Util.MapDebugPrint( "^6Axis_CP_Built" );
	},
	Axis_CP_Destroyed = function( trigger )
	{
		Map.CP_Dyno = 0;
		Map.Set_CP(0);
		Util.MapDebugPrint( "^6Axis_CP_Destroyed" );
	},
	CP_Planted = function( trigger )
	{
		Map.CP_Dyno += 1;
		Util.MapDebugPrint( "^6CP_Planted" );
	},
	CP_Defused = function( trigger )
	{
		Map.CP_Dyno -= 1;
		Util.MapDebugPrint( "^6CP_Defused" );
	},

// Command Post scriptEND 

/////////////////////////////////////////////////////////////////////////////////////////////////////////// 


	Road_MG_Built = function( trigger )
	{
	SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Road_MG" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Road_MG" );

		Util.MapDebugPrint( "^6Road_MG_Built" );
	},

	Road_MG_1_Built = function( trigger )
	{
	SetAvailableMapGoals( TEAM.AXIS, true, "MOUNT_Road_MG_1" );
	SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Road_MG_1" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Road_MG_1" );
		Util.MapDebugPrint( "^6Road_MG_1_Built" );
	},

	AirTunel_Destroyed = function( trigger )
	{
	SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_AirTunel" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_AirTunel" );
		Util.MapDebugPrint( "^6AirTunel_Destroyed" );
	},

	Allied_Ladder_Destroyed = function( trigger )
	{
	SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Allied_Ladder" );
	SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Allied_Ladder" );
		Util.MapDebugPrint( "^6Allied_Ladder_Destroyed" );
	},

	Base_MG_Destroyed = function( trigger )
	{
	SetAvailableMapGoals( TEAM.AXIS, false, "MOUNT_Base_MG" );
	SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Base_MG" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Base_MG" );
		Util.MapDebugPrint( "^6Base_MG_Destroyed" );
	},

	Bridge_Destroyed = function( trigger )
	{
	SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Bridge" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Bridge" );
		Util.MapDebugPrint( "^6Bridge_Destroyed" );
	},



	Main_Entrance_Destroyed = function( trigger )
	{
	SetAvailableMapGoals( TEAM.AXIS, false, "MOUNTMG42_457" );
	SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Road_MG_1" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Road_MG_1" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "CHECKPOINT_roadbunker" );
	SetAvailableMapGoals( TEAM.AXIS, false, "CHECKPOINT_roadbunker" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Main_Entrance" );
        SetGoalRole("PLANT_Prototype_Tank", { ROLE.DEFENDER1 });
        ClearGoalRole("PLANT_Main_Entrance", { ROLE.DEFENDER1 });
                             Map.MainEntranceDestroyed = true;
		Util.MapDebugPrint( "^6Main_Entrance_Destroyed" );
	},

	Prototype_Tank_Destroyed = function( trigger )
	{
		Util.MapDebugPrint( "^6Prototype_Tank_Destroyed" );
	},

	Road_MG_Destroyed = function( trigger )
	{
	SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Road_MG" );
		Util.MapDebugPrint( "^6Road_MG_Destroyed" );
	},

	Road_MG_1_Destroyed = function( trigger )
	{
              if (Map.MainEntranceDestroyed == true)
                 {
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Road_MG_1" );
	SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Road_MG_1" );
                 }
               else
                 {
        SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Road_MG_1" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Road_MG_1" );
                 }
	SetAvailableMapGoals( TEAM.AXIS, false, "MOUNT_Road_MG_1" );
		Util.MapDebugPrint( "^6Road_MG_1_Destroyed" );
	},






	Allies_War_Documents_Taken = function( trigger )
	{ 

        Util.ForceRouting( "CAPPOINT_Feldkommandantur", true );
  	SetAvailableMapGoals( TEAM.AXIS, true, "CAPPOINT_Feldkommandantur" );
		Util.MapDebugPrint( "^6Allies_War_Documents_Taken" );
	},

	Allies_War_Documents_Returned = function( trigger )
	{
  	SetAvailableMapGoals( TEAM.AXIS, false, "CAPPOINT_Feldkommandantur" );
		Util.MapDebugPrint( "^6Allies_War_Documents_Returned" );
	},

	Allies_War_Documents_Secured = function( trigger )
	{
		Util.MapDebugPrint( "^6Allies_War_Documents_Secured" );
	},

	roadbunker_Axis_Captured = function( trigger )
	{
	SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_roadbunker" );
	SetAvailableMapGoals( TEAM.AXIS, false, "CHECKPOINT_roadbunker" );
		Util.MapDebugPrint( "^6roadbunker_Axis_Captured" );
	},

	roadbunker_Allies_Captured = function( trigger )
	{
	SetAvailableMapGoals( TEAM.ALLIES, false, "GRENADE_woodbarrier_flag" );
	SetAvailableMapGoals( TEAM.AXIS, false, "GRENADE_woodbarrier_flag" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "CHECKPOINT_roadbunker" );
	SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_roadbunker" );
		Util.MapDebugPrint( "^6roadbunker_Allies_Captured" );
	},
};

global OnMapLoad = function()
{
	// Register callback functions
	OnTrigger( "Axis team has damaged the Bridge!", Map.Bridge_Destroyed );
	OnTrigger( "Allied team has reinforced the Bridge!", Map.Bridge_Built );
	OnTrigger( "Allies team has constructed the Ladder in Old Pump Station!", Map.Allied_Ladder_Built );
	OnTrigger( "Axis team has destroyed the Ladder in Old Pump Station!", Map.Allied_Ladder_Destroyed );
	OnTrigger( "Allies have breached the Main Entrance and secured the Forward Bunker!", Map.Main_Entrance_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Prototype_Tank_Destroyed );
	OnTrigger( "Allied team has destroyed the West MG Nest!", Map.Base_MG_Destroyed );
	OnTrigger( "axis team has constructed the West MG Nest!", Map.Base_MG_Built );
	OnTrigger( "Axis team has destroyed the Road MG Nest!", Map.Road_MG_Destroyed );
	OnTrigger( "Allied team has constructed the Road MG Nest!", Map.Road_MG_Built );
	OnTrigger( "Allied team has destroyed the Kontrollpunkt MG Nest!", Map.Road_MG_1_Destroyed );
	OnTrigger( "Axis team has constructed the Kontrollpunkt MG Nest!", Map.Road_MG_1_Built );
	OnTrigger( "Axis have stolen Allies War Documents!", Map.Allies_War_Documents_Taken );
	OnTrigger( "Flag returned Allies War Documents!", Map.Allies_War_Documents_Returned );
	OnTrigger( "MISSING_STRING", Map.Allies_War_Documents_Secured );
	OnTrigger( "Axis reclaim the Forward Bunker!", Map.roadbunker_Axis_Captured );
	OnTrigger( "Allies capture the Forward Bunker!", Map.roadbunker_Allies_Captured );
	OnTrigger( "MISSING_STRING", Map.AirTunel_Destroyed );
	OnTrigger( "MISSING_STRING", Map.AirTunel_Built );

// you need triggers-strings to make it work
	OnTrigger( "Allied Command Post constructed. Charge speed increased!", Map.Allied_CP_Built );
	OnTrigger( "Axis team has destroyed the Allied Command Post!", Map.Allied_CP_Destroyed );
	OnTrigger( "Axis Command Post constructed. Charge speed increased!", Map.Axis_CP_Built );
	OnTrigger( "Allied 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 );
/////////////////////////////////////////////////////////////////////////
////// The Final END of the neutral command post script Information /////
/////////////////////////////////////////////////////////////////////////

	//~Util.DisableGoal( ".*", true ); // all but routes
	//~SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_.*" );
	//~SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_.*" );
  
	Util.AddUseWp("PLANT_Prototype_Tank", "tankplant_7");// Antenna is the waypoint name
	Util.AddUseWp("PLANT_Prototype_Tank", "tankplant_6");// Antenna is the waypoint name
	Util.AddUseWp("PLANT_Prototype_Tank", "tankplant_5");// Antenna is the waypoint name
	Util.AddUseWp("PLANT_Prototype_Tank", "tankplant_4");// Antenna is the waypoint name
	Util.AddUseWp("PLANT_Prototype_Tank", "tankplant_3");// Antenna is the waypoint name
	Util.AddUseWp("PLANT_Prototype_Tank", "tankplant_2");// Antenna is the waypoint name
	Util.AddUseWp("PLANT_Prototype_Tank", "tankplant_1");// Antenna is the waypoint name

	SetAvailableMapGoals( TEAM.AXIS, false, "CAPPOINT_Feldkommandantur" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "CAPPOINT_Feldkommandantur" );
	SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_AirTunel" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_AirTunel" );
	SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Bridge" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Bridge" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Road_MG" );
	SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Road_MG" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Road_MG_1" );
	SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Road_MG_1" );
	SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Base_MG" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Base_MG" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Allied_Ladder" );
	SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Allied_Ladder" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Main_Entrance" );
	SetAvailableMapGoals( TEAM.AXIS, true, "FLAG_Allies_War_Documents" );
	//SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_.*" );
	//SetAvailableMapGoals( TEAM.ALLIES, true, "MOUNTMG42_.*" );
	SetAvailableMapGoals( TEAM.ALLIES, false, "REPAIRMG42_.*" );
  SetAvailableMapGoals( TEAM.AXIS, false, "REPAIRMG42_.*" );

	SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_documentroom_1" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_documentroom_2" );
  SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_documentroom_3" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_documentroom_4" );
  SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_documentroom_5" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_roadbunker" );
	SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_roadbunker" );

	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_airshaft" );
	SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_airshaft" );

 Util.AddUseWp("PLANT_AirTunel", "airboom");// airboom is the waypoint name

	SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_boards" );

	SetGoalPriority( "PLANT_airshaft", 0.90, TEAM.AXIS);   
	SetGoalPriority( "PLANT_boards", 0.90, TEAM.AXIS);
	SetGoalPriority( "GRENADE_sidtunnelnade", 0.90, TEAM.AXIS);   
	SetGoalPriority( "GRENADE_airtunnel", 0.90, TEAM.AXIS);
	SetAvailableMapGoals( TEAM.AXIS, true, "GRENADE_sidtunnelnade" );
        SetAvailableMapGoals( TEAM.AXIS, true, "GRENADE_airtunnel" );

        SetGoalRole("PLANT_Prototype_Tank", { ROLE.DEFENDER });
        SetGoalRole("PLANT_Main_Entrance", { ROLE.DEFENDER1 });
        SetGoalRole("DEFEND_.*", { ROLE.DEFENDER2 });
        SetGoalRole("FLAG_Allies_War_Documents", { ROLE.ATTACKER });
        SetGoalRole("ATTACK_tankroom_.*", { ROLE.ATTACKER2, ROLE.ATTACKER1 });
        
	      Util.EnableGoal ( "GRENADE_sidtunnelnade" );        
	      Util.RemoveGoal ( "MOUNTMG42_575" );
	      Util.RemoveGoal ( "REPAIRMG42_575" );

        Util.ExcludeClass( "PLANT_Base_MG", TEAM.ALLIES, CLASS.ENGINEER );
        Util.ExcludeClass( "PLANT_Road_MG_1", TEAM.ALLIES, CLASS.ENGINEER );
        Util.ExcludeClass( "PLANT_Road_MG", TEAM.AXIS, CLASS.ENGINEER );        
        Util.ExcludeClass( "FLAG_Allies_War_Documents", TEAM.AXIS, CLASS.ENGINEER );
        Util.ExcludeClass( "MOUNTMG42_.*", TEAM.AXIS, CLASS.ENGINEER );
        Util.ExcludeClass( "CHECKPOINT_roadbunker", TEAM.AXIS, CLASS.ENGINEER );
        Util.ExcludeClass( "PLANT_Command_Post", TEAM.AXIS, CLASS.ENGINEER );
        Util.ExcludeClass( "PLANT_Command_Post", TEAM.ALLIES, CLASS.ENGINEER );
        
        Util.ExcludeClass( "PLANT_Command_Post", TEAM.AXIS, CLASS.MEDIC );
        Util.ExcludeClass( "PLANT_Command_Post", TEAM.AXIS, CLASS.MEDIC );
        Util.ExcludeClass( "PLANT_Command_Post", TEAM.AXIS, CLASS.MEDIC );


        
        Util.LimitToClass( "PLANT_Command_Post", TEAM.ALLIES, CLASS.COVERTOPS, true );
        Util.LimitToClass( "PLANT_Command_Post", TEAM.AXIS, CLASS.COVERTOPS, true );       
        Util.LimitToClass( "PLANT_Base_MG", TEAM.ALLIES, CLASS.COVERTOPS, true );
        Util.LimitToClass( "PLANT_Road_MG", TEAM.AXIS, CLASS.COVERTOPS, true );
        Util.LimitToClass( "PLANT_Road_MG_1", TEAM.ALLIES, CLASS.COVERTOPS, true );


 
	SetAvailableMapGoals( TEAM.AXIS, true, "MOUNTMG42_457" );

	// Max users per goal
	Util.SetMaxUsers( 6, "FLAG_Allies_War_Documents" );
	Util.SetMaxUsers( 6, "CAPPOINT_Feldkommandantur" );  
  //SetGoalPriority( "PLANT_Prototype_Tank", 0.75, TEAM.ALLIES);
	//SetGoalPriority( "PLANT_Main_Entrance", 0.97, TEAM.ALLIES);
	//SetGoalPriority( "DEFEND_.*", 0.97, TEAM.ALLIES);
	SetGoalPriority( "BUILD_Road_MG", 0.98, TEAM.ALLIES);

	SetGoalPriority( "GRENADE_airtunnel", 0.50, TEAM.AXIS); 
  
	SetGoalPriority( "CAPPOINT_Feldkommandantur", 2.00, TEAM.AXIS);  
	SetGoalPriority( "FLAG_Allies_War_Documents", 0.99, TEAM.AXIS);
	//SetGoalPriority( "ATTACK_tankroom_1", 0.75, TEAM.AXIS); 
	SetGoalPriority( "ATTACK_tankroom_7", 0.97, TEAM.AXIS);   
	//SetGoalPriority( "ATTACK_tankroom_2", 0.75, TEAM.AXIS);  
	SetGoalPriority( "ATTACK_tankroom_3", 0.97, TEAM.AXIS);//maingate mount457
	//SetGoalPriority( "ATTACK_tankroom_5", 0.75, TEAM.AXIS);  
	//SetGoalPriority( "ATTACK_tankroom_4", 0.75, TEAM.AXIS);//maingate  
	SetGoalPriority( "ATTACK_tankroom_5", 0.97, TEAM.AXIS);  
	//SetGoalPriority( "ATTACK_tankroom_6", 0.75, TEAM.AXIS);

	//SetGoalPriority( "CHECKPOINT_roadbunker", 0.97, TEAM.AXIS);
  //SetGoalPriority( "BUILD_Command_Post", 0.97, TEAM.AXIS);
  //SetGoalPriority( "ROUTE_stepstankgrate_1", 1.49, TEAM.AXIS);
  //SetGoalPriority( "BUILD_Command_Post", 0.97, TEAM.ALLIES);


	// Camp times
	SetMapGoalProperties( "MOUNTMG42_.*", {MinCampTime=15, MaxCampTime=90} );
	SetMapGoalProperties( "ATTACK_tankroom_1", {MinCampTime=60, MaxCampTime=120} );
	SetMapGoalProperties( "ATTACK_tankroom_6", {MinCampTime=90, MaxCampTime=180} );
	SetMapGoalProperties( "ATTACK_tankroom_7", {MinCampTime=90, MaxCampTime=180} );
	SetMapGoalProperties( "DEFEND_documentroom_1", {MinCampTime=90, MaxCampTime=180} );
	SetMapGoalProperties( "DEFEND_documentroom_2", {MinCampTime=60, MaxCampTime=120} );
  SetMapGoalProperties( "DEFEND_documentroom_3", {MinCampTime=90, MaxCampTime=180} );
	SetMapGoalProperties( "DEFEND_documentroom_4", {MinCampTime=60, MaxCampTime=120} );
  SetMapGoalProperties( "DEFEND_documentroom_5", {MinCampTime=90, MaxCampTime=180} );

	Util.MapDebugPrint( "^2Custom ^1C ^04 ^1W ^3Omni-bot map script ^1ver.1.2 ^3For the map: ^5" + GetMapName() + " executed." );
	print( "^2Custom ^1C ^04 ^1W ^3Omni-bot map script ^1ver.1.2 ^3For the map: ^5" + GetMapName() );
	
	Util.BotChat( 0, "say", "^2Custom ^1C ^04 ^1W ^3Omni-bot map script ^1ver.1.2 ^3For the map: ^5" + GetMapName(), 1 );
};

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 =
	{
	FLAG_Allies_War_Documents =
		     {
         ROUTE_axisspawnbridge_1 =
             {     Weight = 2,
             ROUTE_axissideofbridgebetweenspawns =
                 {
                 ROUTE_tunnelsneak = 
                     {   
                     ROUTE_sidetunnel_2 =
                          {
                          ROUTE_side2ladder2doc =
                              {
                              ROUTE_end =
                                  {
                                  ROUTE_alliedspawn_b = {},
                                  ROUTE_stealdocuments_1 = {},
                                  ROUTE_sidetunnel_1 = {},
                                  },
                              }, 
                         },
                      },
                ROUTE_frontwaypastflag = 
              {
              ROUTE_alliedspawn_c = 
                  {  Weight = 2,
                  ROUTE_sidetunnel_1 = {},
                  },
             ROUTE_alliedspawn_b = {},
             ROUTE_stealdocuments_1 = {},
		             },
              },
                
           },
        ROUTE_axisspawnbridge_2 = 
             {     Weight = 2,
             ROUTE_axissideofbridgebetweenspawns =
                 {
                 ROUTE_tunnelsneak = 
                     {   
                     ROUTE_sidetunnel_2 =
                          {
                          ROUTE_side2ladder2doc =
                              {
                              ROUTE_end =
                                  {
                                  ROUTE_alliedspawn_b = {},
                                  ROUTE_stealdocuments_1 = {},
                                  ROUTE_sidetunnel_1 = {},
                                  },
                              }, 
                         },
                      },
                ROUTE_frontwaypastflag = 
              {
              ROUTE_alliedspawn_c = 
                  {  Weight = 2,
                  ROUTE_sidetunnel_1 = {},
                  },
             ROUTE_alliedspawn_b = {},
             ROUTE_stealdocuments_1 = {},
		             },
              },
                
           },                
      ROUTE_axisspawnflag = 
          {
          ROUTE_frontwaypastflag = 
              {
              ROUTE_alliedspawn_c = 
                  {  Weight = 2,
                  ROUTE_sidetunnel_1 = {},
                  },
             ROUTE_alliedspawn_b = {},
             ROUTE_stealdocuments_1 = {},
		             },
            },
        },
		CHECKPOINT_roadbunker =
		{
		},
		PLANT_Prototype_Tank =
                     {
                    ROUTE_alliedspawn_b =
                         {
                         ROUTE_captainsdesk =
                              {
                              ROUTE_TANK = {},
                              },
                         ROUTE_mainentrance = 
                             {
                             ROUTE_TANK = {},
                             },
                         },
                    ROUTE_alliedspawn_b =
                         {
                         ROUTE_captainsdesk =
                              {
                              ROUTE_TANK = {},
                              },
                         ROUTE_mainentrance = 
                             {
                             ROUTE_TANK = {},
                             },
                         },
                ROUTE_alliedspawn_c = 
                         {
                         ROUTE_captainsdesk =
                              {
                              ROUTE_TANK = {},
                              },
                         ROUTE_mainentrance = 
                         {
                         ROUTE_TANK = {},
                         },
                         },
                         },
		BUILD_Command_Post =
		{
		},
		PLANT_Command_Post =
		{
		},
		PLANT_Main_Entrance =
                     {
                    ROUTE_alliedspawn_a =
                         {
                         ROUTE_axissideofbridgebetweenspawns = {},
                         },
                    ROUTE_alliedspawn_b =
                         {
                         ROUTE_axissideofbridgebetweenspawns = {},
                         },
                ROUTE_alliedspawn_c = 
                         {
                         ROUTE_axissideofbridgebetweenspawns = {},
                         },
                         },
		BUILD_Road_MG =
		{
		},
		PLANT_Road_MG =
		{
		},
		BUILD_Road_MG_1 =
		{
		},
		PLANT_Road_MG_1 =
		{
		},
    
		CAPPOINT_Feldkommandantur =
		{
     ROUTE_alliedspawn_b = 
         {      
         ROUTE_alliedspawn_c = 
             {
              ROUTE_sidetunnel_2 = 
                  {
                  ROUTE_runlikehell_1 = 
                      {
                      ROUTE_runlikehell_2 =
                          {
                          ROUTE_runlikehell_3 =
                              {
                              ROUTE_runlikehell_4 =
                                  {
                                  ROUTE_runlikehell_5 =
                                      {
                                      ROUTE_tankstepsgrate_3 =
                                          { 
                                          ROUTE_tankstepsgrate_2 =
                                              {
                                              ROUTE_betweentankgrate1and2_a =
                                                  {
                                                  ROUTE_betweentankgrate1and2_b =
                                                       {
                                                       ROUTE_stepstankgrate_1 = 
                                                          {
                                                          ROUTE_captainsdesk = {},
                                                  },
                                              },
                                        },
                                   },
                              },
                       },
		                },
                 },
                },
                },
                },
                },
                },
                },
		BUILD_Base_MG =
		{
		},
		PLANT_Base_MG =
		{
		},
		BUILD_AirTunel =
		{
		},
		PLANT_AirTunel =
		{
		},
		BUILD_Bridge =
		{
		},
		PLANT_Bridge =
		{
		},
		BUILD_Allied_Ladder =
                     {
                    ROUTE_alliedspawn_a =
                         {
                         ROUTE_sidetunnel_2 = {},
                         },
                    ROUTE_alliedspawn_b =
                         {
                         ROUTE_sidetunnel_2 = {},
                         },
                ROUTE_alliedspawn_c = 
                         {
                         ROUTE_sidetunnel_2 = {},
                         },
                         },
		PLANT_Allied_Ladder =
		{
		},
		ATTACK_tankroom_1 = 
		     {
                     ROUTE_axisspawnflag = 
                         {
                         ROUTE_axissideofbridgebetweenspawns =
                              {
                              ROUTE_TANK = {},
                              },
                         },
                     ROUTE_axisspawnbridge_1 =
                         {
                         ROUTE_axissideofbridgebetweenspawns = 
                              {
                              ROUTE_TANK = {},
                              },
                         },
                     ROUTE_axisspawnbridge_2 = 
                         {
                         ROUTE_axissideofbridgebetweenspawns =
                              {
                              ROUTE_TANK = {},
                              },
		         },
                  },
		ATTACK_tankroom_2 = 
		     {
                     ROUTE_axisspawnflag = 
                         {
                         ROUTE_axissideofbridgebetweenspawns = {},
                         },
                     ROUTE_axisspawnbridge_1 = 
                         {
                         ROUTE_axissideofbridgebetweenspawns = {},
                         },
                     ROUTE_axisspawnbridge_2 = 
                         {
                         ROUTE_axissideofbridgebetweenspawns = {},
                         },
		     },
		ATTACK_tankroom_3 = 
		     {
                     ROUTE_axisspawnflag = 
                         {
                         ROUTE_axissideofbridgebetweenspawns = {},
                         },
                     ROUTE_axisspawnbridge_1 = 
                         {
                         ROUTE_axissideofbridgebetweenspawns = {},
                         },
                     ROUTE_axisspawnbridge_2 = 
                         {
                         ROUTE_axissideofbridgebetweenspawns = {},
                         },
		     },
		ATTACK_tankroom_4 = 
		     {
                     ROUTE_axisspawnflag = 
                         {
                         ROUTE_axissideofbridgebetweenspawns = {},
                         },
                     ROUTE_axisspawnbridge_1 = 
                         {
                         ROUTE_axissideofbridgebetweenspawns = {},
                         },
                     ROUTE_axisspawnbridge_2 = 
                         {
                         ROUTE_axissideofbridgebetweenspawns = {},
                         },
		     },
		ATTACK_tankroom_5 = 
		     {
                     ROUTE_axisspawnflag = 
                         {
                         ROUTE_axissideofbridgebetweenspawns =
                              {
                              ROUTE_TANK = {},
                              },
                         },
                     ROUTE_axisspawnbridge_1 =
                         {
                         ROUTE_axissideofbridgebetweenspawns = 
                              {
                              ROUTE_TANK = {},
                              },
                         },
                     ROUTE_axisspawnbridge_2 = 
                         {
                         ROUTE_axissideofbridgebetweenspawns =
                              {
                              ROUTE_TANK = {},
                              },
		         },
                  },
	};
	Util.Routes(MapRoutes);
};
