Opywang

Member
Hey there I am trying to add a new custom monster on shard from older version run uo, and it work great, but I got a new serv uo, and it doesn't work, and has error.

Line 90 error says this.

CS1501: Line 90: No overload for method 'GetLootingRights' takes 2 arguments
Scripts: One or more scripts failed to compile or no script files were found.

Here that what line 90 says.

List<DamageStore> rights = BaseCreature.GetLootingRights( creature.DamageEntries, creature.HitsMax );

If there is an another way that I can edit to make monster drop items in pack rather than corps that will be great also. I don't have to get this one fix it just anything that can make item drop in pack like doom boss.



Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;

namespace Server.Mobiles
{
    [CorpseName( "a Deed Collectors corpse" )]
    public class DeedCollectors : BaseCreature
    {
        public override bool IgnoreYoungProtection { get { return Core.ML; } }

        public static Type[] ArtifactRarity10 { get { return m_ArtifactRarity10; } }
        public static Type[] ArtifactRarity11 { get { return m_ArtifactRarity11; } }
        private static Type[] m_ArtifactRarity10 = new Type[]
            {
                typeof( LegacyOfTheDreadLord ),
                typeof( TheTaskmaster )
            };

        private static Type[] m_ArtifactRarity11 = new Type[]
            {
                typeof( WeaponSpeedIncreaseDeed ),
                typeof( WeaponDamageIncreaseDeed ),
                typeof( UseBestSkillIncreaseDeed ),
                typeof( SpellDamageIncreaseDeed ),
                typeof( HolyKnightsBreastplate ),
                typeof( SpellChannelingIncreaseDeed ),
                typeof( RegenStamIncreaseDeed ),
                typeof( RegenManaIncreaseDeed ),
                typeof( OrnateCrownOfTheHarrower ),
                typeof( ShadowDancerLeggings ),
                typeof( RegenHitsIncreaseDeed ),
                typeof( ReflectPhysicalIncreaseDeed ),
                typeof( MageWeaponIncreaseDeed ),
                typeof( LuckIncreaseDeed ),
                typeof( LowerRegCostIncreaseDeed ),
                typeof( LowerManaCostIncreaseDeed ),
                typeof( HitPoisonAreaIncreaseDeed ),
                typeof( HitPhysicalAreaIncreaseDeed ),
                typeof( HitMagicArrowIncreaseDeed ),
                typeof( HitLowerDefendIncreaseDeed ),
                typeof( HitLowerAttackIncreaseDeed ),
                typeof( HitLightningIncreaseDeed ),
                typeof( HitLeechStamIncreaseDeed ),
                typeof( HitLeechManaIncreaseDeed ),
                typeof( HitLeechHitsIncreaseDeed ),
                typeof( HitHarmIncreaseDeed ),
                typeof( HitFireballIncreaseDeed ),
                typeof( HitFireAreaIncreaseDeed ),
                typeof( HitEnergyAreaIncreaseDeed ),
                typeof( HitDispelIncreaseDeed ),
                typeof( HitColdAreaIncreaseDeed ),
                typeof( DefendChanceIncreaseDeed ),
                typeof( CastSpeedIncreaseDeed ),
                typeof( BonusStrIncreaseDeed ),
                typeof( BonusStamIncreaseDeed ),
                typeof( BonusManaIncreaseDeed ),
                typeof( BonusIntIncreaseDeed ),
                typeof( BonusHitsIncreaseDeed ),
                typeof( BonusDexIncreaseDeed ),
                typeof( AttackChanceIncreaseDeed )
            };

        public static Item CreateRandomArtifact()
        {
            if ( !Core.AOS )
                return null;

            int count = ( m_ArtifactRarity10.Length * 5 ) + ( m_ArtifactRarity11.Length * 4 );
            int random = Utility.Random( count );
            Type type;

            if ( random < ( m_ArtifactRarity10.Length * 5 ) )
            {
                type = m_ArtifactRarity10[random / 5];
            }
            else
            {
                random -= m_ArtifactRarity10.Length * 5;
                type = m_ArtifactRarity11[random / 4];
            }

            return Loot.Construct( type );
        }

