public static Random rnd = null;
public static Events.PlayerDeathCallback e_PlayerDeath = null;
public static Events.ObjectCreatedCallback e_ObjectCreated = null;

public static Wave[] Waves = new Wave[]{

	new Wave(){
		Name = "The Clown Gang Pulled Into Town",
		
		Groupings = new List<Group>(){
		
			new Group(){
				Name = "Clownster",
				
				SpawnCount = 5, 
				SpawnDelay = 2000, 
				Type = GroupType.KillAll,
				
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[] { WeaponItem.BAT, WeaponItem.PISTOL },					
					new WeaponItem[] { WeaponItem.CHAIN, WeaponItem.MACHINE_PISTOL },					
					new WeaponItem[] { WeaponItem.SHOTGUN },					
					new WeaponItem[] { WeaponItem.TOMMYGUN }					
				},		

				Modifiers = new PlayerModifiers(){
					MaxHealth = 20
				},
				
				AI = PredefinedAIType.BotC,
				
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "Clownster",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin3", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("BodyArmor", "ClothingLightPurple", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingDarkCyan", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("Shoes", "ClothingRed", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("JacketBlack", "ClothingDarkPurple", "ClothingLightPurple", ""),
						Accessory = new IProfileClothingItem("ClownMakeup", "ClothingDarkGreen", "ClothingLightGray", ""),
					}
				},
				
				ShowNametag = false
			}
		},
		
		MinimumWave = 2
	},

	new Wave(){
		Name = "Here Come The Boys",	
		
		Groupings = new List<Group>(){
		
			new Group(){
				Name = "Bud",				
				SpawnCount = 6, 
				SpawnDelay = 1000, 
				Type = GroupType.WaitTillSpawned,		
				
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[] { WeaponItem.CHAIN },
					new WeaponItem[] { WeaponItem.CHAIR },
					new WeaponItem[] { WeaponItem.LEAD_PIPE },
					new WeaponItem[] { WeaponItem.UZI },
					new WeaponItem[] { WeaponItem.BOTTLE },
				},				
				Modifiers = new PlayerModifiers(){
					CurrentHealth = 20,
					MaxHealth = 20
				},
				AI = PredefinedAIType.BotD,
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "ThugA",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Tattoos", "Skin3", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("SleevelessShirt", "ClothingDarkBlue", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingDarkBlue", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("Boots", "ClothingDarkBrown", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("Vest", "ClothingLightBlue", "ClothingLightBlue", ""),
						Head = new IProfileClothingItem("Headband", "ClothingDarkRed", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "ThugA",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Tattoos", "Skin3", "ClothingPink", ""),
						Legs = new IProfileClothingItem("TornPants", "ClothingLightBlue", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Belt", "ClothingDarkGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("BootsBlack", "ClothingBlue", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("VestBlack", "ClothingDarkBlue", "ClothingBlue", ""),
						Accessory = new IProfileClothingItem("DogTag", "ClothingLightGray", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("FingerlessGloves", "ClothingDarkGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("WoolCap", "ClothingLightRed", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "ThugA",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Tattoos", "Skin3", "ClothingLightYellow", ""),
						ChestUnder = new IProfileClothingItem("SleevelessShirt", "ClothingLightGray", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("TornPants", "ClothingLightBlue", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Belt", "ClothingGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("BootsBlack", "ClothingGray", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("SunGlasses", "ClothingDarkGray", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("FingerlessGloves", "ClothingBrown", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Headband", "ClothingLightRed", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "ThugA",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Tattoos", "Skin1", "ClothingDarkYellow", ""),
						ChestUnder = new IProfileClothingItem("SleevelessShirt", "ClothingDarkBlue", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingDarkBlue", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("Boots", "ClothingDarkBrown", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("Vest", "ClothingLightBlue", "ClothingLightBlue", ""),
						Head = new IProfileClothingItem("Headband", "ClothingRed", "ClothingLightGray", "")
					}
				},
				ShowNametag = false
			}
		},
		
		MinimumWave = 0
	},
	
	new Wave(){
		Name = "DIO!?!",
	
		Groupings = new List<Group>(){
			
			new Group(){
				Name = "[The World]",
				SpawnCount = 1, 
				SpawnDelay = 0, 
				Type = GroupType.Proceed,
				
				Weapons = null,
				Modifiers = new PlayerModifiers(){
					MaxHealth = 50,
					MeleeForceModifier = 3,
					SizeModifier = 2
				},
				AI = PredefinedAIType.BotA,
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "The World",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin5", "ClothingLightYellow", ""),
						ChestUnder = new IProfileClothingItem("ShirtWithTie", "ClothingDarkYellow", "ClothingLightYellow", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingYellow", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Sash", "ClothingLightYellow", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingLightYellow", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("GrenadeBelt", "ClothingLightGray", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("Balaclava", "ClothingLightYellow", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("FingerlessGloves", "ClothingYellow", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Headband", "ClothingYellow", "ClothingLightGray", "")
					}
				},
				ShowNametag = true				
			},
			
			new Group(){
				Name = "DIO",
				SpawnCount = 1, 
				SpawnDelay = 200, 
				Type = GroupType.KillAll,
				
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[] { WeaponItem.KNIFE },
					new WeaponItem[] { WeaponItem.KATANA },
					new WeaponItem[] { WeaponItem.BOW },
				},
				Modifiers = new PlayerModifiers(){
					MaxHealth = 40
				},
				AI = PredefinedAIType.Funnyman,
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "DIO",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin4", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("Shirt", "ClothingDarkGray", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingLightOrange", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("SmallBelt", "ClothingGreen", "ClothingLightGreen", ""),
						Feet = new IProfileClothingItem("Boots", "ClothingLightBrown", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("Jacket", "ClothingLightOrange", "ClothingLightOrange", ""),
						Hands = new IProfileClothingItem("FingerlessGloves", "ClothingLightYellow", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Beret", "ClothingLightYellow", "ClothingLightYellow", "")
					}
				},
				ShowNametag = true,
				
				SpawnDialogue = new List<string>(){
					"Za warudo!",
					"Oh you're approaching me?",
					"Useless",
					"Muda",
					"I've already won"
				},
				
				DeathDialogue = new List<string>(){
					"Wryyy",
					"Kono dio da",
					"Impossible",
					"I am Dio!"
				}
			}
		},
		
		MinimumWave = 5
	},	
	
	new Wave(){
		Name = "Stop Resisting The Law",
		
		Groupings = new List<Group>(){
			
			new Group(){
				Name = "Metrocop",
				SpawnCount = 5, 
				SpawnDelay = 4000, 
				Type = GroupType.Proceed,
				
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[] { WeaponItem.SMG, WeaponItem.SHOCK_BATON },
					new WeaponItem[] { WeaponItem.DARK_SHOTGUN, WeaponItem.SHOCK_BATON },
				},
				Modifiers = new PlayerModifiers(){
					MaxHealth = 15
				},
				AI = PredefinedAIType.Grunt,
				
				Profiles = new List<IProfile>(){					
					new IProfile() {
						Name = "MetroCopA",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin3", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("SleevelessShirt", "ClothingGreen", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("BootsBlack", "ClothingGray", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("MetroLawJacket", "ClothingGray", "ClothingGray", ""),
						Hands = new IProfileClothingItem("SafetyGlovesBlack", "ClothingGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("MetroLawGasMask", "ClothingGray", "ClothingLightGreen", "")
					},
					new IProfile() {
						Name = "MetroCopB",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin3", "ClothingLightRed", ""),
						ChestUnder = new IProfileClothingItem("SleevelessShirt", "ClothingGreen", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("BootsBlack", "ClothingGray", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("MetroLawJacket", "ClothingGray", "ClothingGray", ""),
						Hands = new IProfileClothingItem("SafetyGlovesBlack", "ClothingGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("MetroLawMask", "ClothingGray", "ClothingLightGreen", "")
					}
				},
				ShowNametag = false
			},
			
			new Group(){
				Name = "Elite Metrocop",
				SpawnCount = 4, 
				SpawnDelay = 7000, 
				Type = GroupType.KillAll,
				
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[] { WeaponItem.SNIPER, WeaponItem.SHOCK_BATON },
					new WeaponItem[] { WeaponItem.ASSAULT, WeaponItem.SHOCK_BATON },
					new WeaponItem[] { WeaponItem.M60, WeaponItem.SHOCK_BATON },
				},
				Modifiers = new PlayerModifiers(){
					MaxHealth = 30
				},
				AI = PredefinedAIType.RangedA,
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "MetroCopD",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Tattoos", "Skin5", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("BodyArmor", "ClothingGray", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingGray", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("CombatBelt", "ClothingGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("BootsBlack", "ClothingGray", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("SafetyGlovesBlack", "ClothingGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("MetroLawGasMask", "ClothingGray", "ClothingLightRed", "")
					}
				},
				ShowNametag = true
			}
		},
		
		MinimumWave = 4
	},

	new Wave(){
		Name = "The Super xd Team",
		
		Groupings = new List<Group>(){
			
			new Group(){
				Name = "Follower Of The xd",
				SpawnCount = 12,
				SpawnDelay = 1000,
				Type = GroupType.KillAll,
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 1,
				},
				AI = PredefinedAIType.BotD,
				
				ShowNametag = true,
				
				DeathDialogue = new List<string>(){
					"xd"
				}
			},
			
			new Group(){
				Name = "Guardian Of The xd",
				SpawnCount = 4,
				SpawnDelay = 6000,
				Type = GroupType.KillAll,
				
				MinimumWave = 5,
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 30,
					MeleeDamageTakenModifier = 0.5f
				},
				
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[]{ WeaponItem.KATANA },
					new WeaponItem[]{ WeaponItem.AXE }
				},
				
				AI = PredefinedAIType.BotD,
				
				DeathDialogue = new List<string>(){
					":V",
					"XDXDXD"
				},
				
				ShowNametag = true
			},
			
			new Group(){
				Name = "Enforcer Of The xd",
				SpawnCount = 1,
				SpawnDelay = 7000,
				Type = GroupType.KillAll,
				
				MinimumWave = 5,
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 70,
					SizeModifier = 2,
					MeleeForceModifier = 2					
				},
				
				AI = PredefinedAIType.BotC,
				
				ShowNametag = true,
				
				SpawnDialogue = new List<string>(){
					"What do you fear most",
					"I fear no man",
					"Witness pure perfection",
					"Our fight shall be glorious"
				},
					
				DeathDialogue = new List<string>(){
					"I-imposible...",
					"I am the ultimate being",
					"*Cough* but how",
					"My death will not be forgotten",
					"With my final breath... xd"
				}
			}
		},
		
		MinimumWave = 2,
	},
	
	new Wave(){
		Name = "The Cultists Rise Again",
		
		Groupings = new List<Group>(){
		
			new Group(){
				Name = "Undead Cultist",
				Type = GroupType.Infinite,
				SpawnDelay = 6000,
				
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[]{ WeaponItem.GRENADES, WeaponItem.PISTOL },
					new WeaponItem[]{ WeaponItem.REVOLVER, WeaponItem.LEAD_PIPE },
					new WeaponItem[]{ WeaponItem.CARBINE, WeaponItem.SMG }
				},
				AI = PredefinedAIType.ZombieB,
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 5
				},
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "Cultist",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingDarkGray", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("Robe", "ClothingDarkPink", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("GlovesBlack", "ClothingGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Hood", "ClothingDarkPink", "ClothingLightGray", "")
					}
				},
				
				ShowNametag = false
			},
		
			new Group(){
				Name = "Cultist Guard",
				SpawnCount = 3,
				SpawnDelay = 12000,
				Type = GroupType.Proceed,
				AI = PredefinedAIType.MeleeB,
				
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[]{ WeaponItem.KATANA },
					new WeaponItem[]{ WeaponItem.AXE }
				},
				Modifiers = new PlayerModifiers(){
					MaxHealth = 25,
					MeleeDamageTakenModifier = 0.5f
				},
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "Cultist Guard",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingDarkGray", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("Robe", "ClothingDarkBlue", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("GlovesBlack", "ClothingGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Hood", "ClothingDarkBlue", "ClothingLightGray", "")
					}
				},
				
				ShowNametag = false
			},
		
			new Group(){
				Name = "Cultist Leader",
				SpawnCount = 1,
				SpawnDelay = 3000,
				Type = GroupType.KillAll,
				AI = PredefinedAIType.RangedA,
				
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[]{ WeaponItem.MAGNUM, WeaponItem.KNIFE }
				},
				Modifiers = new PlayerModifiers(){
					MaxHealth = 40,
					MeleeDamageTakenModifier = 1.5f
				},
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "CultistLeader",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin3", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingDarkGray", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("Robe", "ClothingRed", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("DogTag", "ClothingLightGray", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("GlovesBlack", "ClothingGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Hood", "ClothingRed", "ClothingLightGray", "")
					}
				},
				
				ShowNametag = true,
				
				SpawnDialogue = new List<string>(){
					"I live again",
					"I won't die so easily this time"
				},
				
				DeathDialogue = new List<string>(){
					"Ugh...",
					"How?",
					"This isn't real"
				}
			}
		
		},
		
		MinimumWave = 5
	},
	
	new Wave(){
		Name = "Santa's Slay Tonight",
		
		Groupings = new List<Group>(){
			
			new Group(){
				Name = "Elf",
				SpawnDelay = 3000,
				Type = GroupType.Infinite,
				AI = PredefinedAIType.BotD,
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 5
				},
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[]{ WeaponItem.FLAREGUN, WeaponItem.BAT },
					new WeaponItem[]{ WeaponItem.MACHETE, WeaponItem.MOLOTOVS },
					new WeaponItem[]{ WeaponItem.REVOLVER, WeaponItem.C4 },
					new WeaponItem[]{ WeaponItem.PISTOL, WeaponItem.BASEBALL }
				},
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "Elf",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Tattoos", "Skin3", "ClothingPink", ""),
						ChestUnder = new IProfileClothingItem("LeatherJacket", "ClothingGreen", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingGreen", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Belt", "ClothingDarkGreen", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("BootsBlack", "ClothingGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("SantaHat", "ClothingGreen", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "Elf",
						Gender = Gender.Female,
						Skin = new IProfileClothingItem("Tattoos_fem", "Skin3", "ClothingPink", ""),
						ChestUnder = new IProfileClothingItem("LeatherJacket_fem", "ClothingGreen", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants_fem", "ClothingGreen", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Belt_fem", "ClothingDarkGreen", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("BootsBlack", "ClothingGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("SantaHat", "ClothingGreen", "ClothingLightGray", "")
					}
				},
				ShowNametag = false
			},
			
			new Group(){
				Name = "Santa",
				SpawnCount = 1,
				SpawnDelay = 3000,
				Type = GroupType.KillAll,
				AI = PredefinedAIType.Grunt,
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 60,
				},
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[]{WeaponItem.AXE, WeaponItem.ASSAULT, WeaponItem.FLAREGUN}
				},
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "Santa",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Tattoos", "Skin3", "ClothingPink", ""),
						ChestUnder = new IProfileClothingItem("SleevelessShirt", "ClothingLightGray", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingRed", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Belt", "ClothingDarkRed", "ClothingLightYellow", ""),
						Feet = new IProfileClothingItem("BootsBlack", "ClothingBrown", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("Coat", "ClothingRed", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("SantaMask", "ClothingLightGray", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("SafetyGlovesBlack", "ClothingGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("SantaHat", "ClothingRed", "ClothingLightGray", "")
					}
				},
				
				ShowNametag = true
			}
		},
		
		MinimumWave = 5
	},

	new Wave(){
		Name = "Offworld Invaders",
		
		Groupings = new List<Group>(){
			
			new Group(){
				Name = "Alien",
				SpawnCount = 8,
				SpawnDelay = 4000,
				Type = GroupType.WaitTillSpawned,
				
				AI = PredefinedAIType.Punk,
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[]{ WeaponItem.FLAREGUN, WeaponItem.MACHETE },
					new WeaponItem[]{ WeaponItem.SILENCEDPISTOL, WeaponItem.SMG },
					new WeaponItem[]{ WeaponItem.SHOCK_BATON, WeaponItem.MINES },
				},
				Modifiers = new PlayerModifiers(){
					MaxHealth = 25,	
				},
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "Alien",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin5", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("ShirtWithTie", "ClothingGray", "ClothingLightRed", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingGray", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("SuitJacket", "ClothingDarkGray", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("GasMask2", "ClothingDarkGray", "ClothingLightRed", ""),
						Hands = new IProfileClothingItem("Gloves", "ClothingDarkGray", "ClothingLightGray", ""),
					},
					new IProfile() {
						Name = "Alien",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin5", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("Sweater", "ClothingDarkGray", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingBrown", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("Vizor", "ClothingDarkGray", "ClothingLightOrange", ""),
						Hands = new IProfileClothingItem("Gloves", "ClothingDarkGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("AviatorHat", "ClothingDarkGray", "ClothingLightOrange", "")
					},
					new IProfile() {
						Name = "Alien",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin5", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("SleevelessShirt", "ClothingDarkGray", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingDarkGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingBrown", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("GasMask", "ClothingDarkGray", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("Gloves", "ClothingDarkGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("MotorcycleHelmet", "ClothingDarkGray", "ClothingLightPurple", "")
					},
					new IProfile() {
						Name = "Alien",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin5", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("SweaterBlack", "ClothingGreen", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingGreen", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingGray", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("Gloves", "ClothingGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("HazmatMask", "ClothingDarkGray", "ClothingGreen", "")
					},
					new IProfile() {
						Name = "Alien",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin3", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("LeatherJacketBlack", "ClothingGray", "ClothingDarkGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingGray", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("GasMask", "ClothingDarkGray", "ClothingLightYellow", ""),
						Hands = new IProfileClothingItem("SafetyGlovesBlack", "ClothingGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Hood", "ClothingDarkGray", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "Alien",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin5", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("BodyArmor", "ClothingGray", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingGray", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Belt", "ClothingGray", "ClothingGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingGray", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("Vizor", "ClothingDarkGray", "ClothingLightRed", ""),
						Hands = new IProfileClothingItem("GlovesBlack", "ClothingGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Headband", "ClothingDarkGray", "ClothingLightGray", "")
					}
				},
			},
			
			new Group(){
				Name = "Alien Overlord",
				SpawnCount = 3,
				SpawnDelay = 3000,
				Type = GroupType.KillAll,
				AI = PredefinedAIType.Grunt,
				
				MinimumWave = 5,
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 30					
				},
				
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[]{ WeaponItem.SMG, WeaponItem.SHOCK_BATON, WeaponItem.LAZER, WeaponItem.C4 },
					new WeaponItem[]{ WeaponItem.HAMMER, WeaponItem.DARK_SHOTGUN, WeaponItem.LAZER, WeaponItem.MINES }
				},
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin5", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("Shirt", "ClothingYellow", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingYellow", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("Shoes", "ClothingYellow", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("GasMask2", "ClothingYellow", "ClothingLightRed", ""),
						Hands = new IProfileClothingItem("SafetyGloves", "ClothingYellow", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Hood", "ClothingYellow", "ClothingLightGray", "")
					}
				},
				
				SpawnDialogue = new List<string>(){
					"We come in peace",
					"We mean no harm",
					"Take us to your leader",
					""
				},
				
				DeathDialogue = new List<string>(){
					"Destroy all humans",
					"Primitive apes",
					"Humanity lacks intelligence",
					"Such small brains",
					""
				},
				
				ShowNametag = true
			}
		},
		
		MinimumWave = 0
	},
	
	new Wave(){
		Name = "Wild West",
		
		Groupings = new List<Group>(){
			
			new Group(){
				Name = "Bandit",
				SpawnCount = 6,
				SpawnDelay = 3000,
				Type = GroupType.Proceed,
				AI = PredefinedAIType.Punk,
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 25
				},
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[]{ WeaponItem.SAWED_OFF },
					new WeaponItem[]{ WeaponItem.SHOTGUN },
					new WeaponItem[]{ WeaponItem.WHIP, WeaponItem.MOLOTOVS }
				},
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "BandidoA",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin2", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("Shirt", "ClothingDarkOrange", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingDarkRed", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("SatchelBelt", "ClothingOrange", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("RidingBoots", "ClothingBrown", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("Poncho2", "ClothingDarkYellow", "ClothingLightYellow", ""),
						Accessory = new IProfileClothingItem("Mask", "ClothingDarkRed", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Sombrero", "ClothingOrange", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "BandidoA",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin2", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("UnbuttonedShirt", "ClothingDarkOrange", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingDarkRed", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("AmmoBeltWaist", "ClothingOrange", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("RidingBoots", "ClothingBrown", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("Scarf", "ClothingLightOrange", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("FingerlessGloves", "ClothingDarkYellow", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Sombrero", "ClothingLightBrown", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "BandidoA",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin2", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("UnbuttonedShirt", "ClothingDarkOrange", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingDarkYellow", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Belt", "ClothingOrange", "ClothingYellow", ""),
						Feet = new IProfileClothingItem("RidingBoots", "ClothingBrown", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("AmmoBelt", "ClothingDarkGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Headband", "ClothingRed", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "CowboyA",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin3", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("UnbuttonedShirt", "ClothingDarkOrange", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingDarkRed", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("AmmoBeltWaist", "ClothingOrange", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("RidingBoots", "ClothingBrown", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("Scarf", "ClothingLightOrange", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("FingerlessGloves", "ClothingDarkYellow", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Fedora", "ClothingLightBrown", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "CowboyA",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin2", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("UnbuttonedShirt", "ClothingLightYellow", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingLightBlue", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Belt", "ClothingDarkOrange", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("RidingBootsBlack", "ClothingDarkOrange", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("Scarf", "ClothingLightYellow", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Fedora2", "ClothingBrown", "ClothingLightGray", "")
					}
				}
			},
			
			new Group(){
				Name = "Henry Bates",
				SpawnCount = 1,
				SpawnDelay = 12000,
				Type = GroupType.KillAll,
				AI = PredefinedAIType.RangedA,
				
				MinimumWave = 5,
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 40
				},
				
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[]{ WeaponItem.BOW, WeaponItem.KNIFE, WeaponItem.MOLOTOVS },
					new WeaponItem[]{ WeaponItem.BOW, WeaponItem.WHIP, WeaponItem.SHURIKEN },
					new WeaponItem[]{ WeaponItem.SAWED_OFF, WeaponItem.FLAREGUN, WeaponItem.GRENADES },
					new WeaponItem[]{ WeaponItem.SAWED_OFF, WeaponItem.CHAIN, WeaponItem.SHURIKEN },
				},
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "Henry Bates",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin2", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("LumberjackShirt2", "ClothingDarkPink", "ClothingDarkPink", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingDarkBlue", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Belt", "ClothingDarkGray", "ClothingGray", ""),
						Feet = new IProfileClothingItem("RidingBoots", "ClothingDarkBrown", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("SantaMask", "ClothingLightGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("CowboyHat", "ClothingDarkBrown", "ClothingLightBrown", "")
					}				
				},
				
				SpawnDialogue = new List<string>(){
					"Yeehaw",
					"Round 'em up",
					"Get dat bounty",
				},
				
				DeathDialogue = new List<string>(){
					"Yeed mu' last haw",
					"This ain't Alabama unymore",
				},
				
				ShowNametag = true
			}
		},
		
		MinimumWave = 0
	},
	
	new Wave(){
		Name = "Zombie Nightmare",
		
		Groupings = new List<Group>(){
			
			new Group(){
				Name = "Zombie",
				SpawnCount = 10,
				SpawnDelay = 1000,
				Type = GroupType.KillAll,
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 10
				},
				AI = PredefinedAIType.ZombieA,
				
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "ZombieSoldier",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("TornShirt", "ClothingDarkYellow", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("CamoPants", "ClothingDarkYellow", "ClothingDarkYellow", ""),
						Waist = new IProfileClothingItem("AmmoBeltWaist", "ClothingBrown", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("Boots", "ClothingDarkRed", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Helmet", "ClothingDarkYellow", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "ZombiePolice",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("PoliceShirt", "ClothingDarkBlue", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingDarkBlue", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("Shoes", "ClothingDarkBrown", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("PoliceHat", "ClothingDarkBlue", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "ZombieThug",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("SleevelessShirt", "ClothingDarkBlue", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingDarkBlue", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("Boots", "ClothingDarkBrown", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("Vest", "ClothingLightBlue", "ClothingLightBlue", ""),
						Head = new IProfileClothingItem("Headband", "ClothingDarkRed", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "ZombieAgent",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("ShirtWithTie", "ClothingGray", "ClothingDarkGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingDarkGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingDarkBrown", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("SuitJacketBlack", "ClothingDarkGray", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("SunGlasses", "ClothingDarkGray", "ClothingLightGray", ""),
					},
					new IProfile() {
						Name = "Zombie",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("TornShirt", "ClothingDarkBlue", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("TornPants", "ClothingDarkBlue", "ClothingLightGray", ""),
					},
					new IProfile() {
						Name = "ZombieWorker",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("TornShirt", "ClothingOrange", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("TornPants", "ClothingOrange", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("SatchelBelt", "ClothingOrange", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingDarkBrown", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("Suspenders", "ClothingOrange", "ClothingLightOrange", ""),
						Head = new IProfileClothingItem("Cap", "ClothingYellow", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "ZombieNinja",
						Gender = Gender.Female,
						Skin = new IProfileClothingItem("Zombie_fem", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("TrainingShirt_fem", "ClothingDarkBlue", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants_fem", "ClothingDarkBlue", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Sash_fem", "ClothingDarkRed", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingDarkBlue", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("Mask", "ClothingDarkRed", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("FingerlessGlovesBlack", "ClothingDarkBlue", "ClothingLightGray", ""),
					}
				},
				ShowNametag = false,
			
			},
		
			new Group(){
				Name = "Zombie",
				SpawnDelay = 2000,
				Type = GroupType.Infinite,
				AI = PredefinedAIType.ZombieA,
				MinimumWave = 5,
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 5,
					SizeModifier = 0.75f
				},
				
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "ZombieSoldier",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("TornShirt", "ClothingDarkYellow", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("CamoPants", "ClothingDarkYellow", "ClothingDarkYellow", ""),
						Waist = new IProfileClothingItem("AmmoBeltWaist", "ClothingBrown", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("Boots", "ClothingDarkRed", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Helmet", "ClothingDarkYellow", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "ZombiePolice",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("PoliceShirt", "ClothingDarkBlue", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingDarkBlue", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("Shoes", "ClothingDarkBrown", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("PoliceHat", "ClothingDarkBlue", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "ZombieThug",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("SleevelessShirt", "ClothingDarkBlue", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingDarkBlue", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("Boots", "ClothingDarkBrown", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("Vest", "ClothingLightBlue", "ClothingLightBlue", ""),
						Head = new IProfileClothingItem("Headband", "ClothingDarkRed", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "ZombieAgent",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("ShirtWithTie", "ClothingGray", "ClothingDarkGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingDarkGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingDarkBrown", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("SuitJacketBlack", "ClothingDarkGray", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("SunGlasses", "ClothingDarkGray", "ClothingLightGray", ""),
					},
					new IProfile() {
						Name = "Zombie",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("TornShirt", "ClothingDarkBlue", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("TornPants", "ClothingDarkBlue", "ClothingLightGray", ""),
					},
					new IProfile() {
						Name = "ZombieWorker",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("TornShirt", "ClothingOrange", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("TornPants", "ClothingOrange", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("SatchelBelt", "ClothingOrange", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingDarkBrown", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("Suspenders", "ClothingOrange", "ClothingLightOrange", ""),
						Head = new IProfileClothingItem("Cap", "ClothingYellow", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "ZombieNinja",
						Gender = Gender.Female,
						Skin = new IProfileClothingItem("Zombie_fem", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("TrainingShirt_fem", "ClothingDarkBlue", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants_fem", "ClothingDarkBlue", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Sash_fem", "ClothingDarkRed", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingDarkBlue", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("Mask", "ClothingDarkRed", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("FingerlessGlovesBlack", "ClothingDarkBlue", "ClothingLightGray", ""),
					}
				},
				ShowNametag = false,
			
			},		
		
			new Group(){
				Name = "Johnson",
				MinimumWave = 5,
				SpawnCount = 1,
				AI = PredefinedAIType.ZombieB,
				Type = GroupType.KillAll,
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 60,
					CurrentHealth = 150,
					SizeModifier = 1.5f,
					MeleeForceModifier = 1.5f
				},
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "Johnson",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Zombie", "Skin1", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("ShirtWithTie", "ClothingLightGray", "ClothingBrown", ""),
						Legs = new IProfileClothingItem("TornPants", "ClothingDarkGray", "ClothingLightGray", ""),
						ChestOver = new IProfileClothingItem("Vest", "ClothingDarkBrown", "ClothingBrown", ""),
					}
				},
				
				ShowNametag = true,
				
				SpawnDialogue = new List<string>(){
					"Brains",
					"Give the lemons",
					"They just won't learn",
					""
				}
			}
		},
	
		MinimumWave = 0
	},
	
	new Wave(){
		Name = "German Ambush",
		
		Groupings = new List<Group>(){
			
			new Group(){
				Name = "Soldier",
				SpawnCount = 16,
				SpawnDelay = 3000,
				Type = GroupType.KillAll,
				AI = PredefinedAIType.Punk,
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 10
				},
				
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[]{ WeaponItem.KNIFE, WeaponItem.MP50, WeaponItem.GRENADES },
					new WeaponItem[]{ WeaponItem.KNIFE, WeaponItem.PISTOL, WeaponItem.MOLOTOVS },
					new WeaponItem[]{ WeaponItem.FLAMETHROWER, WeaponItem.C4 }
				},		

				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin4", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("MilitaryShirt", "ClothingLightBrown", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingLightBrown", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Belt", "ClothingGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("BootsBlack", "ClothingBlue", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("Armband", "ClothingRed", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("GermanHelmet", "ClothingGray", "ClothingLightGray", "")
					},
					new IProfile() {
						Name = "",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin4", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("MilitaryShirt", "ClothingLightBrown", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingLightBrown", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Belt", "ClothingGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("BootsBlack", "ClothingBlue", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("Armband", "ClothingRed", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("Cap", "ClothingBrown", "ClothingLightGray", "")
					}					
				}
			},
			
			new Group(){
				Name = "Scientist",
				SpawnCount = 1,
				SpawnDelay = 10000,
				Type = GroupType.WaitTillSpawned,
				AI = PredefinedAIType.RangedA,
				
				MinimumWave = 5,
				
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[]{ WeaponItem.MACHINE_PISTOL },
					new WeaponItem[]{ WeaponItem.SILENCEDPISTOL }
				},
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 10
				},
				
				SpawnDialogue = new List<string>(){
					"Rise my precious",
					"German science is the greatest",
					"Mwahahahaha",
					"I do not pity you now",
					"We shall not lose once more"
				},
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin4", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("LeatherJacket", "ClothingLightGray", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("PantsBlack", "ClothingGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("BootsBlack", "ClothingBlue", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("Armband", "ClothingRed", "ClothingLightGray", ""),
						Hands = new IProfileClothingItem("SafetyGlovesBlack", "ClothingBlue", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("FLDisguise", "ClothingLightGray", "ClothingLightGray", "")
					}				
				},
				
				ShowNametag = true
			},
			
			new Group(){
				Name = "Kriegbär",
				SpawnCount = 1,
				SpawnDelay = 0,
				Type = GroupType.KillAll,
				AI = PredefinedAIType.ZombieB,
				
				MinimumWave = 5,
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 75,
					CurrentHealth = 75,
					SizeModifier = 1.5f,
					MeleeForceModifier = 1.5f,
					MeleeDamageTakenModifier = 0.75f
				},
				
				SpawnDialogue = new List<string>(){
					"RAWR",
					"ARGH",
					"GRRR",
					"HURR"
				},
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Name = "Kriegbär",
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("FrankenbearSkin", "ClothingDarkGray", "ClothingLightBlue", ""),
					}			
				},
				
				ShowNametag = true
			}
		},
		
		MinimumWave = 0
	},
	
	new Wave(){
		Name = "Oh Shit Ninjas!",
		
		Groupings = new List<Group>(){
			
			new Group(){
				Name = "Ninja",
				SpawnCount = 8,
				SpawnDelay = 3000,
				AI = PredefinedAIType.MeleeA,
				Type = GroupType.KillAll,
				
				Weapons = new List<WeaponItem[]>(){
					new WeaponItem[]{ WeaponItem.KATANA }
				},
				
				Modifiers = new PlayerModifiers(){
					MaxHealth = 15,
					RunSpeedModifier = 1.5f,
					SprintSpeedModifier = 1.5f
				},
				
				Profiles = new List<IProfile>(){
					new IProfile() {
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin3", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("TrainingShirt", "ClothingDarkGray", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingDarkGray", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Sash", "ClothingDarkRed", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingBrown", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("Balaclava", "ClothingDarkGray", "ClothingLightGray", ""),
					},
					new IProfile() {
						Gender = Gender.Male,
						Skin = new IProfileClothingItem("Normal", "Skin3", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("TrainingShirt", "ClothingLightGray", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants", "ClothingLightGray", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Sash", "ClothingDarkGray", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingBrown", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("Balaclava", "ClothingLightGray", "ClothingLightGray", ""),
					},
					new IProfile() {
						Gender = Gender.Female,
						Skin = new IProfileClothingItem("Normal_fem", "Skin4", "ClothingLightGray", ""),
						ChestUnder = new IProfileClothingItem("TrainingShirt_fem", "ClothingDarkGray", "ClothingLightGray", ""),
						Legs = new IProfileClothingItem("Pants_fem", "ClothingDarkGray", "ClothingLightGray", ""),
						Waist = new IProfileClothingItem("Sash_fem", "ClothingDarkRed", "ClothingLightGray", ""),
						Feet = new IProfileClothingItem("ShoesBlack", "ClothingBrown", "ClothingLightGray", ""),
						Accessory = new IProfileClothingItem("Balaclava", "ClothingDarkGray", "ClothingLightGray", ""),
						Head = new IProfileClothingItem("AviatorHat2_fem", "ClothingDarkGray", "ClothingLightGray", "")
					}
				}
			}
		},
		
		MinimumWave = 0
	}
};

public static void OnStartup(){

	/*
		Set Teams
	*/
	foreach(IPlayer ply in Game.GetPlayers()){
		ply.SetTeam(PlayerTeam.Team1);
	}

	/*
		Init Events
	*/
	e_PlayerDeath = Events.PlayerDeathCallback.Start(OnPlayerDeath);
	e_ObjectCreated = Events.ObjectCreatedCallback.Start(OnObjectCreated);

	/*
		Seed by map name to get same results
	*/
	int Seed = 0;
	for(int i = 0;i < Game.MapName.Length;i ++){
		Seed += (int)Game.MapName[i];
	}
	rnd = new Random(Seed);
	
	/*
		Configure game to survival
	*/
	Game.AutoVictoryConditionEnabled = false;
	Game.AutoScoreConditionEnabled = false;
	
	Wave.Init();
}

public void OnShutdown(){
	
	if(e_PlayerDeath != null)
		e_PlayerDeath.Stop();	
	
	if(e_ObjectCreated != null)
		e_ObjectCreated.Stop();
}

public enum GroupType{
	Infinite,
	KillAll,
	WaitTillSpawned,
	Proceed
}

public class Group{
	
	/*
		Spawning Player Information
	*/
	public string Name = "";
	public int SpawnCount = 0;
	public int SpawnDelay = 0;
	public List<WeaponItem[]> Weapons = null;
	public PlayerModifiers Modifiers = null;
	public PredefinedAIType AI = PredefinedAIType.BotA;
	public List<string> SpawnDialogue = null;
	public List<string> DeathDialogue = null;
	public int MinimumWave = 0;
	public int MaximumWave = 0;
	
	/*
		Spawning Handling Type
	*/
	public GroupType Type = GroupType.WaitTillSpawned;
	
	/*
		Appearance
	*/
	public List<IProfile> Profiles = null;
	public PlayerHitEffect HitEffect = PlayerHitEffect.Default;
	public bool ShowNametag = false;
	
	/*
	public Group(string _name, int _count, int _delay, GroupType _type, List<WeaponItem[]> _wpns, PlayerModifiers _mods, PredefinedAIType _ai, List<IProfile> _prof, bool _tag){
		Name = _name;
		SpawnCount = _count;
		SpawnDelay = _delay;
		Type = _type;
		Weapons = _wpns;
		Modifiers = _mods;
		AIType = _ai;
		Profiles = _prof;
		NameTag = _tag;
	}
	*/
};

public class Wave{
	
	/*
		Wave Information
	*/
	public string Name = "";
	public List<Group> Groupings = null;	
	public int MinimumWave = 0;
	public int MaximumWave = 0;
	
	/*
	public Wave(string _name, List<Group> _groupings, int _minWave){
		Name = _name;
		Groupings = _groupings;
		MinWave = _minWave;
	}
	*/
	
	/*
		Static Members
	*/
	public static Wave Current = null;
	
	public static int WaveDelay = 5000;
	
	public static int WaveNumber = 0;
	public static int GroupIndex = 0;
	
	public static List<int> GlobalBotIDs = new List<int>();
	public static int GlobalBotsKilled = 0;
	
	public static bool WaitForBotDeaths = false;
	public static List<int> BotIDs = new List<int>();
	public static int BotsKilled = 0;
	
	public static List<int> Spawners = new List<int>();
	
	public static int Scale = 1;
	
	public static void Init(){		
		//Globally tracked bots
		GlobalBotsKilled = 0;
		GlobalBotIDs.Clear();
		WaitForBotDeaths = false;
	
		WaveNumber ++;
		
		Scale = ((int)Math.Ceiling((GetPlayersStillAlive() / 2.0f) * (1 + (WaveNumber / 10))));
		
		//Reset Trackers
		Spawners.Clear();
		GroupIndex = 0;
		
		//Get Wave
		Current = GetApplicableWave();
		
		//Init Delay
		CreateTimer(WaveDelay, 1, "WaveProceed", "");
		
		Game.ShowPopupMessage("Wave " + WaveNumber + "\n" + "\"" + Current.Name + "\"");
	}
	
	public static void Next(){

		//Completed All Group Spawns
		if(GroupIndex < Current.Groupings.Count){			
			Group gp = Current.Groupings[GroupIndex];			
			bool GoOn = false;

			//Meet Wave Requirements
			if((WaveNumber < gp.MinimumWave && gp.MinimumWave != 0) || (WaveNumber > gp.MaximumWave && gp.MaximumWave != 0)){
				GroupIndex ++;
				Next();
				return;
			}
			int botCount = (!gp.ShowNametag) ? gp.SpawnCount * Scale : gp.SpawnCount;

			//Add Globally Tracked Bots Needed
			if(gp.Type != GroupType.Infinite)
				GlobalBotsKilled += botCount;

			//Handle Groupings
			switch(gp.Type){
				
				//Spawn till end of wave
				case GroupType.Infinite:
					CreateTimer(gp.SpawnDelay / Scale, 0, "SpawnBot", GroupIndex + "|INFINITE");
					GoOn = true;
				break;
				
				//Eliminate all bots
				case GroupType.KillAll:
					BotIDs.Clear();
					BotsKilled = botCount;
					CreateTimer(gp.SpawnDelay / Scale, botCount, "SpawnBot", GroupIndex + "|KILLALL");
				break;
				
				//Spawn all then proceed
				case GroupType.WaitTillSpawned:
					CreateTimer(gp.SpawnDelay / Scale, botCount, "SpawnBot", GroupIndex + "|NONE");
					CreateTimer(gp.SpawnDelay / Scale * botCount + 100, 1, "WaveProceed", "");
				break;
				
				//Imediately go to next step
				case GroupType.Proceed:
					CreateTimer(gp.SpawnDelay / Scale, botCount, "SpawnBot", GroupIndex + "|NONE");
					GoOn = true;
				break;
			}			
			GroupIndex ++;
			
			if(GoOn)
				Next();
			
		}else if(GlobalBotsKilled == 0){
			//Prepare for next wave
			End();
		}else{
			Game.ShowPopupMessage("Wave " + WaveNumber + "\nEliminate Remaining Enemies!");
			RemoveSpawners("INFINITE");
			WaitForBotDeaths = true;
		}
	}
	
	public static void End(){		
		//Stop Infinite Spawners
		Wave.RemoveSpawners();
		
		//Wait specified buffer time
		CreateTimer(WaveDelay * 2, 1, "WaveEnd", "");
		CreateTimer(WaveDelay, 1, "HealPlayers", "");
		
		Game.ShowPopupMessage("Wave " + WaveNumber + " Complete!\n" + "Prepare For Incoming Wave");
	}
	
	public static void Lose(){
		
		Wave.RemoveSpawners();
		
		//Reset Trackers
		BotIDs.Clear();
		BotsKilled = 0;
		GroupIndex = 0;
		
		Game.SetGameOver("You Bastards Lose :(\n" + "Survived " + WaveNumber + " Waves");
		
		if(e_PlayerDeath != null){
			e_PlayerDeath.Stop();
			e_PlayerDeath = null;
		}
		
		Game.HidePopupMessage();
	}
	
	public static void RemoveSpawners(string look = ""){
		
		foreach(int id in Spawners){
			IObject obj = Game.GetObject(id);
			
			if(obj != null && (obj.CustomID.Contains(look) || look == ""))
				obj.Remove();
		}
	}
	
	private static Wave GetApplicableWave() {

		//Resort Array
		Wave[] Applicable = Waves.Where(x => (x.MinimumWave <= WaveNumber || x.MinimumWave == 0) && (x.MaximumWave >= WaveNumber || x.MaximumWave == 0)).ToArray();
		
		int index = rnd.Next(0, Applicable.Length);
		
		if(Applicable[index] == Current){
			index ++;
			
			if(index >= Applicable.Length)
				index = 0;
		}
		
		//Set Wave
		return Applicable[index];
	}
};

public static void WaveProceed(TriggerArgs args){

	if(args.Caller is IObject){
		Wave.Next();
		(args.Caller as IObject).Remove();
	}
}

public static void WaveEnd(TriggerArgs args){

	if(args.Caller is IObject){
		Wave.Init();
		(args.Caller as IObject).Remove();
	}
}

public static void SpawnBot(TriggerArgs args){
	
	if(args.Caller is IObject){
		string cID = (args.Caller as IObject).CustomID;	
		
		//Group Member
		Group gp = Wave.Current.Groupings[Int32.Parse(cID.Split('|')[0])];
		
		//Track spawner for removal later
		Wave.Spawners.Add((args.Caller as IObject).UniqueID);
		
		//Spawn Player
		IObject Spawn = GetBotSpawn();
		
		IPlayer ply = Game.CreatePlayer( (Spawn != null) ? Spawn.GetWorldPosition() : new Vector2(0, 0) );
		ply.SetBotName(gp.Name);
		ply.SetTeam(PlayerTeam.Team2);
		ply.SetNametagVisible(gp.ShowNametag);
		ply.SetStatusBarsVisible(false);
		ply.SetHitEffect(gp.HitEffect);
		ply.SetBotBehavior(new BotBehavior(true, gp.AI));
		
		if(gp.Profiles != null)
			ply.SetProfile(gp.Profiles[rnd.Next(0, gp.Profiles.Count)]);
		
		if(gp.Modifiers != null){
			ply.SetModifiers(gp.Modifiers);
			PlayerModifiers mods = ply.GetModifiers();
			
			/*Apply modifiers to elite enemies*/
			if(gp.ShowNametag){
				mods.CurrentHealth *= Wave.Scale;
				mods.MaxHealth *= Wave.Scale;
			}
			
			ply.SetModifiers(mods);
		}
		
		if(gp.Weapons != null){
			WeaponItem[] Loadout = gp.Weapons[rnd.Next(0, gp.Weapons.Count)];
		
			foreach(WeaponItem wpn in Loadout){
				ply.GiveWeaponItem(wpn);
			}
		}
		
		if(gp.SpawnDialogue != null){
			int diag = rnd.Next(0, gp.SpawnDialogue.Count);
			
			if(gp.SpawnDialogue[diag] != "")
				Game.CreateDialogue(gp.SpawnDialogue[diag], ply, ply.Name, -1, false);
		}
		
		if(gp.DeathDialogue != null)
			ply.CustomID = gp.DeathDialogue[rnd.Next(0, gp.DeathDialogue.Count)];
	
		BotBehaviorSet behav = ply.GetBotBehaviorSet();
		behav.SearchForItems = false;
		behav.TeamLineUp = true;
		ply.SetBotBehaviorSet(behav);
		
		//Secondary Spawning Arguments
		switch(cID.Split('|')[1]){
			
			case "KILLALL":
				Wave.BotIDs.Add(ply.UniqueID);
			break;
			
			case "INFINITE":
				Wave.GlobalBotsKilled ++;
			break;
		}
		
		//Track Globally
		Wave.GlobalBotIDs.Add(ply.UniqueID);
	}
}

public static void OnObjectCreated(IObject[] objects){
	
	foreach(IObject obj in objects){
		
		if(obj.Name.Contains("Giblet"))
			CreateTimer(5000, 1, "DestroyObject", obj.UniqueID.ToString());
	}
}

public static void OnPlayerDeath(IPlayer ply, PlayerDeathArgs args){
	
	//Check if any bots need to be checked
	if(Wave.BotIDs.Count > 0){
		
		if(Wave.BotIDs.Contains(ply.UniqueID)){
			//Remove from list and track remaining
			Wave.BotIDs.Remove(ply.UniqueID);
			Wave.BotsKilled --;
			
			//Eliminated all bots
			if(Wave.BotsKilled <= 0)
				Wave.Next();
		}
	}
	
	//Watch For Globally Spawned Bots
	if(Wave.GlobalBotIDs.Count > 0){
		
		if(Wave.GlobalBotIDs.Contains(ply.UniqueID)){
			//Remove from list and track remaining
			Wave.GlobalBotIDs.Remove(ply.UniqueID);
			Wave.GlobalBotsKilled --;
			
			if(!args.Removed && ply.CustomID != "")
				Game.CreateDialogue(ply.CustomID, ply, ply.Name, -1, false);

			//Eliminated all bots
			if(Wave.GlobalBotsKilled == 0 && Wave.WaitForBotDeaths)
				Wave.End();
		}		
	}
	
	if(!args.Removed)
		CreateTimer(5000, 1, "DestroyObject", ply.UniqueID.ToString());
	
	//Check team 1 still alive
	bool DeadTeam = true;
	foreach(IPlayer tar in Game.GetPlayers()){
		
		if(!tar.IsDead && tar.GetTeam() == PlayerTeam.Team1){
			DeadTeam = false;
			break;
		}
	}
	
	if(DeadTeam)
		Wave.Lose();
}

public static void DestroyObject(TriggerArgs args){
	
	if(args.Caller is IObject){
		string cID = (args.Caller as IObject).CustomID;
		
		IObject obj = Game.GetObject(Int32.Parse(cID));
		
		if(obj != null)
			obj.Destroy();
		
		(args.Caller as IObject).Remove();
	}
}

public static void HealPlayers(TriggerArgs args){
	
	if(args.Caller is IObject){

		//Give Each Player Some Extra Health
		foreach(IPlayer ply in Game.GetPlayers()){
			
			if(ply.GetTeam() == PlayerTeam.Team1 && !ply.IsDead){
				ply.GiveWeaponItem(WeaponItem.PILLS);
			}
		}
		RespawnDeadPlayers();

		(args.Caller as IObject).Remove();
	}
}

/*
	Helper Functions
*/
public static void CreateTimer(int interval, int count, string method, string id) {
    IObjectTimerTrigger timerTrigger = (IObjectTimerTrigger)Game.CreateObject("TimerTrigger"); 
    timerTrigger.SetIntervalTime(interval);
    timerTrigger.SetRepeatCount(count);
    timerTrigger.SetScriptMethod(method);
    timerTrigger.CustomId = id;
    timerTrigger.Trigger();
}

public static RayCastInput ray_Solids = new RayCastInput() {
	BlockExplosions = RayCastFilterMode.Any,
	BlockFire = RayCastFilterMode.Any,
	BlockMelee = RayCastFilterMode.True,
	ClosestHitOnly = false,
	FilterOnMaskBits = false,
	IncludeOverlap = false,
	ProjectileHit = RayCastFilterMode.Any
};

public static IObject GetBotSpawn(){
	IObject ret = null;
	float dist  = -1;
	
	foreach(IObject obj in Game.GetObjectsByName("SpawnPlayer")){
		float mydist = -1;
		
		//Check For Solid Positions Under Spawn
		bool IsOnGround = false;
		for(int i = -1;i <= 1;i ++) {
			RayCastResult[] res_Ground = Game.RayCast(obj.GetWorldPosition() + new Vector2(5 * i, 0), obj.GetWorldPosition() + new Vector2(5 * i, -16), ray_Solids);
			
			foreach(RayCastResult res in res_Ground) {

				if(res.Hit && !res.IsPlayer) {
					IsOnGround = true;
					break;
				}
			}
		}
		
		if(IsOnGround){
			
			//Find Distance and compare
			foreach(IPlayer ply in Game.GetPlayers()){
				
				if(!ply.IsDead){
					float plydist = Vector2.Distance(obj.GetWorldPosition(),  ply.GetWorldPosition());
							
					if(mydist == -1 || mydist > plydist){
						mydist = plydist;
					}
				}
			}
		}
		
		//Farther from players asign object
		if(dist == -1 || (dist < mydist && mydist != -1)){
			ret = obj;
			dist = mydist;
		}
	}
	
	return ret;
}

public static int GetPlayersStillAlive(){
	return Game.GetPlayers().Where(x => !x.IsDead && x.GetTeam() == PlayerTeam.Team1).ToArray().Length;
}

public static void RespawnDeadPlayers(){
	
	foreach(IUser user in Game.GetActiveUsers()){
		
		//Removed Player Or Dead Player
		if(user.GetPlayer() == null || user.GetPlayer().IsDead){

			IObject spawn = GetBotSpawn();
			
			IPlayer ply = Game.CreatePlayer(spawn.GetWorldPosition());
			
			ply.SetProfile(user.GetProfile());
			ply.SetTeam(PlayerTeam.Team1);
			ply.SetHealth(25f);			
			
			user.SetPlayer(ply);		

			if(user.IsBot)
				ply.SetBotBehavior(new BotBehavior(true, user.BotPredefinedAIType));
		}
	}
}