/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\Items\Weapons\SlayerGroup.cs
Lines of code: 176
***********************************************************/


using System;
using Server;
using Server.Mobiles;

namespace Server.Items
{
	public class SlayerGroup
	{
		private static SlayerEntry[] m_TotalEntries;
		private static SlayerGroup[] m_Groups;

		public static SlayerEntry[] TotalEntries
		{
			get{ return m_TotalEntries; }
		}

		public static SlayerGroup[] Groups
		{
			get{ return m_Groups; }
		}

		public static SlayerEntry GetEntryByName( SlayerName name )
		{
			int v = (int)name;

			if ( v >= 0 && v < m_TotalEntries.Length )
				return m_TotalEntries[v];

			return null;
		}

		public static SlayerName GetLootSlayerType( Type type )
		{
			for ( int i = 0; i < m_Groups.Length; ++i )
			{
				SlayerGroup group = m_Groups[i];
				Type[] foundOn = group.FoundOn;

				bool inGroup = false;

				for ( int j = 0; foundOn != null && !inGroup && j < foundOn.Length; ++j )
					inGroup = ( foundOn[j] == type );

				if ( inGroup )
				{
					int index = Utility.Random( 1 + group.Entries.Length );

					if ( index == 0 )
						return group.m_Super.Name;

					return group.Entries[index - 1].Name;
				}
			}

			return SlayerName.Silver;
		}