        public static Mobile FindRandomPlayer( BaseCreature creature )
        {
            List<DamageStore> rights = BaseCreature.GetLootingRights( creature.DamageEntries, creature.HitsMax );

            for ( int i = rights.Count - 1; i >= 0; --i )
            {
                DamageStore ds = rights[i];

                if ( !ds.m_HasRight )
                    rights.RemoveAt( i );
            }

            if ( rights.Count > 0 )
                return rights[Utility.Random( rights.Count )].m_Mobile;

            return null;
        }

        public static void DistributeArtifact( BaseCreature creature )
        {
            DistributeArtifact( creature, CreateRandomArtifact() );
        }

        public static void DistributeArtifact( BaseCreature creature, Item artifact )
        {
            DistributeArtifact( FindRandomPlayer( creature ), artifact );
        }

        public static void DistributeArtifact( Mobile to )
        {
            DistributeArtifact( to, CreateRandomArtifact() );
        }

        public static void DistributeArtifact( Mobile to, Item artifact )
        {
            if ( to == null || artifact == null )
                return;

            Container pack = to.Backpack;

            if ( pack == null || !pack.TryDropItem( to, artifact, false ) )
                to.BankBox.DropItem( artifact );

            to.SendLocalizedMessage( 1062317 ); // For your valor in combating the fallen beast, a special Deed has been bestowed on you.
        }

        public static int GetArtifactChance( Mobile boss )
        {
            if ( !Core.AOS )
                return 0;

            int luck = LootPack.GetLuckChanceForKiller( boss );
            int chance;

            if ( boss is DeedCollectors )
                chance = 15000 + (luck / 5);
            else
                chance = 2500 + (luck / 10);

            return chance;
        }

        public static bool CheckArtifactChance( Mobile boss )
        {
            return GetArtifactChance( boss ) > Utility.Random( 100000 );
        }

        public override WeaponAbility GetWeaponAbility()
        {
            switch ( Utility.Random( 3 ) )
            {
                default:
                case 0: return WeaponAbility.DoubleStrike;
                case 1: return WeaponAbility.WhirlwindAttack;
                case 2: return WeaponAbility.CrushingBlow;
            }
        }

        public override void OnDeath( Container c )
        {
            base.OnDeath( c );

            if ( !Summoned && !NoKillAwards && DeedCollectors.CheckArtifactChance( this ) )
                DeedCollectors.DistributeArtifact( this );
        }

        [Constructable]
        public DeedCollectors() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
        {
            Name = "the Deed Collectors";
            Body = 318;
            BaseSoundID = 0x165;

            SetStr( 500 );
            SetDex( 100 );
            SetInt( 1000 );

            SetHits( 15000 );
            SetMana( 5000 );

            SetDamage( 10, 15 );

            SetDamageType( ResistanceType.Physical, 20 );
            SetDamageType( ResistanceType.Fire, 20 );
            SetDamageType( ResistanceType.Cold, 20 );
            SetDamageType( ResistanceType.Poison, 20 );
            SetDamageType( ResistanceType.Energy, 20 );

            SetResistance( ResistanceType.Physical, 30 );
            SetResistance( ResistanceType.Fire, 0 );
            SetResistance( ResistanceType.Cold, 0 );
            SetResistance( ResistanceType.Poison, 30 );
            SetResistance( ResistanceType.Energy, 0 );

            SetSkill( SkillName.Necromancy, 120, 120.0 );
            SetSkill( SkillName.SpiritSpeak, 120.0, 120.0 );

            SetSkill( SkillName.DetectHidden, 80.0 );
            SetSkill( SkillName.EvalInt, 100.0 );
            SetSkill( SkillName.Magery, 100.0 );
            SetSkill( SkillName.Meditation, 120.0 );
            SetSkill( SkillName.MagicResist, 150.0 );
            SetSkill( SkillName.Tactics, 100.0 );
            SetSkill( SkillName.Wrestling, 120.0 );

            Fame = 28000;
            Karma = -28000;

            VirtualArmor = 64;
        }

        public override void GenerateLoot()
        {
            AddLoot( LootPack.SuperBoss, 5 );
            AddLoot( LootPack.HighScrolls, Utility.RandomMinMax( 0, 0 ) );
        }

        public override bool BardImmune{ get{ return !Core.SE; } }
        public override bool Unprovokable{ get{ return Core.SE; } }
        public override bool AreaPeaceImmune { get { return Core.SE; } }
        public override Poison PoisonImmune{ get{ return Poison.Lethal; } }

