// Outdated Processing (Advanced) by JugadorXEI - http://steamcommunity.com/profiles/76561198025656147
// Version 2 changelog: https://pastebin.com/mkz1ja62
// Version 3 changelog - 27/12/17 (DD/MM/AA): https://pastebin.com/6NW1Rzkh
// Version 4 changelog - 20/01/18 (DD/MM/AA): https://pastebin.com/mTiPCSP5
// Version 5 changelog (Resubmission Edition) - 21/01/18 (DD/MM/AA): https://pastebin.com/nVmDXZ0J
// Version 6 changelog (Resubmission Edition, v2) - 21/01/18 (DD/MM/AA): https://files.catbox.moe/478uvj.txt
// Version 7 changelog (Canteen Crasher Edition) - 15/04/18 (DD/MM/AA):
// Wave Changes
	// Wave 6:
		// "wave6_tankroundhelp" WaitBeforeStarting to 2 from 6.
		// "wave6_tankroundhelp" WaitBetweenSpawns to 14 from 15.
		// Added "wave6_sandmanscouts" with Attribute AlwaysCrit that uses the lateral spawns. (50$)
		// Fan Scouts will wait for wave6_sandmanscouts to die first before they spawn.
		
		// Changed "wave6_supportsquad" so they have a consistent WaitBeforeStarting and WaitBetweenSpawns:
		// WaitBeforeStarting to 10 from 15/20.
		// WaitBetweenSpawns to 20 from 30/25.
		
		// Boss now drops 50$ less dollars (same payout).
		
// Robot Changes
	// Changed T_TFBot_Giant_Soldier_BuffWhip's name to fix a typo.
	// Changed T_TFBot_Giant_Soldier_BuffWhip's health to 3500 from 2750 (750 more hp).

// Version 8 just adds MeleeOnly where relevant.
// Version 9 just fixes banner soldiers not working properly.
// Version 10 just fixes banner soldiers not working properly.
// Version 14: more adaptations.
// Version 15: more adaptations.
// Version 16: EU optimization edition.

// Notes:
  // - Spawnpoints
    // - spawnbot (middle spawn point)
	// - spawnbot_wall_1 and spawnbot_wall_right (right spawn point)
	// - spawnbot_wall_2 and spawnbot_wall_left (left spawn point)

// Planning (might not be accurate to reality):
 // - Start:
  // - 600 dollars.
  // - Respawn time: 6 seconds.
  // - 6 waves
  // - Bots can't attack in spawn room.
  
  // Wave 1 (500$):
   // - 40 pyros with the volcano fragment (100$)
   // - 20 scouts with sun on a stick (50$)
   // - 20 pyros with the axtinguisher (50$)
   
   // Squad:
   // - 5 semi-giant FoS heavies (50$)
   // - 15 always-healing amputator medics (100$)
   
   // - Support: Caber Demos (infinite, 50$)
   // - 3 Giant Magician Soldiers (100$)
   // Robot total: 95 + 10 supports that give money + 3 giants.
   
   // Wave 2 (550$)
	// Squad:
    // - 40 Demoknights (100$)
	// - 20 Concheror Buff Soldiers (50$)
	// One soldier for two Demoknights.
	// - 20 Fan Scouts (50$)
	// - 20 spies (50$)
	
	// - Support: Caber Demos (infinite, 50$)
	// - 10 Sandman Scouts (50$)
	// - 3 Giant Plague Medics (100$)
	// - with 5 Small Plague Medics each (15) (100$)
	// Robot total: 125 robots + 10 supports that give money + 3 giants.
	
   // Wave 3 (600$)
    // Tank! (150$)
	// Support: Caber Demos (infinite, 50$)
	// 40 Stock Scouts (100$)
	
	// - 40 Third Degree Pyros (100$)
	// - 40 Heavy Mittens (100$)
	// - 3 Giant KGB Heavies (100$)
	// - 2 Giant Black Mage Sniper (50$)
	// Robot total: 116 robots + 10 Supports that give money + 5 giants + 1 tank.
	
   // Wave 4 (650$)
    // Squad [100$]:
	// - 5 semi-giant FoS heavies (50$)
	// - 15 plague medics (50$)
	
	// [250$]
	// - 2 Giant Scouts (150$) 
	// - 20 Heavy Mittens (50$)
	// - 20 Spies (50$)
	
	// [250$]
	// - Tank! (100$)
	// Squad [100$]:
	// - 5 BatBackup Soldiers (50$)
	// - 20 Samurai Demos (50$)
	// -- 
	// - 1 Giant Black Mage Sniper (25$)
	// - 1 Giant Magician Soldier (25$)

	// - Support: Caber Demos (infinite, 50$)
	// Robot total: 85 robots + 10 supports that give money + 4 giants + 1 tank.
	
   // Wave 5 (700$)
    // Squad [150$]
	// 3 Giant Bushido Practitioners (100$)
	// 15 Samurai Concheror Soldiers (50$)
	
	// Squad [200$]
	// 3 Giant Barbarian Pyro (100$)
	// 15 Barbarian Pyros (50$)
	// --
	// 25 Barbarian Pyros (50$)
	
	// [350$]
	// Tank! (100$)
	// 40 Stock Crit Scouts (100$)
	// 40 Demoknights (100$)
	// 2 Giant Demoknights (50$)
	
	// Support: Crit Caber Demos (don't drop money anymore)
	
	// Robot total: 135 robots + supports + 8 giants + 1 tank.
	
   // Wave 6 (750$)
	// [200$]
	// Tank! (100$)
	// 20 Mitten Heavies (50$)
	// 40 Full-Crit Aggressive Marauder Snipers (100$)
	
	//[200$]
	// [66$]
	// Squad:
	// 2 Giant Bushido Practitioners
	// 10 Concheror Samurais
	// [66$]
	// Squad:
	// 2 Giant Barbarian Pyros
	// 10 Barbarian Pyros
	// [67$]
	// 2 Giant Plague Medics
	// 10 Plague Medics
	
	// [250$]
	// Squad: 
	// 2 Giant KGB Heavies (50$)
	// 10 Plague Medics (25$)
	
	// Squad:
	// 2 Magician Soldiers (50$)
	// 10 Fan Scouts (25$)
	
	// 40 Volcano Fragment Pyros (100$)
	
	// [100$]
	// Tank! (100$)
	// Support: Crit Caber Demos (as usual)
	// Support: Crit Demoknights
	
	// Robot total: 150 robots + 2 different kids of supports + 10 giants + 2 tanks
	
	
