RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

GetDamageScalar Crash From Monster Spell

Djeryv

Sorceror
I was hoping maybe someone would have some insight into this odd problem that I am having. Whenever a spellcasting creature attacks me, I get a crash...

Code:
System.NullReferenceException: Object reference not set to an instance of an object.
  at Server.Items.SlayerGroup.OppositionSuperSlays(Mobile m) in c:\UO\Scripts\Items\Weapons\SlayerGroup.cs:line 844
  at Server.Spells.Spell.GetSlayerDamageScalar(Mobile defender) in c:\UO\Scripts\Spells\Base\Spell.cs:line 369
  at Server.Spells.Spell.GetDamageScalar(Mobile target) in c:\UO\Scripts\Spells\Base\Spell.cs:line 321
  at Server.Spells.Spell.GetNewAosDamage(Int32 bonus, Int32 dice, Int32 sides, Mobile singleTarget) in c:\UO\Scripts\Spells\Base\Spell.cs:line 117
  at Server.Spells.Fourth.LightningSpell.Target(Mobile m) in c:\UO\Scripts\Spells\Fourth\Lightning.cs:line 46
  at Server.Spells.Fourth.LightningSpell.InternalTarget.OnTarget(Mobile from, Object o) in c:\UO\Scripts\Spells\Fourth\Lightning.cs:line 82
  at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
  at Server.Mobiles.MageAI.ProcessTarget() in c:\UO\Scripts\Mobiles\AI\MageAI.cs:line 984
  at Server.Mobiles.MageAI.Think() in c:\UO\Scripts\Mobiles\AI\MageAI.cs:line 32
  at Server.Mobiles.BaseAI.AITimer.OnTick() in c:\UO\Scripts\Mobiles\AI\BaseAI.cs:line 2837
  at Server.Timer.Slice()
  at Server.Core.Main(String[] args)

You can see they were about to cast a lightning spell on me. The odd thing is that is only happens if my character is holding a slayer weapon. I don't even attack them with the weapon. I can be a few tiles away and they will cast a spell at me to make it crash again. If I hold a regular weapon...it does not crash. If I comment out this line in Spell.cs...

Code:
if( defSlayer != null && defSlayer.Group.OppositionSuperSlays( m_Caster ) || defSlayer2 != null && defSlayer2.Group.OppositionSuperSlays( m_Caster ) )

...then it also does not crash. This crash has happened on spells cast by monsters like Lighting Bolt, Magic Arrow, and Energy Bolt. I tried going back to any changes I made and am just stumped. I did add about 7 new slayer groups but the weapons appear fine with those.
 

Djeryv

Sorceror
Here it is. I added a few different slayers to the mix which compile fine and show up on weapons just fine as well. My client for my server has a custom cliloc so the names show up correctly in the client correctly (like "Avian Hunter" and "Golem Destruction")...