        public override int TreasureMapLevel{ get{ return 1; } }

        private static bool m_InHere;

        public override void OnDamage( int amount, Mobile from, bool willKill )
        {
            if ( from != null && from != this && !m_InHere )
            {
                m_InHere = true;
                AOS.Damage( from, this, Utility.RandomMinMax( 0, 0 ), 100, 0, 0, 0, 0 );

                MovingEffect( from, 0xECA, 10, 0, false, false, 0, 0 );
                PlaySound( 0x491 );

                if ( 0.05 > Utility.RandomDouble() )
                    Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( CreateBones_Callback ), from );

                m_InHere = false;
            }
        }

        public virtual void CreateBones_Callback( object state )
        {
            Mobile from = (Mobile)state;
            Map map = from.Map;

            if ( map == null )
                return;

            int count = Utility.RandomMinMax( 0, 0 );

            for ( int i = 0; i < count; ++i )
            {
                int x = from.X + Utility.RandomMinMax( -1, 1 );
                int y = from.Y + Utility.RandomMinMax( -1, 1 );
                int z = from.Z;

                if ( !map.CanFit( x, y, z, 16, false, true ) )
                {
                    z = map.GetAverageZ( x, y );

                    if ( z == from.Z || !map.CanFit( x, y, z, 16, false, true ) )
                        continue;
                }

                UnholyBone bone = new UnholyBone();

                bone.Hue = 0;
                bone.Name = "unholy bones";
                bone.ItemID = Utility.Random( 0xECA, 9 );

                bone.MoveToWorld( new Point3D( x, y, z ), map );
            }
        }

        public DeedCollectors( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );
            writer.Write( (int) 0 );
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();
        }
    }
}
 
Last edited:
O.K. I found a working script for servuo but I would like to use this one, but this monster is too hard, and I would like to convert the first one, and drop loot like this one in here some how, or if somebody has a monster that can share with me that I can add custom item that drop in pack it would also be great.