		static SlayerGroup()
		{
			SlayerGroup humanoid = new SlayerGroup();
			SlayerGroup undead = new SlayerGroup();
			SlayerGroup elemental = new SlayerGroup();
			SlayerGroup abyss = new SlayerGroup();
			SlayerGroup arachnid = new SlayerGroup();
			SlayerGroup reptilian = new SlayerGroup();
			SlayerGroup fey = new SlayerGroup();			
			SlayerGroup mlslayers = new SlayerGroup();


			
					
		//HUMANOID/REPOND
		
		//note: edit spells/spellweaving/dryadallure list as needed, if adding here
			
			humanoid.Opposition = new SlayerGroup[]{ undead };
			humanoid.FoundOn = new Type[]{ typeof( BoneKnight ), typeof( Lich ), typeof( LichLord ) };
			
			//REPOND (SUPER)
			humanoid.Super = new SlayerEntry( SlayerName.Repond, typeof(Almincrus), typeof(apprenticejedi), typeof( ArcticOgreLord ), typeof(Berserker), typeof(BlackOrderAssasin),typeof(BlackOrderGrandMage), typeof(BlackOrderHighExecutioner), typeof(BlackOrderMage), typeof(BlackOrderMaster), typeof(BlackOrderThief), typeof(Chiikkaha), typeof( Cyclops ), typeof(darkjediknight), typeof(deathbladesummoner), typeof(EliteNinja), typeof( Ettin ), typeof( EvilMage ), typeof( EvilMageLord ), typeof( FrostTroll ), typeof(jediknight), typeof(Lurg), typeof( MeerCaptain ), typeof( MeerEternal ), typeof( MeerMage ), typeof( MeerWarrior ), typeof(Minotaur), typeof(MougGuur), typeof( OggraOrcBrute ), typeof( OggraOrcChopper ), typeof( OggraOrcishLord ), typeof( OggraTheBruiser ), typeof( Orc ), typeof( OrcBomber ), typeof( OrcBrute ), typeof( OrcCaptain ), typeof( OrcChopper ), typeof( OrcishLord ), typeof( OrcishMage ), typeof( OrcScout ), typeof( Ogre ), typeof( OgreLord ), typeof( Ratman ), typeof( RatmanArcher ), typeof( RatmanMage ), typeof(Ronin), typeof( Savage ), typeof( SavageRider ), typeof( SavageShaman ), typeof(sithlord), typeof( SpawnedOrcishLord ), typeof(stormtrooper), typeof( Titan ), typeof(Troglodyte), typeof( Troll ));
			humanoid.Entries = new SlayerEntry[]
			{
			  //OGRE SLAYER
				new SlayerEntry( SlayerName.OgreTrashing, typeof( ArcticOgreLord ), typeof( Ogre ), typeof( OgreLord )),
				
				//ORC SLAYER
				new SlayerEntry( SlayerName.OrcSlaying, typeof( OggraOrcBrute ), typeof( OggraOrcChopper ), typeof( OggraOrcishLord ), typeof( OggraTheBruiser ), typeof( Orc ), typeof( OrcBomber ), typeof( OrcBrute ), typeof( OrcCaptain ),typeof( OrcChopper ), typeof( OrcishLord ), typeof( OrcishMage ), typeof( OrcScout ), typeof( SpawnedOrcishLord )),
				
				//TROLL SLAYER
				new SlayerEntry( SlayerName.TrollSlaughter, typeof( FrostTroll ), typeof( Troll ))
			};
			 
			//UNDEAD (SUPER)

			undead.Opposition = new SlayerGroup[]{ humanoid };
			undead.Super = new SlayerEntry( SlayerName.Silver, typeof( Almincrus ), typeof( AncientLich ), typeof( Bogle ), typeof( BoneKnight ), typeof( BoneMagi ), typeof( ChaosSteed ), /* typeof( DarkGuardian ), */ typeof( DarknightCreeper ), typeof( FleshGolem ), typeof( Ghoul ), typeof( GoreFiend ), typeof( HellSteed ), typeof(Ilhenir), typeof(InterredGrizzle),typeof(LadyJennifyr), typeof(LadyMarai), typeof( LadyOfTheSnow ), typeof( Lich ), typeof( LichLord ), typeof(MasterJonath), typeof(MasterMikael), typeof(MasterTheophilus), typeof(MonstrousInterredGrizzle), typeof( Mummy ), typeof(naturalrevenant), typeof(Noxequus), typeof(RedDeath), typeof( Revenant ), typeof( RevenantLion ), typeof( RottingCorpse ), typeof(SeaHag), typeof( Shade ), typeof( ShadowKnight ), typeof(SirPatrick), typeof( SkeletalDragon ), typeof( SkeletalKnight ), typeof( SkeletalMage ), typeof( SkeletalMount ), typeof( Skeleton ), typeof(SpectralArmour), typeof( Spectre ), typeof(Vampire), typeof( Wraith ), typeof(Wight), typeof( Zombie ));
			undead.Entries = new SlayerEntry[0];

			//FEY (SUPER)
			
			fey.Opposition = new SlayerGroup[]{ abyss };
			fey.Super = new SlayerEntry( SlayerName.Fey, typeof( BlackUnicorn ), typeof( Centaur ), typeof(Changeling),typeof( CorporealBrume ), typeof(CrystalLatticeSeeker), typeof(CrystalWisp), typeof(CuSidhe), typeof(DreadHorn), typeof(Dryad), typeof( EnslavedSatyr ), typeof( EtherealWarrior ), typeof(Fairy), typeof( FeralTreefellow ), typeof( FetidEssence ), typeof(Guile), typeof(holysquirrel), typeof( InsaneDryad ), typeof(Irk), typeof( Kirin ), typeof( LadyMelisande ), typeof( LordOaks ), typeof(Malkilus), typeof( MantraEffervescence ), typeof( Pixie ), typeof(SaintHorse), typeof(Satyr), typeof( ShimmeringEffusion ),typeof( Silvani ), typeof(Spite), typeof(Travesty), typeof( Treefellow ), typeof(Twaulo), typeof( Unicorn ), typeof( Wisp ),typeof(cupid));
			fey.Entries = new SlayerEntry[0];

			
			//ELEMENTAL (SUPER)
			
			elemental.Opposition = new SlayerGroup[]{ abyss };
			elemental.FoundOn = new Type[]{ typeof( Balron ), typeof( Daemon ) };
			elemental.Super = new SlayerEntry( SlayerName.ElementalBan, typeof( AgapiteElemental ), typeof( AirElemental ), typeof( SummonedAirElemental ), typeof( BloodElemental ), typeof( BronzeElemental ), typeof( CopperElemental ), typeof( CrystalElemental ), typeof( DullCopperElemental ), typeof( EarthElemental ), typeof( SummonedEarthElemental ), typeof( Efreet ), typeof( FireElemental ), typeof( SummonedFireElemental ), typeof( GoldenElemental ), typeof( IceElemental ), typeof( KazeKemono ), typeof( PoisonElemental ), typeof( ToxicElemental ), typeof( RaiJu ), typeof( SandVortex ), typeof( ShadowIronElemental ), typeof( SnowElemental ), typeof( ValoriteElemental ), typeof( VeriteElemental ), typeof( WaterElemental ), typeof( SummonedWaterElemental ),typeof(Paracelsus),typeof(Humus),typeof(ElementalLord),typeof( Flurry ), typeof( Mistal ), typeof( Tempest ) );
			elemental.Entries = new SlayerEntry[]
			{
        
			//BLOOD ELEMENTAL SLAYER
				new SlayerEntry( SlayerName.BloodDrinking, typeof( BloodElemental ) ),
				
				//EARTH ELEMENTAL SLAYER
				new SlayerEntry( SlayerName.EarthShatter, typeof( AgapiteElemental ), typeof( BronzeElemental ), typeof( CopperElemental ), typeof( DullCopperElemental ), typeof( EarthElemental ), typeof( GoldenElemental ), typeof( ShadowIronElemental ), typeof( SummonedEarthElemental ), typeof( ValoriteElemental ), typeof( VeriteElemental ) ),
				
				//POISON ELEMENTAL SLAYER
				new SlayerEntry( SlayerName.ElementalHealth, typeof( PoisonElemental ) ),
				
				//FIRE ELEMENTAL SLAYER
				new SlayerEntry( SlayerName.FlameDousing, typeof( FireElemental ), typeof( SummonedFireElemental ) ),
				
				//SNOW ELEMENTAL SLAYER
				new SlayerEntry( SlayerName.SummerWind, typeof( IceElemental ), typeof( SnowElemental )),
				
				//AIR ELEMENTAL SLAYER
				new SlayerEntry( SlayerName.Vacuum, typeof( AirElemental ), typeof( Flurry ), typeof( Mistal ), typeof( SummonedAirElemental ), typeof( Tempest ) ),
				
				//WATER ELEMENTAL SLAYER
				new SlayerEntry( SlayerName.WaterDissipation, typeof(AntiJormundgandWhirlwind), typeof(Charybdis), typeof(CharybdisWaterVortex), typeof(EnchantedBubble), typeof(FiendEnchantedBubble), typeof(JormundgandWhirlwind), typeof( SummonedWaterElemental), typeof( ToxicElemental ), typeof( WaterElemental ), typeof(WaterFiend), typeof(WaterVortex))
			};

			abyss.Opposition = new SlayerGroup[]{ elemental, fey };
			abyss.FoundOn = new Type[]{ typeof( BloodElemental ) };


			//DEMON (SUPER)
			
				abyss.Super = new SlayerEntry( SlayerName.Exorcism, typeof( AbysmalHorror ), typeof( ArcaneDaemon ), typeof( Balron ), typeof( BloodBeast ), typeof( BoneDemon ), typeof( ChaosDaemon ), typeof( ChaosSteed ), typeof(ChiefParoxysmus), typeof(CrystalDaemon), typeof( Daemon ), typeof( DemonKnight ), typeof( Devourer ), typeof(dreadsquirrel), typeof(ElementalLord), typeof( EnslavedGargoyle ), typeof( FanDancer ), typeof( FireGargoyle ), typeof( Gargoyle ), typeof( GargoyleDestroyer ), typeof( GargoyleEnforcer ), typeof( Gibberling ), typeof( HordeMinion ), typeof(IceDevil), typeof( IceFiend ), typeof( Imp ), typeof( Impaler ), typeof(Kappa), typeof( Moloch ), typeof(Oni), typeof(Putrefier), typeof( Ravager ), typeof(Semidar), typeof(ShadowFiend), typeof( StoneGargoyle ), typeof(Succubus), typeof(SummonedBalron), typeof( SummonedDaemon ), typeof(SummonedDemonKnight), typeof(Szavetra), typeof(TsukiWolf));

				abyss.Entries = new SlayerEntry[]
				{
				
				//GARGOYLE SLAYER
					new SlayerEntry( SlayerName.GargoylesFoe, typeof( EnslavedGargoyle ), typeof( FireGargoyle ), typeof( Gargoyle ), typeof( GargoyleDestroyer ), typeof( GargoyleEnforcer ), typeof( StoneGargoyle )),
					
				//BALRON SLAYER
					new SlayerEntry( SlayerName.BalronDamnation, typeof( Balron ) ,typeof(SummonedBalron),typeof(Putrefier))
				};
			//}
			
			//ARACHNID (SUPER)

			arachnid.Opposition = new SlayerGroup[]{ reptilian };
			arachnid.FoundOn = new Type[]{ typeof( AncientWyrm ), typeof( Dragon ), typeof( OphidianMatriarch ), typeof( ShadowWyrm ) };
			arachnid.Super = new SlayerEntry( SlayerName.ArachnidDoom, typeof( DreadSpider ), typeof( FrostSpider ), typeof( GiantBlackWidow ), typeof( GiantSpider ), typeof(LadyLissith), typeof(LadySabrix), typeof(Malefic), typeof( Mephitis ), typeof(Miasma), typeof(Seanid),typeof( Scorpion ), typeof(Silk), typeof( TerathanAvenger ), typeof( TerathanDrone ), typeof( TerathanMatriarch ), typeof( TerathanWarrior ), typeof(Virulent),typeof(FleshRenderer));
			arachnid.Entries = new SlayerEntry[]
			{
			
        //SCORPION SLAYER
				new SlayerEntry( SlayerName.ScorpionsBane, typeof( Scorpion ), typeof(Miasma) ),
				
				//SPIDER SLAYER
				new SlayerEntry( SlayerName.SpidersDeath, typeof( DreadSpider ), typeof( FrostSpider ), typeof( GiantBlackWidow ), typeof( GiantSpider ), typeof(LadyLissith),typeof(LadySabrix), typeof(Malefic), typeof( Mephitis ), typeof(Seanid), typeof(Silk), typeof(Virulent),typeof(FleshRenderer)),
				
				//TERATHAN SLAYER
				new SlayerEntry( SlayerName.Terathan, typeof( TerathanAvenger ), typeof( TerathanDrone ), typeof( TerathanMatriarch ), typeof( TerathanWarrior ) )
			};

			reptilian.Opposition = new SlayerGroup[]{ arachnid };
			reptilian.FoundOn = new Type[]{ typeof( TerathanAvenger ), typeof( TerathanMatriarch ) };
			
			//REPTILE (SUPER)
			
			reptilian.Super = new SlayerEntry( SlayerName.ReptilianDeath, typeof( AncientWyrm ), typeof(coil), typeof(CrystalDragon), typeof( DeepSeaSerpent ), typeof( Dragon ), typeof( Drake ), typeof( GiantIceWorm ),typeof( GiantSerpent ), typeof(Grim), typeof( Hiryu ), typeof(humusminion), typeof( IceSerpent ), typeof( IceSnake ), typeof(Jormundgand), typeof( JukaLord ), typeof( JukaMage ), typeof( JukaWarrior ), typeof( LavaSerpent ), typeof( LavaSnake ), typeof( LesserHiryu ), typeof(Leviath), typeof( Lizardman ), typeof( MagmaSerpent ), typeof( OphidianArchmage ), typeof( OphidianKnight ), typeof( OphidianMage ), typeof( OphidianMatriarch ), typeof( OphidianWarrior ), typeof(PalaceDeepSeaSerpent), typeof(PalaceSeaSerpent), typeof(Petralisk), typeof(PhantomAsp), typeof(Rend), typeof(Reptalon), typeof(Scylla), typeof(SeaDragon), typeof( SeaSerpent ), typeof(SeaSnake), typeof( Serado ), typeof( SerpentineDragon ), typeof( ShadowWyrm ), typeof( SilverSerpent ),typeof( Snake ), typeof( SwampDragon ), typeof(TAncientWyrm), typeof(thrasher), typeof( WhiteWyrm ), typeof( Wyvern ), typeof( Yamandon ));
			reptilian.Entries = new SlayerEntry[]
			{
			
        //DRAGON SLAYER
				new SlayerEntry( SlayerName.DragonSlaying, typeof( AncientWyrm ), typeof(CrystalDragon), typeof( Dragon ), typeof( Drake ), typeof(Grim), typeof( Hiryu ), typeof(humusminion), typeof( LesserHiryu ), typeof( Rend ), typeof(Reptalon), typeof(SeaDragon), typeof( SerpentineDragon ), typeof( ShadowWyrm ), typeof( SkeletalDragon ), typeof( SwampDragon ), typeof(Scylla), typeof(TAncientWyrm), typeof( WhiteWyrm ), typeof( Wyvern )),
				
				//LIZARDMAN SLAYER
				new SlayerEntry( SlayerName.LizardmanSlaughter, typeof( Lizardman ) ),
				
				//OPHIDIAN SLAYER
				new SlayerEntry( SlayerName.Ophidian, typeof( OphidianArchmage ), typeof( OphidianKnight ), typeof( OphidianMage ), typeof( OphidianMatriarch ), typeof( OphidianWarrior ) ),
				
				//SNAKE SLAYER
				new SlayerEntry( SlayerName.SnakesBane, typeof(coil), typeof( DeepSeaSerpent ), 
				typeof( GiantIceWorm ), typeof( GiantSerpent ), typeof( IceSerpent ), typeof( IceSnake ), typeof(Jormundgand), typeof(Lamia), typeof( LavaSerpent ), typeof( LavaSnake ), typeof(Leviath), typeof(PalaceSeaSerpent), typeof(PalaceDeepSeaSerpent), typeof(PhantomAsp), typeof(QueenLamia), typeof( SeaSerpent ), typeof(SeaSnake), typeof( Serado ), typeof( SilverSerpent ), typeof( Snake ), typeof( Yamandon ))
			};
			
			
			//ML SLAYERS
			
			mlslayers.Super = new SlayerEntry(SlayerName.Bear, typeof(BlackBear),typeof(BrownBear),typeof(EnragedGrizzly),typeof(GrizzlyBear),typeof(PolarBear),typeof(RideablePolarBear));
			mlslayers.Entries = new SlayerEntry[]
			{
			//BEAR
			new SlayerEntry(SlayerName.Bear, typeof(BlackBear),typeof(BrownBear),typeof(EnragedGrizzly),typeof(GrizzlyBear),typeof(PolarBear),typeof(RideablePolarBear)),
			
			//VERMIN
			new SlayerEntry(SlayerName.Vermin, typeof(GiantRat),typeof(Rat),typeof(Ratman),typeof(Chiikkaha),typeof(RatmanArcher),typeof(RatmanMage),typeof(Sewerrat),typeof(Ferret),typeof(HolyFerret),typeof(squirrel),typeof(rabidsquirrel),typeof(dreadsquirrel),typeof(holysquirrel),typeof(Barracoon)),
			
			//BAT
			new SlayerEntry(SlayerName.Bat,typeof(Mongbat),typeof(StrongMongbat),typeof(VampireBat),typeof(Vampire),typeof(FrostBat),typeof(BlackBat),typeof(Vyle)),
			
			//MAGE
			new SlayerEntry(SlayerName.Mage,typeof( Almincrus ),typeof(Lich),typeof(LichLord),typeof(AncientLich),typeof(BoneMagi),typeof(EvilMage),typeof(EvilMageLord),typeof(SkeletalMage),typeof(OrcishMage),typeof(RatmanMage),typeof(KhaldunSummoner),typeof(SeaHag),typeof(MasterMikael),typeof(MasterJonath),typeof(MasterTheophilus),typeof(BlackOrderMage),typeof(BlackOrderGrandMage),typeof(JukaMage),typeof(MeerMage),typeof(SavageShaman),typeof( OphidianMage ),typeof( OphidianArchmage ),typeof( SavageShaman )),
			
			//BEETLE
			new SlayerEntry(SlayerName.Beetle, typeof(DeathwatchBeetle),typeof(DeathwatchBeetleHatchling),typeof(FireBeetle),typeof(Beetle),typeof(RuneBeetle),typeof(FrostBeetle)),
			
			//BIRD
			new SlayerEntry(SlayerName.Bird, typeof(Bird),typeof(Chicken),typeof(vorpalchicken),typeof(Crane),typeof(DesertOstard),typeof(Eagle),typeof(FrenziedOstard),typeof(Phoenix),typeof(Pyrolisk),typeof(Pyre),typeof(Swoop),typeof(westnilecrow),typeof(Harpy),typeof(StoneHarpy),typeof(LesserMadTurkey),typeof(MadTurkey),typeof(SuperMadTurkey),typeof(MadAlchemist),typeof(Saliva),typeof(LesserTurkey),typeof(TurkeyLeader),typeof(GiantTurkey),typeof(ExpiringTurkeyMinion),typeof(GrosseGiblets)),
			
			//ICE
			new SlayerEntry(SlayerName.Ice, typeof(FrostOoze),typeof(ArcticOgreLord),typeof(FrostBat),typeof(FrostSpider),typeof(FrostTroll),typeof(GiantIceWorm),typeof(IceDevil),typeof(IceElemental),typeof(IceFiend),typeof(IceHound),typeof(IceSnake),typeof(LadyOfTheSnow),typeof(PolarBear),typeof(SnowElemental),typeof(SnowLeopard),typeof(UnfrozenMummy),typeof(WhiteWolf),typeof(WhiteWyrm),typeof(WinterReaper)),
			
			//FLAME
			new SlayerEntry(SlayerName.Flame,typeof(FireBeetle),typeof(FireGargoyle),typeof(FireElemental),typeof(FireSteed),typeof(HellHound),typeof(HellCat),typeof(PredatorHellCat),typeof(LavaLizard),typeof(LavaSerpent),typeof(LavaSnake),typeof(humusminion),typeof(Humus),typeof(Phoenix),typeof(Pyrolisk),typeof(Pyre),typeof(MagmaSerpent)),
			
			//BOVINE
			new SlayerEntry(SlayerName.Bovine, typeof(Bull),typeof(Cow),typeof(Gaman),typeof(Minotaur),typeof(MinotaurScout),typeof(MinotaurCaptain),typeof(TormentedMinotaur),typeof(Meraktus)),
			
			//WOLF
			new SlayerEntry(SlayerName.Wolf, typeof(BakeKitsune),typeof(BlackJackal),typeof(Dog),typeof(HellHound),typeof(DireWolf),typeof(Gnaw),typeof(GreyWolf),typeof(Grobu),typeof(Jackal),typeof(TimberWolf),typeof(TsukiWolf),typeof(WhiteWolf),typeof(CuSidhe))
			};
			
			m_Groups = new SlayerGroup[]
				{
					humanoid,
					undead,
					elemental,
					abyss,
					arachnid,
					reptilian,
					fey,
					mlslayers
				};

			m_TotalEntries = CompileEntries( m_Groups );
		}