Code:
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 wizard = new SlayerGroup();
            SlayerGroup avian = new SlayerGroup();
            SlayerGroup slimy = new SlayerGroup();
            SlayerGroup animal = new SlayerGroup();
            SlayerGroup giant = new SlayerGroup();
            SlayerGroup golem = new SlayerGroup();
            SlayerGroup weed = new SlayerGroup();
            SlayerGroup fey = new SlayerGroup();
 
            humanoid.Super = new SlayerEntry( SlayerName.Repond,
                typeof( PirateCaptain ),
                typeof( PirateCrew ),
                typeof( PirateCrewBow ),
                typeof( PirateLand ),
                typeof( BloodAssassin ),
                typeof( BloodMage ),
                typeof( NativeArcher ),
                typeof( Native ),
                typeof( NativeWitchDoctor ),
                typeof( Berserker ),
                typeof( Rogue ),
                typeof( Elementalist ),
                typeof( Necro ),
                typeof( Demonologist ),
                typeof( EvilMage ),
                typeof( EvilMageLord ),
                typeof( ArcticOgreLord ),
                typeof( Cyclops ),
                typeof( Ettin ),
                typeof( Bandit ),
                typeof( Tritun ),
                typeof( TritunArcher ),
                typeof( TritunMage ),
                typeof( Medusa ),
                typeof( MindFlayer ),
                typeof( SeaGiant ),
                typeof( StormGiant ),
                typeof( JungleGiant ),
                typeof( FrostTroll ),
                typeof( SwampTroll ),
                typeof( WinterTroll ),
                typeof( TundraOgre ),
                typeof( MeerCaptain ),
                typeof( MeerEternal ),
                typeof( MeerMage ),
                typeof( MeerWarrior ),
                typeof( Ogre ),
                typeof( OgreLord ),
                typeof( ForestGiant ),
                typeof( FireGiant ),
                typeof( FrostGiant ),
                typeof( Neanderthal ),
                typeof( SandGiant ),
                typeof( Orc ),
                typeof( OrcBomber ),
                typeof( OrcBrute ),
                typeof( OrkRogue ),
                typeof( OrkElementalist ),
                typeof( OrkDemonologist ),
                typeof( OrkNecro ),
                typeof( OrkWarrior ),
                typeof( OrkMage ),
                typeof( OrcCaptain ),
                typeof( Goblin ),
                typeof( Gremlin ),
                typeof( OrcishLord ),
                typeof( OrcishMage ),
                typeof( Ratman ),
                typeof( RatmanArcher ),
                typeof( RatmanMage ),
                typeof( Titan ),
                typeof( Troll ) );
            humanoid.Entries = new SlayerEntry[]
                {
                    new SlayerEntry( SlayerName.OgreTrashing,
                        typeof( Ogre ),
                        typeof( TundraOgre ),
                        typeof( OgreLord ),
                        typeof( ArcticOgreLord ) ),
                    new SlayerEntry( SlayerName.OrcSlaying,
                        typeof( Orc ),
                        typeof( OrkRogue ),
                        typeof( OrkWarrior ),
                        typeof( OrkMage ),
                        typeof( OrkElementalist ),
                        typeof( OrkDemonologist ),
                        typeof( OrkNecro ),
                        typeof( OrcBomber ),
                        typeof( OrcBrute ),
                        typeof( OrcCaptain ),
                        typeof( OrcishLord ),
                        typeof( OrcishMage ) ),
                    new SlayerEntry( SlayerName.TrollSlaughter,
                        typeof( Troll ),
                        typeof( WinterTroll ),
                        typeof( SwampTroll ),
                        typeof( FrostTroll ) )
                };
 
            undead.Super = new SlayerEntry( SlayerName.Silver,
                typeof( AncientLich ),
                typeof( LichKing ),
                typeof( Bogle ),
                typeof( BoneKnight ),
                typeof( BoneMagi ),
                typeof( DarknightCreeper ),
                typeof( FleshGolem ),
                typeof( SoulWorm ),
                typeof( Ghoul ),
                typeof( GoreFiend ),
                typeof( HellSteed ),
                typeof( LadyOfTheSnow ),
                typeof( Ghostly ),
                typeof( Lich ),
                typeof( LichLord ),
                typeof( WereWolf ),
                typeof( IceGhoul ),
                typeof( Mummy ),
                typeof( MummyLord ),
                typeof( PestilentBandage ),
                typeof( Revenant ),
                typeof( RevenantLion ),
                typeof( RottingCorpse ),
                typeof( Shade ),
                typeof( ShadowKnight ),
                typeof( SkeletalKnight ),
                typeof( DeathBear ),
                typeof( DeathWolf ),
                typeof( UndeadDruid ),
                typeof( SkeletalWizard ),
                typeof( ZombieDragon ),
                typeof( SkeletalDragon ),
                typeof( SkeletonHorse ),
                typeof( SkeletalMage ),
                typeof( SkeletalMount ),
                typeof( Skeleton ),
                typeof( Spectre ),
                typeof( GhostGargoyle ),
                typeof( SpectralGargoyle ),
                typeof( Wraith ),
                typeof( FrailSkeleton ),
                typeof( Phantom ),
                typeof( Vampire ),
                typeof( VampireLord ),
                typeof( FrozenCorpse ),
                typeof( ZombieGargoyle ),
                typeof( Zombie ) );
            undead.Entries = new SlayerEntry[0];
 
            fey.Super = new SlayerEntry( SlayerName.Fey,
                typeof( Centaur ),
                typeof( EtherealWarrior ),
                typeof( Kirin ),
                typeof( LordOaks ),
                typeof( Pixie ),
                typeof( Silvani ),
                typeof( Treefellow ),
                typeof( ElfRogue ),
                typeof( ElfPirateCaptain ),
                typeof( ElfPirateCrew ),
                typeof( ElfPirateCrewBow ),
                typeof( ElfBerserker ),
                typeof( ElfMage ),
                typeof( ElfPyromancer ),
                typeof( Unicorn ),
                typeof( DarkUnicorn ),
                typeof( Wisp ),
                typeof( MLDryad ),
                typeof( xDryad ),
                typeof( Satyr ) );
            fey.Entries = new SlayerEntry[0];
 
            //////////////// DJERYV ADDED ///////////////////
            wizard.Super = new SlayerEntry( SlayerName.WizardSlayer,
                typeof( ElfMage ),
                typeof( ElfPyromancer ),
                typeof( Archmage ),
                typeof( BloodMage ),
                typeof( Demonologist ),
                typeof( Elementalist ),
                typeof( EvilMage ),
                typeof( EvilMageLord ),
                typeof( IceQueen ),
                typeof( MindFlayer ),
                typeof( NativeWitchDoctor ),
                typeof( Necro ),
                typeof( RatmanMage ),
                typeof( SavageShaman ),
                typeof( TritunMage ),
                typeof( OrcishMage ),
                typeof( OrkDemonologist ),
                typeof( OrkElementalist ),
                typeof( OrkMage ),
                typeof( OrkNecro ),
                typeof( KoboldMage ),
                typeof( SaklethMage ),
                typeof( OphidianArchmage ),
                typeof( OphidianMage ),
                typeof( OphidianMatriarch ),
                typeof( AncientLich ),
                typeof( BoneMagi ),
                typeof( Lich ),
                typeof( LichKing ),
                typeof( LichLord ),
                typeof( SkeletalMage ),
                typeof( SkeletalWizard ),
                typeof( UndeadDruid ) );
            wizard.Entries = new SlayerEntry[0];
 
            //////////////// DJERYV ADDED ///////////////////
            avian.Super = new SlayerEntry( SlayerName.AvianHunter,
                typeof( Bird ),
                typeof( Chicken ),
                typeof( Crane ),
                typeof( Eagle ),
                typeof( Harpy ),
                typeof( Phoenix ),
                typeof( SnowHarpy ),
                typeof( StoneHarpy ),
                typeof( TropicalBird ) );
            avian.Entries = new SlayerEntry[0];
 
            //////////////// DJERYV ADDED ///////////////////
            slimy.Super = new SlayerEntry( SlayerName.SlimyScourge,
                typeof( BlackPudding ),
                typeof( BloodWorm ),
                typeof( CarcassWorm ),
                typeof( CorrosiveSlime ),
                typeof( LavaPuddle ),
                typeof( FrostOoze ),
                typeof( GiantLeech ),
                typeof( BogThing ),
                typeof( MoundOfMaggots ),
                typeof( PlagueBeast ),
                typeof( PlagueBeastLord ),
                typeof( PlagueSpawn ),
                typeof( PurpleWorm ),
                typeof( LavaWorm ),
                typeof( Quagmire ),
                typeof( SandWorm ),
                typeof( Slime ),
                typeof( SnowWorm ),
                typeof( SoulWorm ),
                typeof( Viscera ) );
            slimy.Entries = new SlayerEntry[0];
 
            //////////////// DJERYV ADDED ///////////////////
            animal.Super = new SlayerEntry( SlayerName.AnimalHunter,
                typeof( BakeKitsune ),
                typeof( BlackBear ),
                typeof( BlackBearx ),
                typeof( Boar ),
                typeof( BrownBear ),
                typeof( BrownBearx ),
                typeof( Bull ),
                typeof( BullFrog ),
                typeof( Cat ),
                typeof( CaveBear ),
                typeof( Cougar ),
                typeof( Cougarx ),
                typeof( Cow ),
                typeof( DireBoar ),
                typeof( DireWolf ),
                typeof( Dog ),
                typeof( Ferret ),
                typeof( FireBat ),
                typeof( FireToad ),
                typeof( Gaman ),
                typeof( GiantBat ),
                typeof( GiantCrab ),
                typeof( GiantRat ),
                typeof( GiantToad ),
                typeof( Goat ),
                typeof( Gorgon ),
                typeof( Gorilla ),
                typeof( Gorillax ),
                typeof( GreaterMongbat ),
                typeof( GreatHart ),
                typeof( GreyWolf ),
                typeof( GreyWolfx ),
                typeof( GrizzlyBear ),
                typeof( GrizzlyBearx ),
                typeof( HellCat ),
                typeof( HellHound ),
                typeof( Hind ),
                typeof( IceToad ),
                typeof( Jackal ),
                typeof( Jackalx ),
                typeof( JackRabbit ),
                typeof( Lion ),
                typeof( Lionx ),
                typeof( Llama ),
                typeof( Mongbat ),
                typeof( MountainGoat ),
                typeof( PackHorse ),
                typeof( PackLlama ),
                typeof( Panther ),
                typeof( Pantherx ),
                typeof( Pig ),
                typeof( PredatorHellCat ),
                typeof( Rabbit ),
                typeof( RagingGrizzlyBear ),
                typeof( Rat ),
                typeof( Sewerrat ),
                typeof( ShadowHound ),
                typeof( Sheep ),
                typeof( SnowLeopard ),
                typeof( SnowLeopardx ),
                typeof( Squirrel ),
                typeof( StrongMongbat ),
                typeof( TimberWolf ),
                typeof( VampireBat ),
                typeof( VorpalBunny ),
                typeof( Walrus ),
                typeof( WereWolf ),
                typeof( WhiteRabbit ),
                typeof( DeathBear ),
                typeof( DeathWolf ) );
            animal.Entries = new SlayerEntry[0];
 
            //////////////// DJERYV ADDED ///////////////////
            giant.Super = new SlayerEntry( SlayerName.GiantKiller,
                typeof( ArcticOgreLord ),
                typeof( Cyclops ),
                typeof( Ettin ),
                typeof( FireGiant ),
                typeof( ForestGiant ),
                typeof( FrostGiant ),
                typeof( FrostTroll ),
                typeof( Ogre ),
                typeof( OgreLord ),
                typeof( SandGiant ),
                typeof( SeaGiant ),
                typeof( StormGiant ),
                typeof( SwampTroll ),
                typeof( Titan ),
                typeof( Troll ),
                typeof( TundraOgre ),
                typeof( WinterTroll ) );
            giant.Entries = new SlayerEntry[0];
 
            //////////////// DJERYV ADDED ///////////////////
            golem.Super = new SlayerEntry( SlayerName.GolemDestruction,
                typeof( BoneGolem ),
                typeof( ExodusMinion ),
                typeof( ExodusOverseer ),
                typeof( FleshGolem ),
                typeof( Golem ),
                typeof( IronCobra ),
                typeof( Juggernaut ),
                typeof( LivingBronzeStatue ),
                typeof( LivingGoldStatue ),
                typeof( LivingIronStatue ),
                typeof( LivingJadeStatue ),
                typeof( LivingMarbleStatue ),
                typeof( LivingSilverStatue ),
                typeof( LivingStoneStatue ),
                typeof( MechanicalScorpion ),
                typeof( WoodenGolem ) );
            golem.Entries = new SlayerEntry[0];
 
            //////////////// DJERYV ADDED ///////////////////
            weed.Super = new SlayerEntry( SlayerName.WeedRuin,
                typeof( Bogle ),
                typeof( Bogling ),
                typeof( BogThing ),
                typeof( Corpser ),
                typeof( DarkReaper ),
                typeof( FerelTreefellow ),
                typeof( Reaper ),
                typeof( StrangleVine ),
                typeof( SwampTentacle ),
                typeof( Treefellow ),
                typeof( WalkingReaper ),
                typeof( WhippingVine ) );
            weed.Entries = new SlayerEntry[0];
 
            elemental.Super = new SlayerEntry( SlayerName.ElementalBan,
                typeof( ToxicElemental ),
                typeof( AgapiteElemental ),
                typeof( AirElemental ),
                typeof( SummonedAirElemental ),
                typeof( BloodElemental ),
                typeof( GarnetElemental ),
                typeof( CinderElemental ),
                typeof( TopazElemental ),
                typeof( QuartzElemental ),
                typeof( SpinelElemental ),
                typeof( StarRubyElemental ),
                typeof( BronzeElemental ),
                typeof( CopperElemental ),
                typeof( CrystalElemental ),
                typeof( DullCopperElemental ),
                typeof( IceColossus ),
                typeof( EarthElemental ),
                typeof( Typhoon ),
                typeof( AgapiteColossus ),
                typeof( BronzeColossus ),
                typeof( CopperColossus ),
                typeof( DullCopperColossus ),
                typeof( GoldenColossus ),
                typeof( ShadowIronColossus ),
                typeof( ValoriteColossus ),
                typeof( VeriteColossus ),
                typeof( SummonedEarthElemental ),
                typeof( Efreet ),
                typeof( FireElemental ),
                typeof( LavaElemental ),
                typeof( DustElemental ),
                typeof( MudElemental ),
                typeof( ObsidianElemental ),
                typeof( MudMan ),
                typeof( ElectricalElemental ),
                typeof( SummonedFireElemental ),
                typeof( GoldenElemental ),
                typeof( IceElemental ),
                typeof( KazeKemono ),
                typeof( PoisonElemental ),
                typeof( RaiJu ),
                typeof( SandVortex ),
                typeof( ShadowIronElemental ),
                typeof( SnowElemental ),
                typeof( ValoriteElemental ),
                typeof( VeriteElemental ),
                typeof( WaterElemental ),
                typeof( SummonedWaterElemental ) );
            elemental.Entries = new SlayerEntry[]
                {
                    new SlayerEntry( SlayerName.BloodDrinking,
                        typeof( BloodElemental ) ),
                    new SlayerEntry( SlayerName.EarthShatter,
                        typeof( AgapiteElemental ),
                        typeof( ObsidianElemental ),
                        typeof( BronzeElemental ),
                        typeof( CopperElemental ),
                        typeof( DullCopperElemental ),
                        typeof( GarnetElemental ),
                        typeof( TopazElemental ),
                        typeof( QuartzElemental ),
                        typeof( SpinelElemental ),
                        typeof( StarRubyElemental ),
                        typeof( EarthElemental ),
                        typeof( AgapiteColossus ),
                        typeof( BronzeColossus ),
                        typeof( CopperColossus ),
                        typeof( DullCopperColossus ),
                        typeof( GoldenColossus ),
                        typeof( ShadowIronColossus ),
                        typeof( ValoriteColossus ),
                        typeof( VeriteColossus ),
                        typeof( SummonedEarthElemental ),
                        typeof( GoldenElemental ),
                        typeof( ShadowIronElemental ),
                        typeof( ValoriteElemental ),
                        typeof( VeriteElemental ) ),
                    new SlayerEntry( SlayerName.ElementalHealth,
                        typeof( PoisonElemental ) ),
                    new SlayerEntry( SlayerName.FlameDousing,
                        typeof( FireElemental ),
                        typeof( LavaElemental ),
                        typeof( CinderElemental ),
                        typeof( FireMephit ),
                        typeof( FireWyrmling ),
                        typeof( VolcanicDragon ),
                        typeof( FireToad ),
                        typeof( LavaPuddle ),
                        typeof( LavaWorm ),
                        typeof( FireDemon ),
                        typeof( FireBat ),
                        typeof( SummonedFireElemental ) ),
                    new SlayerEntry( SlayerName.SummerWind,
                        typeof( SnowElemental ),
                        typeof( IceElemental ) ),
                    new SlayerEntry( SlayerName.Vacuum,
                        typeof( SandVortex ),
                        typeof( DustElemental ),
                        typeof( PoisonCloud ),
                        typeof( AirElemental ),
                        typeof( Typhoon ),
                        typeof( SummonedAirElemental ) ),
                    new SlayerEntry( SlayerName.WaterDissipation,
                        typeof( WaterElemental ),
                        typeof( SummonedWaterElemental ) )
                };
 
            abyss.Super = new SlayerEntry( SlayerName.Exorcism,
                typeof( AbysmalHorror ),
                typeof( ArcaneDaemon ),
                typeof( BloodDemigod ),
                typeof( Balron ),
                typeof( FireMephit ),
                typeof( BlackGateDemon ),
                typeof( FireDemon ),
                typeof( LesserDemon ),
                typeof( LowerDemon ),
                typeof( ShadowDemon ),
                typeof( GreaterDemon ),
                typeof( Demon ),
                typeof( BloodDemon ),
                typeof( BoneDemon ),
                typeof( ChaosDaemon ),
                typeof( Daemon ),
                typeof( SummonedDaemon ),
                typeof( DemonKnight ),
                typeof( Devourer ),
                typeof( EnslavedGargoyle ),
                typeof( FanDancer ),
                typeof( FireGargoyle ),
                typeof( Gargoyle ),
                typeof( ZombieGargoyle ),
                typeof( GhostGargoyle ),
                typeof( GargoyleRuby ),
                typeof( GargoyleOnyx ),
                typeof( GargoyleMarble ),
                typeof( GargoyleEmerald ),
                typeof( GargoyleAmethyst ),
                typeof( GargoyleSapphire ),
                typeof( SpectralGargoyle ),
                typeof( GargoyleDestroyer ),
                typeof( ShadowHound ),
                typeof( GargoyleEnforcer ),
                typeof( Gibberling ),
                typeof( HordeMinion ),
                typeof( IceFiend ),
                typeof( Imp ),
                typeof( Impaler ),
                typeof( Moloch ),
                typeof( Oni ),
                typeof( Ravager ),
                typeof( Semidar ),
                typeof( StoneGargoyle ),
                typeof( Succubus ),
                typeof( TsukiWolf ) );
 
            abyss.Entries = new SlayerEntry[]
                {
                    new SlayerEntry( SlayerName.GargoylesFoe,
                        typeof( EnslavedGargoyle ),
                        typeof( FireGargoyle ),
                        typeof( Gargoyle ),
                        typeof( GargoyleDestroyer ),
                        typeof( GhostGargoyle ),
                        typeof( SpectralGargoyle ),
                        typeof( ZombieGargoyle ),
                        typeof( GargoyleEnforcer ),
                        typeof( GargoyleRuby ),
                        typeof( GargoyleOnyx ),
                        typeof( GargoyleMarble ),
                        typeof( GargoyleEmerald ),
                        typeof( GargoyleAmethyst ),
                        typeof( GargoyleSapphire ),
                        typeof( StoneGargoyle ) ),
                };
 
            arachnid.Super = new SlayerEntry( SlayerName.ArachnidDoom,
                typeof( DreadSpider ),
                typeof( FrostSpider ),
                typeof( GiantBlackWidow ),
                typeof( MonstrousSpider ),
                typeof( GiantSpider ),
                typeof( SandSpider ),
                typeof( Mephitis ),
                typeof( Scorpion ),
                typeof( DeadlyScorpion ),
                typeof( TerathanAvenger ),
                typeof( TerathanDrone ),
                typeof( TerathanMatriarch ),
                typeof( TerathanWarrior ) );
            arachnid.Entries = new SlayerEntry[]
                {
                    new SlayerEntry( SlayerName.ScorpionsBane,
                        typeof( Scorpion ),
                        typeof( DeadlyScorpion ) ),
                    new SlayerEntry( SlayerName.SpidersDeath,
                        typeof( DreadSpider ),
                        typeof( LargeSpider ),
                        typeof( FrostSpider ),
                        typeof( GiantBlackWidow ),
                        typeof( MonstrousSpider ),
                        typeof( SandSpider ),
                        typeof( GiantSpider ),
                        typeof( Mephitis ) ),
                    new SlayerEntry( SlayerName.Terathan,
                        typeof( TerathanAvenger ),
                        typeof( TerathanDrone ),
                        typeof( TerathanMatriarch ),
                        typeof( TerathanWarrior ) )
                };
 
            reptilian.Super = new SlayerEntry( SlayerName.ReptilianDeath,
                typeof( Grugadon ),
                typeof( JungleViper ),
                typeof( Ravenous ),
                typeof( AncientWyrm ),
                typeof( FireWyrmling ),
                typeof( DeepSeaSerpent ),
                typeof( GoldenSerpent ),
                typeof( DragonKing ),
                typeof( VolcanicDragon ),
                typeof( SummonDragon ),
                typeof( GreaterDragon ),
                typeof( ZombieDragon ),
                typeof( Dragon ),
                typeof( BabyDragon ),
                typeof( BlackDragon ),
                typeof( BlueDragon ),
                typeof( GreenDragon ),
                typeof( WhiteDragon ),
                typeof( Hydra ),
                typeof( Drake ),
                typeof( GiantIceWorm ),
                typeof( IceSerpent ),
                typeof( GiantSerpent ),
                typeof( Hiryu ),
                typeof( IceSnake ),
                typeof( Iguana ),
                typeof( SeaSnake ),
                typeof( JukaLord ),
                typeof( SummonSnakes ),
                typeof( JukaMage ),
                typeof( JukaWarrior ),
                typeof( LavaSerpent ),
                typeof( LargeSnake ),
                typeof( GiantLizard ),
                typeof( Basilisk ),
                typeof( CaveLizard ),
                typeof( GiantAdder ),
                typeof( HugeLizard ),
                typeof( Kobold ),
                typeof( KoboldMage ),
                typeof( LizardmanArcher ),
                typeof( SaklethArcher ),
                typeof( Sakleth ),
                typeof( SaklethMage ),
                typeof( Meglasaur ),
                typeof( Naga ),
                typeof( WaterNaga ),
                typeof( Raptor ),
                typeof( LavaSnake ),
                typeof( LesserHiryu ),
                typeof( Lizardman ),
                typeof( Scalizard ),
                typeof( OphidianArchmage ),
                typeof( OphidianKnight ),
                typeof( OphidianMage ),
                typeof( OphidianMatriarch ),
                typeof( OphidianWarrior ),
                typeof( SeaSerpent ),
                typeof( Serado ),
                typeof( SerpentineDragon ),
                typeof( ShadowWyrm ),
                typeof( SilverSerpent ),
                typeof( SkeletalDragon ),
                typeof( Snake ),
                typeof( SwampDragon ),
                typeof( WhiteWyrm ),
                typeof( Wyvern ),
                typeof( SeaWyvern ),
                typeof( Yamandon ) );
            reptilian.Entries = new SlayerEntry[]
                {
                    new SlayerEntry( SlayerName.DragonSlaying,
                        typeof( AncientWyrm ),
                        typeof( GreaterDragon ),
                        typeof( VolcanicDragon ),
                        typeof( Dragon ),
                        typeof( BabyDragon ),
                        typeof( FireWyrmling ),
                        typeof( BlackDragon ),
                        typeof( DragonKing ),
                        typeof( BlueDragon ),
                        typeof( GreenDragon ),
                        typeof( WhiteDragon ),
                        typeof( SummonDragon ),
                        typeof( ZombieDragon ),
                        typeof( Hydra ),
                        typeof( Drake ),
                        typeof( Hiryu ),
                        typeof( LesserHiryu ),
                        typeof( SerpentineDragon ),
                        typeof( ShadowWyrm ),
                        typeof( SkeletalDragon ),
                        typeof( SwampDragon ),
                        typeof( WhiteWyrm ),
                        typeof( SeaWyvern ),
                        typeof( Wyvern ) ),
                    new SlayerEntry( SlayerName.LizardmanSlaughter,
                        typeof( Kobold ),
                        typeof( KoboldMage ),
                        typeof( LizardmanArcher ),
                        typeof( SaklethArcher ),
                        typeof( Sakleth ),
                        typeof( SaklethMage ),
                        typeof( Lizardman ) ),
                    new SlayerEntry( SlayerName.Ophidian,
                        typeof( OphidianArchmage ),
                        typeof( OphidianKnight ),
                        typeof( OphidianMage ),
                        typeof( OphidianMatriarch ),
                        typeof( OphidianWarrior ) ),
                    new SlayerEntry( SlayerName.SnakesBane,
                        typeof( JungleViper ),
                        typeof( DeepSeaSerpent ),
                        typeof( GiantIceWorm ),
                        typeof( LargeSnake ),
                        typeof( GiantSerpent ),
                        typeof( IceSerpent ),
                        typeof( GoldenSerpent ),
                        typeof( IceSnake ),
                        typeof( LavaSerpent ),
                        typeof( SummonSnakes ),
                        typeof( GiantAdder ),
                        typeof( Naga ),
                        typeof( WaterNaga ),
                        typeof( SeaSnake ),
                        typeof( LavaSnake ),
                        typeof( SeaSerpent ),
                        typeof( Serado ),
                        typeof( SilverSerpent ),
                        typeof( Snake ),
                        typeof( Yamandon ) )
                };
 
            m_Groups = new SlayerGroup[]
                {
                    humanoid,
                    undead,
                    elemental,
                    abyss,
                    arachnid,
                    reptilian,
                    wizard,
                    avian,
                    slimy,
                    animal,
                    giant,
                    golem,
                    weed,
                    fey
                };
 
            m_TotalEntries = CompileEntries( m_Groups );
        }
 
        private static SlayerEntry[] CompileEntries( SlayerGroup[] groups )
        {
            SlayerEntry[] entries = new SlayerEntry[35];
 
            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 )
        {
            for( int i = 0; i < Opposition.Length; i++ )
            {
                if ( Opposition[i].Super.Slays( m ) )
                    return true;
            }
 
            return false;
        }
 
        public SlayerGroup()
        {
        }
    }
}
 

Djeryv

Sorceror
I thought this section of code was so RUNUO would know which monsters drop what type of slayer weapon. I removed it because I didn't want monsters to drop slayer weapons and only wanted slayer weapons to appear in my treasure chests. Is this what may be breaking it...if so...I can try adding it back in and retry.
 

Djeryv

Sorceror
Why did you remove ---- humanoid.Opposition = new SlayerGroup[] { undead }; ---- ?

Well...thank you for that. It fixed it. I found that I should leave it blank instead of deleting it out like this...

humanoid.Opposition = new SlayerGroup[]{ };
humanoid.FoundOn = new Type[]{ };
 
Top