Code:
using System;
using Server.Items;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace Server.Mobiles
{
    public enum ShadowlordType
    {
        Astaroth,
        Faulinei,
        Nosfentor       
    };
   
    [CorpseName("a shadowlord corpse")]
    public class Shadowlord : BaseCreature
    {
        private static readonly ArrayList m_Instances = new ArrayList();
        public static ArrayList Instances { get { return m_Instances; } }

        private ShadowlordType m_Type;
        public virtual Type[] ArtifactDrops { get { return _ArtifactTypes; } }

        private Type[] _ArtifactTypes = new Type[]
        {
            typeof(Abhorrence),         typeof(CaptainJohnesBlade),             typeof(Craven),
            typeof(Equivocation),       typeof(GargishCaptainJohnesBlade),      typeof(GargishEquivocation),
            typeof(GargishPincer),      typeof(Pincer)
        };

        [CommandProperty(AccessLevel.GameMaster)]
        public ShadowlordType Type
        {
            get
            {
                return this.m_Type;
            }
            set
            {
                this.m_Type = value;
                this.InvalidateProperties();
            }
        }

        [Constructable]
        public Shadowlord()
            : base(AIType.AI_NecroMage, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            m_Instances.Add(this);

            this.m_Type = (ShadowlordType)Utility.Random(3);
            this.Name = this.m_Type.ToString();

            this.Body = 146;
            this.BaseSoundID = 0x4B0;

            this.SetStr(981, 1078);
            this.SetDex(1003, 1114);
            this.SetInt(1098, 1245);

            this.SetHits(50000, 55000);
            this.SetStam(1003, 1114);

            this.SetDamage(35, 41);

            this.SetDamageType(ResistanceType.Physical, 20);
            this.SetDamageType(ResistanceType.Fire, 20);
            this.SetDamageType(ResistanceType.Cold, 20);
            this.SetDamageType(ResistanceType.Poison, 20);
            this.SetDamageType(ResistanceType.Energy, 20);

            this.SetResistance(ResistanceType.Physical, 70, 80);
            this.SetResistance(ResistanceType.Fire, 70, 80);
            this.SetResistance(ResistanceType.Cold, 70, 80);
            this.SetResistance(ResistanceType.Poison, 70, 80);
            this.SetResistance(ResistanceType.Energy, 70, 80);

            this.SetSkill(SkillName.EvalInt, 140.0);
            this.SetSkill(SkillName.Magery, 120.0);
            this.SetSkill(SkillName.Meditation, 140.0);
            this.SetSkill(SkillName.MagicResist, 110.2, 120.0);
            this.SetSkill(SkillName.Tactics, 110.1, 115.0);
            this.SetSkill(SkillName.Wrestling, 110.1, 115.0);
            this.SetSkill(SkillName.Necromancy, 120.0);
            this.SetSkill(SkillName.SpiritSpeak, 120.0);
            this.SetSkill(SkillName.Anatomy, 10.0, 20.0);

            this.Fame = 24000;
            this.Karma = -24000;

            this.VirtualArmor = 20;
            this.Hue = 902;
            Timer SelfDeleteTimer = new InternalSelfDeleteTimer(this);
            SelfDeleteTimer.Start();

        }

        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            list.Add("#{0}", 1154453 + (int)m_Type); // Shadowlord of ..
        }

        public Shadowlord(Serial serial)
            : base(serial)
        {
            m_Instances.Add(this);
        }

        public override void OnAfterDelete()
        {
            m_Instances.Remove(this);

            base.OnAfterDelete();
        }

        public override bool AlwaysMurderer { get { return true; } }

        public override int GetAngerSound() { return 1550; }
        public override int GetHurtSound() { return 1552; }
        public override int GetDeathSound() { return 1551; }
       
        public class InternalSelfDeleteTimer : Timer
        {
            private Shadowlord Mare;

            public InternalSelfDeleteTimer(Mobile p) : base(TimeSpan.FromMinutes(180))
            {
                Priority = TimerPriority.FiveSeconds;
                Mare = ((Shadowlord)p);
            }
            protected override void OnTick()
            {
                if (Mare.Map != Map.Internal)
                {
                    Mare.Delete();
                    this.Stop();
                }
            }
        }

        public static Shadowlord Spawn(Point3D platLoc, Map platMap)
        {
            if (m_Instances.Count > 0)
                return null;

            Shadowlord creature = new Shadowlord();
            creature.Home = platLoc;
            creature.RangeHome = 4;
            creature.MoveToWorld(platLoc, platMap);

            return creature;
        }

        public override Poison PoisonImmune { get { return Poison.Lethal; } }

        public override void GenerateLoot()
        {
            this.AddLoot(LootPack.SuperBoss, 4);
            this.AddLoot(LootPack.FilthyRich);
        }

        public override void CheckReflect(Mobile caster, ref bool reflect)
        {
            int c = 0;
            foreach (Mobile m in this.GetMobilesInRange(20))
            {
                if (m != null && m is DarkWisp)
                    c++;
                continue;
            }
            if (c > 0)
                reflect = true; // Reflect spells if ShadowLord having wisps around
        }

        public override bool DrainsLife { get { return true; } }
        public override double DrainsLifeChance { get { return 0.25; } }

        public override void DrainLife()
        {
            if (this.Map == null)
                return;

            ArrayList list = new ArrayList();
            int count = 0;

            foreach (Mobile m in this.GetMobilesInRange(20))
            {
                if (m == this || !this.CanBeHarmful(m))
                {
                    if (m is DarkWisp) { count++; }
                    continue;
                }

                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team))
                    list.Add(m);
                else if (m.Player)
                    list.Add(m);
            }

            foreach (Mobile m in list)
            {
                this.DoHarmful(m);

                m.FixedParticles(0x374A, 10, 15, 5013, 0x496, 0, EffectLayer.Waist);
                m.PlaySound(0x231);

                m.SendMessage("You feel the life drain out of you!");

                int toDrain = count * 10;

                this.Hits += toDrain;
                (new DarkWisp()).MoveToWorld(new Point3D(this.Location), this.Map);
                int teleportchance = Hits / HitsMax;

                if (teleportchance < Utility.RandomDouble() && m.Alive)
                    switch (Utility.Random(6))
                    {
                        case 0: m.MoveToWorld(new Point3D(6431, 1664, 0), this.Map); break;
                        case 1: m.MoveToWorld(new Point3D(6432, 1634, 0), this.Map); break;
                        case 2: m.MoveToWorld(new Point3D(6401, 1657, 0), this.Map); break;
                        case 3: m.MoveToWorld(new Point3D(6401, 1637, 0), this.Map); break;
                        default: m.MoveToWorld(new Point3D(this.Location), this.Map); break;
                    }

                m.Damage(toDrain, this);
            }
        }

        public override void OnDeath(Container c)
        {
            List<DamageStore> rights = GetLootingRights();

            foreach (DamageStore ds in rights.Where(s => s.m_HasRight))
            {
                int luck = ds.m_Mobile is PlayerMobile ? ((PlayerMobile)ds.m_Mobile).RealLuck : ds.m_Mobile.Luck;
                int chance = 75 + (luck / 15);

                if (chance > Utility.Random(5000))
                {
                    Mobile m = ds.m_Mobile;
                    Item artifact = Loot.Construct(ArtifactDrops[Utility.Random(ArtifactDrops.Length)]);

                    if (artifact != null)
                    {
                        if (m.Backpack == null || !m.Backpack.TryDropItem(m, artifact, false))
                        {
                            m.BankBox.DropItem(artifact);
                            m.SendMessage("For your valor in combating the fallen beast, a special reward has been placed in your bankbox.");
                        }
                        else
                            m.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special reward has been bestowed on you.
                    }
                }
            }

            base.OnDeath(c);
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write((int)0); // version

            writer.Write((int)this.m_Type);

        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            switch (version)
            {
                case 0:
                    {
                        this.m_Type = (ShadowlordType)reader.ReadInt();

                        break;
                    }
            }

            Timer SelfDeleteTimer = new InternalSelfDeleteTimer(this);
            SelfDeleteTimer.Start();
        }
    }
}
 