		private static SlayerEntry[] CompileEntries( SlayerGroup[] groups )
		{
			SlayerEntry[] entries = new SlayerEntry[39];

			for ( int i = 0; i < groups.Length; ++i )
			{
				SlayerGroup g = groups[i];

				g.Super.Group = g;

				entries[(int)g.Super.Name] = g.Super;

				for ( int j = 0; j < g.Entries.Length; ++j )
				{
					g.Entries[j].Group = g;
					entries[(int)g.Entries[j].Name] = g.Entries[j];
				}
			}

			return entries;
		}

		private SlayerGroup[] m_Opposition;
		private SlayerEntry m_Super;
		private SlayerEntry[] m_Entries;
		private Type[] m_FoundOn;

		public SlayerGroup[] Opposition{ get{ return m_Opposition; } set{ m_Opposition = value; } }
		public SlayerEntry Super{ get{ return m_Super; } set{ m_Super = value; } }
		public SlayerEntry[] Entries{ get{ return m_Entries; } set{ m_Entries = value; } }
		public Type[] FoundOn{ get{ return m_FoundOn; } set{ m_FoundOn = value; } }

		public bool OppositionSuperSlays( Mobile m )
		{
		if(Opposition==null)return false;
			for( int i = 0; i < Opposition.Length; i++ )
			{
			if(m==null)break;
				if ( Opposition[i].Super.Slays( m ) )
					return true;
			}

			return false;
		}

		public SlayerGroup()
		{
		}
	}
}