#base robot_standard.pop
#base robot_giant.pop
	
WaveSchedule
{
	StartingCurrency 600
	RespawnWaveTime 6
	CanBotsAttackWhileInSpawnRoom no
	
	Advanced 1
	
	Templates
	{
		// Scout
		T_TFBot_Scout_Sunonastick
		{
			Class Scout
			Name "Sun-on-a-Scout"
			Skill Hard
			ClassIcon scout_sunstick
			
			Item "Sun-on-a-Stick"
			Attributes AlwaysFireWeapon
			WeaponRestrictions MeleeOnly
		}
		
		T_TFBot_Scout_Fan 
		{
			Class Scout
			Name "Fan Scout"
			Skill Hard
			ClassIcon scout_fanowar // Custom Icon
			WeaponRestrictions MeleeOnly
			Item "The Fan O'War"
		}
		
		// Soldier
		T_TFBot_Soldier_Concheror_Samurai
		{
			Class Soldier
			Name "Conch Samurai Soldier"
			Skill Normal
			ClassIcon soldier_jug_halfzatoichi // Custom icon
			Attributes SpawnWithFullCharge
			WeaponRestrictions MeleeOnly
			
			CharacterAttributes
			{
				"increase buff duration"	9.0
			}
			ItemAttributes
			{
				ItemName "tf_weapon_rocketlauncher"
				"maxammo secondary reduced" 99999.00
				"clip size penalty" 0.000001
				"fire rate penalty" 99999.00
			}
			
			Item "The Half-Zatoichi"
			ItemAttributes
			{
				ItemName "The Half-Zatoichi"
				"deploy time increased" 1.50				
			}
		}
		
		T_TFBot_Giant_Soldier_Magic 
		{
			Class Soldier
			Name "Grand Magician Soldier"
			Skill Hard
			ClassIcon soldier_shovel // Custom icon
			
			Health 4500
			Attributes MiniBoss
			Attributes AlwaysFireWeapon
			WeaponRestrictions MeleeOnly
			
			Item "The Market Gardener"
			ItemAttributes
			{
				ItemName "The Market Gardener"
				"damage blast push" 3.00
				"attach particle effect" 74
			}
			
			CharacterAttributes
			{
				"move speed bonus" 0.5
				"damage force reduction" 0.5
				"airblast vulnerability multiplier" 0.5
				"override footstep sound set" 4
			}
		}
		
		T_TFBot_Giant_Soldier_Bushido
		{
			Class Soldier
			Name "Giant Bushido Practitioner"
			Skill Expert
			ClassIcon soldier_jug_halfzatoichi_giant // Custom Icon
			
			Health 2750
			Attributes MiniBoss
			Attributes AlwaysFireWeapon
			WeaponRestrictions MeleeOnly
			
			Item "The Half-Zatoichi"
			ItemAttributes
			{
				ItemName "The Half-Zatoichi"
				"is_a_sword" 72
				"decapitate type" 1
				"restore health on kill" 50
				"damage bonus" 1.25
				"honorbound" 0
			}
			
			CharacterAttributes
			{
				"move speed bonus" 0.5
				"damage force reduction" 0.5
				"airblast vulnerability multiplier" 0.5
				"override footstep sound set" 4
			}
		}
		
		T_TFBot_Giant_Soldier_BuffWhip
		{
			Class Soldier
			Name "Giant Buff Whipper-Snapper"
			Skill Expert
			ClassIcon soldier_jug_buffwhip 	// Custom Icon
			
			Health 3500
			Attributes MiniBoss
			Attributes SpawnWithFullCharge
			//Attributes AlwaysFireWeapon
			WeaponRestrictions MeleeOnly
			
			ItemAttributes
			{
				ItemName "tf_weapon_rocketlauncher"
				"maxammo secondary reduced" 99999.00
				"clip size penalty" 0.000001
				"fire rate penalty" 99999.00
			}
			Item "The Disciplinary Action"
			ItemAttributes
			{
				ItemName "The Disciplinary Action"
				"damage penalty" 1.25
				"melee range multiplier" 1.00
				"melee bounds multiplier" 1.00
				"deploy time increased" 1.50
			}
			
			CharacterAttributes
			{
				"move speed bonus" 0.5
				"damage force reduction" 0.5
				"airblast vulnerability multiplier" 0.5
				"override footstep sound set" 4
				"increase buff duration"	9.0
			}
		}
		
		// Pyro
		T_TFBot_Pyro_VolcanoFragment 
		{
			Class Pyro
			Name "Volcanic Pyro"
			Skill Hard
			ClassIcon pyro_volcano // Custom Icon
			
			Item "Sharpened Volcano Fragment"
			WeaponRestrictions MeleeOnly
		}
		
		T_TFBot_Pyro_Axtinguisher 
		{
			Class Pyro
			Name "Axtinguisher Pyro"
			Skill Hard
			ClassIcon pyro_axtinguisher // Custom Icon
			
			Item "The Axtinguisher"
			WeaponRestrictions MeleeOnly
		}
		
		T_TFBot_Pyro_ThirdDegree 
		{
			Class Pyro
			Name "Third Degree Pyro"
			Skill Hard
			WeaponRestrictions MeleeOnly
			ClassIcon pyro_thirddegree // Custom Icon
			
			Item "The Third Degree"
		}
		
		T_TFBot_Pyro_Barbarian 
		{
			Class Pyro
			Name "Barbarian Pyro"
			Skill Expert
			ClassIcon pyro_fireaxe // Custom Icon
			WeaponRestrictions MeleeOnly
			
			Scale 1.2
			ItemAttributes
			{
				ItemName "TF_WEAPON_FIREAXE"
				"fire rate bonus with reduced health" 0.50
				"critboost on kill" 2
			}
		}
		
		T_TFBot_Giant_Pyro_Barbarian
		{
			Class Pyro
			Name "Giant Barbarian Pyro"
			Skill Expert
			ClassIcon pyro_fireaxe_giant // Custom Icon
			WeaponRestrictions MeleeOnly
			
			Health 3750
			Attributes MiniBoss
			Attributes AlwaysFireWeapon
			
			ItemAttributes
			{
				ItemName "TF_WEAPON_FIREAXE"
				"fire rate bonus with reduced health" 0.50
				"critboost on kill" 2
				"heal on hit for rapidfire" 25
			}
			
			CharacterAttributes
			{
				"move speed bonus" 0.5
				"damage force reduction" 0.5
				"airblast vulnerability multiplier" 0.5
				"override footstep sound set" 4
				"hand scale" 2.0
			}
		}
		
		// Demoman
		T_TFBot_Demoman_Caber 
		{
			Class Demoman
			Name "Tactical Suicide Demo"
			Skill Hard
			ClassIcon demo_caber_nys // Custom Icon
			
			Health 35
			
			Item "The Ullapool Caber"
			WeaponRestrictions MeleeOnly
			Attributes Aggressive
			
			ItemAttributes
			{
				ItemName "The Ullapool Caber"
				"blast radius increased" 1.50
				"damage bonus" 1.50
			}
		}
		
		// Heavy
		T_TFBot_Heavyweapons_BigFoS
		{
			Class Heavyweapons
			Name "Big Steelie Heavy"
			Skill Hard
			ClassIcon heavy_steelfist
			
			Scale 1.35
			Health 900
			
			Item "Fists of Steel"
			WeaponRestrictions MeleeOnly
		}
		
		T_TFBot_Giant_Heavyweapons_KGB
		{
			Class Heavyweapons
			Name "Giant KGB Heavy"
			ClassIcon heavy_champ_giant
			Item "The Killing Gloves of Boxing"
			Skill Expert
			
			Health 6500

			WeaponRestrictions MeleeOnly
			Attributes MiniBoss
			Attributes AlwaysFireWeapon
			ItemAttributes
			{
				ItemName "The Killing Gloves of Boxing"
			}
			
			CharacterAttributes
			{
				"move speed bonus"	0.5
				"damage force reduction" 0.3
				"airblast vulnerability multiplier" 0.3
				"override footstep sound set" 2
			}
		}
		
		T_TFBot_Heavyweapons_Mittens
		{
			Class Heavyweapons
			Name "Festive Mittens Heavy"
			Skill Hard
			ClassIcon heavy_mittens
			WeaponRestrictions MeleeOnly
			
			Attributes AlwaysFireWeapon
			
			Item "The Holiday Punch"
		}
		
		// Sniper
		T_TFBot_Sniper_Bushwacka
		{
			Name "Bushwacka Sniper"
			Health 125
			Class Sniper
			Skill Expert
			MaxVisionRange 9999
			ClassIcon sniper_bushwacka
			WeaponRestrictions MeleeOnly
			Item "The Bushwacka"
		}
		
		T_TFBot_Sniper_Desert_FullKrit // copy from robot_medieval.pop + slight changes
		{
			Name "Full-Crit Marauder Sniper"
			Health 125
			Class Sniper
			Skill Expert
			MaxVisionRange 9999
			ClassIcon sniper_jug_shahanshah // Custom icon
			Attributes AlwaysCrit
			Attributes Aggressive
			WeaponRestrictions MeleeOnly
		}
		
		T_TFBot_Sniper_Desert
		{
			Name "Marauder Sniper"
			Health 125
			Class Sniper
			Skill Expert
			MaxVisionRange 9999
			ClassIcon sniper_jug_shahanshah // Custom icon
			WeaponRestrictions MeleeOnly
		}
		
		T_TFBot_Giant_Sniper_BlackMage 
		{
			Class Sniper
			Name "Giant Black Mage Sniper"
			Skill Hard
			ClassIcon sniper_jug_trivalshiv_death
			
			Health 4500
			MaxVisionRange 1250
			Attributes MiniBoss
			Attributes AlwaysFireWeapon
			WeaponRestrictions MeleeOnly
			Item "The Tribalman's Shiv"
			
			ItemAttributes
			{
				ItemName "The Tribalman's Shiv"
				"damage penalty" 0.01
				"melee range multiplier" 6.0
				
				//"Set DamageType Ignite" 1 does not work as of Jungle Inferno
				"bleeding duration" 6
				//"slow enemy on hit major" 1
				"mark for death" 1
				"attach particle effect" 44
			}
			
			CharacterAttributes
			{
				"move speed bonus"	0.5
				"damage force reduction" 0.4
				"airblast vulnerability multiplier" 0.4
				"override footstep sound set" 3
			}
		}
		
		T_TFBot_Giant_Sniper_King
		{
			Class Sniper
			Name "The King of Australia"
			Skill Expert
			ClassIcon sniper_jug_king
			
			Health 23000 // 8000 hp accounts for the bushwacka's higher damage vulnerability.
			MaxVisionRange 9999
			
			Attributes MiniBoss
			Attributes AlwaysFireWeapon
			Attributes UseBossHealthBar
			WeaponRestrictions MeleeOnly
			Item "The Bushwacka"
			
			CharacterAttributes
			{
				"move speed bonus"	0.5
				"damage force reduction" 0.4
				"airblast vulnerability multiplier" 0.4
				"override footstep sound set" 3
				"rage giving scale" 0.1
			}
		}
		
		// Medic
		T_TFBot_Medic_Amputator
		{
			Class Medic
			Name "White Mage Medic"
			Skill Normal
			ClassIcon medic_jug_amputator // Custom icon
			
			Item "The Amputator"
			WeaponRestrictions MeleeOnly
		}
		
		T_TFBot_Medic_Plague
		{
			Class Medic
			Name "Plague Medic"
			Skill Normal
			ClassIcon medic_jug_ubersaw_bleed  // Custom icon

			Item "The Ubersaw"
			WeaponRestrictions MeleeOnly
			ItemAttributes
			{
				ItemName "The Ubersaw"
				"bleeding duration" 10
			}
		}
		
		T_TFBot_Giant_Medic_Plague
		{
			Class Medic
			Name "Giant Plague Medic"
			Skill Hard
			ClassIcon medic_jug_ubersaw_bleed // Custom icon
			
			Item "The Ubersaw"
			ItemAttributes
			{
				ItemName "The Ubersaw"
				"bleeding duration" 10
			}
			
			Health 3500
			Attributes MiniBoss
			Attributes AlwaysFireWeapon
			WeaponRestrictions MeleeOnly
			
			CharacterAttributes
			{
				"move speed bonus" 0.5
				"damage force reduction" 0.5
				"airblast vulnerability multiplier" 0.5
				"override footstep sound set" 4
			}
		}
	}
	
	Wave // WAVE 1 - 500$
	{
		StartWaveOutput
		{
			Target wave_start_relay
			Action Trigger
		}
		DoneOutput
		{
			Target wave_finished_relay
			Action Trigger
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave1_fix"
			TotalCount 1
			MaxActive 1
			SpawnCount 1
			TotalCurrency 1
			
			TFBot
			{
				Template T_TFBot_Scout_Sunonastick
				CharacterAttributes
				{
					"move speed bonus" 1.25
				}
			}
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave1_firesquad"
			TotalCount 40 //40
			MaxActive 8
			SpawnCount 1
			WaitBeforeStarting 0.1
			WaitBetweenSpawns 1
			TotalCurrency 99
			
			TFBot
			{
				Template T_TFBot_Pyro_VolcanoFragment
			}
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave1_firesquad"
			TotalCount 20 //20
			MaxActive 4
			SpawnCount 1
			WaitBeforeStarting 8
			WaitBetweenSpawns 2
			TotalCurrency 50
			
			TFBot
			{
				Template T_TFBot_Pyro_Axtinguisher
			}
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave1_firesquad"
			TotalCount 20 //20
			MaxActive 4
			SpawnCount 1
			WaitBeforeStarting 13
			WaitBetweenSpawns 2
			TotalCurrency 50
			
			TFBot
			{
				Template T_TFBot_Scout_Sunonastick
			}
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave1_miniminiboss"
			TotalCount 8
			MaxActive 4
			SpawnCount 1
			WaitForAllDead "wave1_firesquad"
			TotalCurrency 75
			Squad
			{
				ShouldPreserveSquad 1
				TFBot
				{
					Template T_TFBot_Heavyweapons_BigFoS
				}
				TFBot
				{
					Template T_TFBot_Medic_Amputator
				}
				TFBot
				{
					Template T_TFBot_Medic_Amputator
				}
				TFBot
				{
					Template T_TFBot_Medic_Amputator
				}
			}
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave1_miniminibossFIX"
			TotalCount 8
			MaxActive 4
			SpawnCount 1
			WaitForAllDead "wave1_firesquad"
			WaitBeforeStarting 10
			TotalCurrency 50
			Squad
			{
				ShouldPreserveSquad 1
				TFBot
				{
					Template T_TFBot_Heavyweapons_BigFoS
				}
				TFBot
				{
					Template T_TFBot_Medic_Amputator
				}
				TFBot
				{
					Template T_TFBot_Medic_Amputator
				}
				TFBot
				{
					Template T_TFBot_Medic_Amputator
				}
			}
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave1_miniminibossFIX2"
			TotalCount 4
			MaxActive 4
			SpawnCount 1
			WaitForAllSpawned "wave1_miniminiboss"
			WaitBeforeStarting 15
			TotalCurrency 25
			Squad
			{
				ShouldPreserveSquad 1
				TFBot
				{
					Template T_TFBot_Heavyweapons_BigFoS
				}
				TFBot
				{
					Template T_TFBot_Medic_Amputator
				}
				TFBot
				{
					Template T_TFBot_Medic_Amputator
				}
				TFBot
				{
					Template T_TFBot_Medic_Amputator
				}
			}
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave1_engiants"
			TotalCount 2
			MaxActive 2
			SpawnCount 1
			WaitForAllDead "wave1_firesquad"
			WaitBeforeStarting 1
			WaitBetweenSpawns 25
			TotalCurrency 100
			
			TFBot
			{
				Template T_TFBot_Giant_Soldier_Magic
			}
			
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave1_quoteonquotesupport"
			TotalCount 10
			MaxActive 6
			SpawnCount 1
			WaitForAllDead "wave1_firesquad"
			WaitBetweenSpawns 3
			WaitBeforeStarting 2
			TotalCurrency 50
			Support 1
			
			TFBot
			{
				Template T_TFBot_Sniper_Desert
			}
		}
	}
	
	Wave // WAVE 2 - 550$
	{
		StartWaveOutput
		{
			Target wave_start_relay
			Action Trigger
		}
		DoneOutput
		{
			Target wave_finished_relay
			Action Trigger
		}
		
		WaveSpawn // 100 dollars
		{
			Where spawnbot
			Name "wave2_democonchsquad"
			TotalCount 40
			MaxActive 8
			SpawnCount 2
			TotalCurrency 100
			WaitBetweenSpawns 5
			
			TFBot
			{
				Template T_TFBot_Demoman_Knight
				WeaponRestrictions MeleeOnly
				
				ItemAttributes
				{
					ItemName "The Eyelander"
					"critboost on kill" 0
					"fire rate penalty" 1.50
				}
			}
		}
		
		WaveSpawn // 100 dollars
		{
			Where spawnbot
			Name "wave2_democonchsquad"
			TotalCount 20
			MaxActive 8
			SpawnCount 2
			TotalCurrency 100
			WaitBetweenSpawns 5
			
			RandomChoice
			{
				TFBot
				{
					Template T_TFBot_Soldier_Concheror_Samurai
					ClassIcon soldier_samurai_conch // Custom icon
					WeaponRestrictions SecondaryOnly
					
					Item "The Concheror"
					ItemAttributes
					{
						ItemName "The Concheror"
						"deploy time increased" 1.50				
					}
				}
				TFBot
				{
					Template T_TFBot_Soldier_Concheror_Samurai
				}
				TFBot
				{
					Template T_TFBot_Soldier_Concheror_Samurai
				}
				TFBot
				{
					Template T_TFBot_Soldier_Concheror_Samurai
				}
				
			}
		}
		
		WaveSpawn // 50 dollars (kinda cheapo)
		{
			Where spawnbot_wall_right
			Where spawnbot_wall_left
			Name "wave2_basherhelp"
			TotalCount 20
			MaxActive 6
			SpawnCount 3
			WaitBeforeStarting 20
			WaitBetweenSpawns 10
			TotalCurrency 50
			
			Squad
			{
				TFBot
				{
					Template T_TFBot_Scout_Fan
				}
				TFBot
				{
					Template T_TFBot_Scout_Fan
				}
				TFBot
				{
					Template T_TFBot_Scout_Fan
				}
			}
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave2_democaber"
			TotalCount 10
			MaxActive 3
			SpawnCount 3
			WaitForAllDead "wave2_basherhelp"
			WaitBetweenSpawns 8
			TotalCurrency 50
			Support 1
			
			TFBot
			{
				Template T_TFBot_Pyro_Axtinguisher
			}
		}
		
		WaveSpawn
		{
			Where spawnbot_wall_right
			Where spawnbot_wall_left
			Name "wave2_sandmanscouts"
			TotalCount 10
			MaxActive 2
			SpawnCount 2
			WaitForAllDead "wave2_basherhelp"
			WaitBetweenSpawns 5
			TotalCurrency 50
			
			TFBot
			{
				Template T_TFBot_Scout_Sandman
				WeaponRestrictions MeleeOnly
			}
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave2_minibosssquad"
			TotalCount 16
			MaxActive 16
			SpawnCount 4
			WaitForAllDead "wave2_democonchsquad"
			WaitBetweenSpawns 15
			TotalCurrency 250
			
			Squad
			{
				TFBot
				{
					Template T_TFBot_Giant_Medic_Plague
				}
				TFBot
				{
					Template T_TFBot_Pyro_VolcanoFragment
				}
				TFBot
				{
					Template T_TFBot_Pyro_VolcanoFragment
				}
				TFBot
				{
					Template T_TFBot_Pyro_VolcanoFragment
				}
			}
		}
	
	}

	Wave // WAVE 3 - 600$
	{
		StartWaveOutput
		{
			Target wave_start_relay
			Action Trigger
		}
		DoneOutput
		{
			Target wave_finished_relay
			Action Trigger
		}
		
		WaveSpawn // Tank!  
		{
			Name "wave3_tank"
			TotalCount 1
			WaitBeforeStarting 0
			TotalCurrency 150

			Tank
			{
				Health 15000
				Speed 75
				Skin 0
				Name "wave3_tankboss"
				StartingPathTrackNode "boss_path_a1"

				OnKilledOutput                                  
				{
					Target boss_dead_relay
					Action Trigger
				}
				OnBombDroppedOutput                             
				{
					Target boss_deploy_relay 
					Action Trigger                         
				}
			}			
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave3_support"
			TotalCount 40
			MaxActive 15
			SpawnCount 5
			WaitBeforeStarting 12
			WaitBetweenSpawns 4
			TotalCurrency 100
			
			TFBot
			{
				Template T_TFBot_Scout_Melee
				ClassIcon scout_bat
			}
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave3_support1"
			TotalCount 12
			MaxActive 3
			SpawnCount 3
			WaitForAllDead "wave3_tank"
			WaitBetweenSpawns 15
			TotalCurrency 50
			Support 1
			
			TFBot
			{
				Template T_TFBot_Heavyweapons_Heavyweight_Champ
			}
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave3_beyondthetank"
			TotalCount 25
			MaxActive 6
			SpawnCount 3
			WaitForAllDead "wave3_support"
			WaitBetweenSpawns 5
			TotalCurrency 100
			
			TFBot
			{
				Template T_TFBot_Pyro_ThirdDegree
			}
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave3_beyondthetank"
			TotalCount 12
			MaxActive 8
			SpawnCount 4
			WaitForAllDead "wave3_support"
			WaitBeforeStarting 5
			WaitBetweenSpawns 20
			TotalCurrency 150
			
			Squad
			{
				TFBot
				{
					Template T_TFBot_Giant_Heavyweapons_KGB
				}
				TFBot
				{
					Template T_TFBot_Pyro_ThirdDegree
				}
				TFBot
				{
					Template T_TFBot_Pyro_ThirdDegree
				}
				TFBot
				{
					Template T_TFBot_Pyro_ThirdDegree
				}
			}
		}
		
		WaveSpawn
		{
			Where spawnbot
			Name "wave3_beyondthetank"
			TotalCount 8
			MaxActive 4
			SpawnCount 4
			WaitForAllDead "wave3_support"
			WaitBeforeStarting 20
			WaitBetweenSpawns 20
			TotalCurrency 150
			
			Squad
			{
				TFBot
				{
					Template T_TFBot_Giant_Sniper_BlackMage
				}
				TFBot
				{
					Template T_TFBot_Pyro_ThirdDegree
				}
				TFBot
				{
					Template T_TFBot_Pyro_ThirdDegree
				}
				TFBot
				{
					Template T_TFBot_Pyro_ThirdDegree
				}
			}
		}
	}

	Wave // WAVE 4 - 650$
	{
		StartWaveOutput
		{
			Target wave_start_relay
			Action Trigger
		}
		DoneOutput
		{
			Target wave_finished_relay
			Action Trigger
		}
		
		WaveSpawn // FoS Heavies + Plague Medics
		{
			Where spawnbot
			Name "wave4_fosplague"
			TotalCount 20
			MaxActive 20
			SpawnCount 4
			WaitBetweenSpawns 5
			TotalCurrency 150
			Squad
			{
				ShouldPreserveSquad 1
				TFBot
				{
					Template T_TFBot_Heavyweapons_BigFoS
				}
				TFBot
				{
					Template T_TFBot_Medic_Plague
				}
				TFBot
				{
					Template T_TFBot_Medic_Plague
				}
				TFBot
				{
					Template T_TFBot_Medic_Plague
				}
			}
		}
		
		WaveSpawn // Heavy Mittens
		{
			Where spawnbot
			Name "wave4_giantscouts"
			TotalCount 20
			MaxActive 10
			SpawnCount 2
			WaitForAllDead "wave4_fosplague"
			WaitBeforeStarting 0
			WaitBetweenSpawns 3
			TotalCurrency 50
			
			TFBot
			{
				Template T_TFBot_Heavyweapons_Mittens
			}
		}
		
		WaveSpawn // Giant Scouts
		{
			Where spawnbot
			Name "wave4_giantscoutsSCOUTS"
			TotalCount 2
			MaxActive 1
			SpawnCount 1
			WaitForAllDead "wave4_fosplague"
			WaitBeforeStarting 12
			WaitBetweenSpawns 24
			TotalCurrency 150
			
			TFBot
			{
				Template T_TFBot_Giant_Scout
				WeaponRestrictions MeleeOnly
			}
		}
		
		
		WaveSpawn // Tank!  
		{
			Name "wave4_tank"
			TotalCount 1
			WaitForAllSpawned "wave4_giantscoutsSCOUTS"
			WaitBeforeStarting 10
			TotalCurrency 100

			Tank
			{
				Health 15000
				Speed 75
				Skin 0
				Name "wave4_tankboss"
				StartingPathTrackNode "boss_path_a1"

				OnKilledOutput                                  
				{
					Target boss_dead_relay
					Action Trigger                         
				}
				OnBombDroppedOutput                             
				{
					Target boss_deploy_relay 
					Action Trigger                         
				}
			}		
		}
		
		WaveSpawn // BatBackup Squad and Samurais
		{
			Where spawnbot
			Name "wave4_tankhelp"
			TotalCount 24
			MaxActive 12
			SpawnCount 4
			WaitForAllDead "wave4_giantscouts"
			WaitBeforeStarting 5
			WaitBetweenSpawns 12
			TotalCurrency 100
			
			Squad
			{
				TFBot
				{
					Template T_TFBot_Soldier_Extended_Battalion
				}
				TFBot
				{
					Template T_TFBot_Demoman_Knight
				}
				TFBot
				{
					Template T_TFBot_Demoman_Knight			
				}
				TFBot
				{
					Template T_TFBot_Demoman_Knight				
				}
			}
		}
		
		WaveSpawn // Grand Magician Soldier & Black Magic Sniper
		{
			Where spawnbot
			Name "wave4_aftertankdeath"
			TotalCount 2
			MaxActive 2
			SpawnCount 2
			WaitForAllSpawned "wave4_tankhelp"
			TotalCurrency 50
			
			Squad
			{
				TFBot
				{
					Template T_TFBot_Giant_Soldier_Magic
				}
				TFBot
				{
					Template T_TFBot_Giant_Sniper_BlackMage
				}
			}
		}
		
		WaveSpawn // Support Suicidal Demos
		{
			Where spawnbot
			Name "wave4_support"
			TotalCount 6
			MaxActive 3
			SpawnCount 1
			WaitForAllDead "wave4_fosplague"
			WaitBeforeStarting 30
			WaitBetweenSpawns 4
			TotalCurrency 50
			Support 1
			
			TFBot
			{
				Template T_TFBot_Scout_Fan
			}
		}
	}

	Wave // WAVE 5 - 700$
	{
		InitWaveOutput
		{	// Hack to get Bushido squads to leave spawn promptly.
			Target BigNet
			Action RunScriptCode
			Param "
				::OutdatedProcessing <- {
					ThinkingBots = []

					function AddBlindThink() {
						if (!self.HasBotTag(`blindme`)) return
						self.RemoveBotTag(`blindme`)

						OutdatedProcessing.ThinkingBots.push(self)
						self.AddBotAttribute(Constants.FTFBotAttributeType.IGNORE_ENEMIES)

						this.BlindMe <- function() {
							if (self.InCond(Constants.ETFCond.TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED)) return -1
							self.RemoveBotAttribute(Constants.FTFBotAttributeType.IGNORE_ENEMIES)
							self.FlagForUpdate(true)
							AddThinkToEnt(self, null)
							NetProps.SetPropString(self, `m_iszScriptThinkFunction`, ``)
						}
						AddThinkToEnt(self, `BlindMe`)
					}

					function OnGameEvent_teamplay_round_start(_) {
						foreach (bot in ThinkingBots) AddThinkToEnt(bot, null)
						delete ::OutdatedProcessing
					}

					function OnGameEvent_player_spawn(params) {
						local bot = GetPlayerFromUserID(params.userid)
						if (!bot.IsBotOfType(Constants.EBotType.TF_BOT_TYPE)) return

						bot.ValidateScriptScope()
						EntFireByHandle(bot, `RunScriptCode`, `OutdatedProcessing.AddBlindThink.call(this)`, 0.2, null, null)
					}
				}
				__CollectGameEventCallbacks(OutdatedProcessing)
			"
		}
		StartWaveOutput
		{
			Target wave_start_relay
			Action Trigger
		}
		DoneOutput
		{
			Target wave_finished_relay
			Action Trigger
		}
	
		WaveSpawn // Giant Bushidos + Conch Samurais
		{
			Where spawnbot
			Name "wave5_samurairound"
			TotalCount 12
			MaxActive 8
			SpawnCount 4
			WaitBeforeStarting 0
			WaitBetweenSpawns 10
			TotalCurrency 150
			
			Squad
			{
				TFBot
				{
					Template T_TFBot_Giant_Soldier_Bushido
					Tag blindme
				}
				TFBot
				{
					Template T_TFBot_Soldier_Concheror_Samurai
					ClassIcon soldier_samurai_conch // Custom icon
					WeaponRestrictions SecondaryOnly
					Item "The Concheror"
					ItemAttributes
					{
						ItemName "The Concheror"
						"deploy time decreased" 0.01
					}
					Tag blindme
				}
				TFBot
				{
					Template T_TFBot_Soldier_Concheror_Samurai
					Tag blindme
				}
				TFBot
				{
					Template T_TFBot_Soldier_Concheror_Samurai
					Tag blindme
				}
			}
		}
		
		WaveSpawn // Giant Barbarians + Regular Barbarians
		{
			Where spawnbot
			Name "wave5_barbarians"
			TotalCount 12
			MaxActive 9
			SpawnCount 3
			WaitForAllDead "wave5_samurairound"
			WaitBeforeStarting 3
			WaitBetweenSpawns 14
			TotalCurrency 150
			
			Squad
			{
				TFBot
				{
					Template T_TFBot_Giant_Pyro_Barbarian
				}
				TFBot
				{
					Template T_TFBot_Pyro_Barbarian
				}
				TFBot
				{
					Template T_TFBot_Pyro_Barbarian
				}
			}
		}
		
		WaveSpawn // Regular Barbarians
		{
			Where spawnbot
			Name "wave5_barbarians"
			TotalCount 34
			MaxActive 10
			SpawnCount 2
			WaitForAllDead "wave5_samurairound"
			WaitBeforeStarting 0
			WaitBetweenSpawns 5
			TotalCurrency 50
			
			TFBot
			{
				Template T_TFBot_Pyro_Barbarian
			}
		}
		
		WaveSpawn // Tank!
		{
			Name "wave5_tankround"
			TotalCount 1
			WaitBeforeStarting 3
			TotalCurrency 100
			WaitForAllDead "wave5_barbarians"

			Tank
			{
				Health 15000
				Speed 75
				Skin 0
				Name "wave5_tank"
				StartingPathTrackNode "boss_path_a1"

				OnKilledOutput                                  
				{
					Target boss_dead_relay
					Action Trigger                         
				}
				OnBombDroppedOutput                             
				{
					Target boss_deploy_relay 
					Action Trigger                         
				}
			}	
		}
		
		WaveSpawn // Crit Scouts
		{
			Where spawnbot
			Name "wave5_tankround"
			TotalCount 20
			MaxActive 8
			SpawnCount 2
			WaitForAllDead "wave5_barbarians"
			WaitBeforeStarting 19
			WaitBetweenSpawns 5
			TotalCurrency 100
			
			TFBot
			{
				Template T_TFBot_Scout_Melee
				Attributes AlwaysCrit
			}
		}
		
		WaveSpawn // Demoknights
		{
			Where spawnbot
			Name "wave5_tankround"
			TotalCount 20
			MaxActive 8
			SpawnCount 2
			WaitForAllDead "wave5_barbarians"
			WaitBeforeStarting 20
			WaitBetweenSpawns 5
			TotalCurrency 100
			
			TFBot
			{
				Template T_TFBot_Demoman_Knight
			}
		}
		
		WaveSpawn // Giant Demoknights
		{
			Where spawnbot
			Name "wave5_tankround"
			TotalCount 2
			MaxActive 2
			SpawnCount 1
			WaitForAllDead "wave5_barbarians"
			WaitBeforeStarting 40
			WaitBetweenSpawns 16
			TotalCurrency 50
			
			TFBot
			{
				Template T_TFBot_Giant_DemoMan_PrinceTavish
				Health 4500
			}
		}
		
		WaveSpawn // Support Suicidal Demos
		{
			Where spawnbot
			Name "wave5_support"
			MaxActive 3
			SpawnCount 3
			WaitBeforeStarting 30
			WaitBetweenSpawns 20
			Support 1
			
			TFBot
			{
				Template T_TFBot_Demoman_Caber
				Attributes AlwaysCrit
			}
		}
	}
	
	Wave // WAVE 6 - 750$
	{
		StartWaveOutput
		{
			Target wave_start_relay
			Action Trigger
		}
		DoneOutput
		{
			Target wave_finished_relay
			Action Trigger
		}
		
		WaveSpawn // Tank!
		{
			Name "wave6_tankround"
			TotalCount 1
			TotalCurrency 100

			Tank
			{
				Health 22500
				Speed 75
				Skin 1 // final tank
				Name "wave6_tank"
				StartingPathTrackNode "boss_path_a1"
				OnKilledOutput                                  
				{
					Target boss_dead_relay
					Action Trigger                         
				}
				OnBombDroppedOutput                             
				{
					Target boss_deploy_relay 
					Action Trigger                         
				}
			}	
		}
		
		WaveSpawn // Buff Banner soldier + Bushwacka combo
		{
			Where spawnbot
			Name "wave6_tankroundFIX"
			TotalCount 42
			MaxActive 9
			SpawnCount 3
			WaitBeforeStarting 2
			WaitBetweenSpawns 10
			TotalCurrency 100
			
			Squad
			{
				TFBot
				{
					Template T_TFBot_Soldier_Extended_Buff_Banner
					WeaponRestrictions SecondaryOnly
				}
				TFBot
				{
					Template T_TFBot_Sniper_Bushwacka
				}
				TFBot
				{
					Template T_TFBot_Sniper_Bushwacka
				}
			}
		}
		
		WaveSpawn
		{
			Where spawnbot_wall_right
			Where spawnbot_wall_left
			Name "wave6_sandmanscouts"
			TotalCount 12
			MaxActive 4
			SpawnCount 2
			WaitBeforeStarting 18
			WaitBetweenSpawns 6
			TotalCurrency 50
			
			TFBot
			{
				Template T_TFBot_Scout_Sandman
				Attributes AlwaysCrit
				WeaponRestrictions MeleeOnly
			}
		}
		
		WaveSpawn // Now the real meat - The King of Australlia
		{
			Where spawnbot
			Name "wave6_finalboss"
			TotalCount 3
			MaxActive 3
			SpawnCount 3
			WaitBeforeStarting 3
			WaitForAllDead "wave6_tankround"
			FirstSpawnWarningSound "Sniper.MVM_BattleCry05"
			TotalCurrency 350
			
			Squad
			{
				TFBot
				{
					Template T_TFBot_Giant_Sniper_King
				}
				TFBot
				{
					Template T_TFBot_Giant_Soldier_BuffWhip
					WeaponRestrictions SecondaryOnly
					
					Item "The Buff Banner"
					ItemAttributes
					{
						ItemName "The Buff Banner"
						"deploy time increased" 1.50				
					}
				}
				TFBot
				{
					Template T_TFBot_Giant_Soldier_BuffWhip
				}
			}
		}
		
		WaveSpawn // Marauders - they serve as offense
		{
			Where spawnbot
			Name "wave6_supportsquad"
			TotalCount 20
			MaxActive 6
			SpawnCount 2
			WaitForAllDead "wave6_tankround"
			WaitBeforeStarting 10
			WaitBetweenSpawns 10
			TotalCurrency 50
			Support 1
			
			TFBot
			{
				Template T_TFBot_Sniper_Desert
			}
		}
		
		WaveSpawn // Crit Mitten Heavies - they serve as an occasional distraction
		{
			Where spawnbot_wall_left
			Where spawnbot_wall_right
			Name "wave6_supportsquad"
			TotalCount 20
			MaxActive 2
			SpawnCount 1
			WaitForAllSpawned "wave6_tankround"
			WaitBeforeStarting 10
			WaitBetweenSpawns 20
			TotalCurrency 50
			Support 1
			
			TFBot
			{
				Template T_TFBot_Heavyweapons_Mittens
				Attributes AlwaysCrit
			}
		}
		
		WaveSpawn // Fan Scouts - they serve as support
		{
			Where spawnbot_wall_right
			Where spawnbot_wall_left
			Name "wave6_supportsquad"
			TotalCount 20
			MaxActive 4
			SpawnCount 2
			WaitForAllDead "wave6_tankround"
			WaitBeforeStarting 10
			WaitBetweenSpawns 10
			TotalCurrency 100
			Support 1
			
			TFBot
			{
				Template T_TFBot_Scout_Fan
			}
		}
	}
}