you need only OnDeath method for generate special loot:
Code:
using System;
using Server.Items;

namespace Server.Mobiles
{
    public class ArtifactBrigand : Brigand
    {
        private static Type[] m_ArtifactRarity11 = new Type[]
     {
                typeof( WeaponSpeedIncreaseDeed ),
                typeof( WeaponDamageIncreaseDeed ),
                typeof( UseBestSkillIncreaseDeed ),
                typeof( SpellDamageIncreaseDeed ),
                typeof( HolyKnightsBreastplate ),
                typeof( SpellChannelingIncreaseDeed ),
                typeof( RegenStamIncreaseDeed ),
                typeof( RegenManaIncreaseDeed ),
                typeof( OrnateCrownOfTheHarrower ),
                typeof( ShadowDancerLeggings ),
                typeof( RegenHitsIncreaseDeed ),
                typeof( ReflectPhysicalIncreaseDeed ),
                typeof( MageWeaponIncreaseDeed ),
                typeof( LuckIncreaseDeed ),
                typeof( LowerRegCostIncreaseDeed ),
                typeof( LowerManaCostIncreaseDeed ),
                typeof( HitPoisonAreaIncreaseDeed ),
                typeof( HitPhysicalAreaIncreaseDeed ),
                typeof( HitMagicArrowIncreaseDeed ),
                typeof( HitLowerDefendIncreaseDeed ),
                typeof( HitLowerAttackIncreaseDeed ),
                typeof( HitLightningIncreaseDeed ),
                typeof( HitLeechStamIncreaseDeed ),
                typeof( HitLeechManaIncreaseDeed ),
                typeof( HitLeechHitsIncreaseDeed ),
                typeof( HitHarmIncreaseDeed ),
                typeof( HitFireballIncreaseDeed ),
                typeof( HitFireAreaIncreaseDeed ),
                typeof( HitEnergyAreaIncreaseDeed ),
                typeof( HitDispelIncreaseDeed ),
                typeof( HitColdAreaIncreaseDeed ),
                typeof( DefendChanceIncreaseDeed ),
                typeof( CastSpeedIncreaseDeed ),
                typeof( BonusStrIncreaseDeed ),
                typeof( BonusStamIncreaseDeed ),
                typeof( BonusManaIncreaseDeed ),
                typeof( BonusIntIncreaseDeed ),
                typeof( BonusHitsIncreaseDeed ),
                typeof( BonusDexIncreaseDeed ),
                typeof( AttackChanceIncreaseDeed )
     };

        [Constructable]
        public ArtifactBrigand()
            : base()
        {
        }

        public ArtifactBrigand(Serial serial)
            : base(serial)
        {
        }


        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            Mobile mobile = DemonKnight.FindRandomPlayer(this);
            double chance = Utility.RandomDouble();

            if (chance < 0.05) // 5% chance for drop
            {                mobile.AddToBackpack(Loot.Construct(m_ArtifactRarity11[Utility.Random(m_ArtifactRarity11.Length)]));
                mobile.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special reward has been bestowed on you.
            }
        }

        public override void GenerateLoot()
        {
            AddLoot(LootPack.Average);
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }
}
 
Oh how do I copy, and paste this what line number do I start, and thank you this looks great, but can you help copy, and paste it in for me on the first one I posted above?
 
Oh how do I copy, and paste this what line number do I start, and thank you this looks great, but can you help copy, and paste it in for me on the first one I posted above?
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;

namespace Server.Mobiles
{
    [CorpseName("a Deed Collectors corpse")]
    public class DeedCollectors : BaseCreature
    {
        private static Type[] m_ArtifactRarity11 = new Type[]
            {
                typeof( WeaponSpeedIncreaseDeed ),
                typeof( WeaponDamageIncreaseDeed ),
                typeof( UseBestSkillIncreaseDeed ),
                typeof( SpellDamageIncreaseDeed ),
                typeof( HolyKnightsBreastplate ),
                typeof( SpellChannelingIncreaseDeed ),
                typeof( RegenStamIncreaseDeed ),
                typeof( RegenManaIncreaseDeed ),
                typeof( OrnateCrownOfTheHarrower ),
                typeof( ShadowDancerLeggings ),
                typeof( RegenHitsIncreaseDeed ),
                typeof( ReflectPhysicalIncreaseDeed ),
                typeof( MageWeaponIncreaseDeed ),
                typeof( LuckIncreaseDeed ),
                typeof( LowerRegCostIncreaseDeed ),
                typeof( LowerManaCostIncreaseDeed ),
                typeof( HitPoisonAreaIncreaseDeed ),
                typeof( HitPhysicalAreaIncreaseDeed ),
                typeof( HitMagicArrowIncreaseDeed ),
                typeof( HitLowerDefendIncreaseDeed ),
                typeof( HitLowerAttackIncreaseDeed ),
                typeof( HitLightningIncreaseDeed ),
                typeof( HitLeechStamIncreaseDeed ),
                typeof( HitLeechManaIncreaseDeed ),
                typeof( HitLeechHitsIncreaseDeed ),
                typeof( HitHarmIncreaseDeed ),
                typeof( HitFireballIncreaseDeed ),
                typeof( HitFireAreaIncreaseDeed ),
                typeof( HitEnergyAreaIncreaseDeed ),
                typeof( HitDispelIncreaseDeed ),
                typeof( HitColdAreaIncreaseDeed ),
                typeof( DefendChanceIncreaseDeed ),
                typeof( CastSpeedIncreaseDeed ),
                typeof( BonusStrIncreaseDeed ),
                typeof( BonusStamIncreaseDeed ),
                typeof( BonusManaIncreaseDeed ),
                typeof( BonusIntIncreaseDeed ),
                typeof( BonusHitsIncreaseDeed ),
                typeof( BonusDexIncreaseDeed ),
                typeof( AttackChanceIncreaseDeed )
            };

        public override WeaponAbility GetWeaponAbility()
        {
            switch (Utility.Random(3))
            {
                default:
                case 0: return WeaponAbility.DoubleStrike;
                case 1: return WeaponAbility.WhirlwindAttack;
                case 2: return WeaponAbility.CrushingBlow;
            }
        }

        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            Mobile mobile = DemonKnight.FindRandomPlayer(this);
            double chance = Utility.RandomDouble();

            if (chance < 0.05) // 5% chance for drop
            {
                mobile.AddToBackpack(Loot.Construct(m_ArtifactRarity11[Utility.Random(m_ArtifactRarity11.Length)]));
                mobile.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special reward has been bestowed on you.
            }
        }

        [Constructable]
        public DeedCollectors() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            Name = "the Deed Collectors";
            Body = 318;
            BaseSoundID = 0x165;

            SetStr(500);
            SetDex(100);
            SetInt(1000);

            SetHits(15000);
            SetMana(5000);

            SetDamage(10, 15);

            SetDamageType(ResistanceType.Physical, 20);
            SetDamageType(ResistanceType.Fire, 20);
            SetDamageType(ResistanceType.Cold, 20);
            SetDamageType(ResistanceType.Poison, 20);
            SetDamageType(ResistanceType.Energy, 20);

            SetResistance(ResistanceType.Physical, 30);
            SetResistance(ResistanceType.Fire, 0);
            SetResistance(ResistanceType.Cold, 0);
            SetResistance(ResistanceType.Poison, 30);
            SetResistance(ResistanceType.Energy, 0);

            SetSkill(SkillName.Necromancy, 120, 120.0);
            SetSkill(SkillName.SpiritSpeak, 120.0, 120.0);

            SetSkill(SkillName.DetectHidden, 80.0);
            SetSkill(SkillName.EvalInt, 100.0);
            SetSkill(SkillName.Magery, 100.0);
            SetSkill(SkillName.Meditation, 120.0);
            SetSkill(SkillName.MagicResist, 150.0);
            SetSkill(SkillName.Tactics, 100.0);
            SetSkill(SkillName.Wrestling, 120.0);

            Fame = 28000;
            Karma = -28000;

            VirtualArmor = 64;
        }

        public override void GenerateLoot()
        {
            AddLoot(LootPack.SuperBoss, 5);
            AddLoot(LootPack.HighScrolls, Utility.RandomMinMax(0, 0));
        }

        public override bool BardImmune { get { return !Core.SE; } }
        public override bool Unprovokable { get { return Core.SE; } }
        public override bool AreaPeaceImmune { get { return Core.SE; } }
        public override Poison PoisonImmune { get { return Poison.Lethal; } }

        public override int TreasureMapLevel { get { return 1; } }

        private static bool m_InHere;

        public override void OnDamage(int amount, Mobile from, bool willKill)
        {
            if (from != null && from != this && !m_InHere)
            {
                m_InHere = true;
                AOS.Damage(from, this, Utility.RandomMinMax(0, 0), 100, 0, 0, 0, 0);

                MovingEffect(from, 0xECA, 10, 0, false, false, 0, 0);
                PlaySound(0x491);

                if (0.05 > Utility.RandomDouble())
                    Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback(CreateBones_Callback), from);

                m_InHere = false;
            }
        }

        public virtual void CreateBones_Callback(object state)
        {
            Mobile from = (Mobile)state;
            Map map = from.Map;

            if (map == null)
                return;

            int count = Utility.RandomMinMax(0, 0);

            for (int i = 0; i < count; ++i)
            {
                int x = from.X + Utility.RandomMinMax(-1, 1);
                int y = from.Y + Utility.RandomMinMax(-1, 1);
                int z = from.Z;

                if (!map.CanFit(x, y, z, 16, false, true))
                {
                    z = map.GetAverageZ(x, y);

                    if (z == from.Z || !map.CanFit(x, y, z, 16, false, true))
                        continue;
                }

                UnholyBone bone = new UnholyBone();

                bone.Hue = 0;
                bone.Name = "unholy bones";
                bone.ItemID = Utility.Random(0xECA, 9);

                bone.MoveToWorld(new Point3D(x, y, z), map);
            }
        }

        public DeedCollectors(Serial serial) : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write((int)0);
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
        }
    }
}
 
O.K. found a bug in that script [kill command cause a crash, but if you damage it first, and do [kill it is fine, but if no damage, and if you do [kill it crash.

I'm thinking maybe it is trying to give the item, but it can't figure it out cause there is no damage being done.
 
O.K. found a bug in that script [kill command cause a crash, but if you damage it first, and do [kill it is fine, but if no damage, and if you do [kill it crash.

I'm thinking maybe it is trying to give the item, but it can't figure it out cause there is no damage being done.
That's right, we're trying to find a random player in the murder, among all those who hurt the monster.
Code:
 Mobile mobile = DemonKnight.FindRandomPlayer(this);
need to add a check that if the players were not found. Change method for next:

Code:
        public override void OnDeath(Container c)
        {
            base.OnDeath(c);
            Mobile mobile = DemonKnight.FindRandomPlayer(this);
if (mobile != null)
{
            double chance = Utility.RandomDouble();
            if (chance < 0.05) // 5% chance for drop
            {
                mobile.AddToBackpack(Loot.Construct(m_ArtifactRarity11[Utility.Random(m_ArtifactRarity11.Length)]));
                mobile.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special reward has been bestowed on you.
            }
}
        }
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back