jayates

Member
First of all i'm usind ServUO.
I've set the drop rates to all zeros in the DarknightCreeper.cs and still getting arties... everytime!
Testing this one before I set the others. Anyone know a good drop rate? here's my script:
Code:
using System;
using Server.Items;
using System.Collections.Generic;

namespace Server.Mobiles
{
    [CorpseName("a darknight creeper corpse")]
    public class DarknightCreeper : BaseCreature
    {
        public MonsterStatuetteType[] StatueTypes{ get{ return new MonsterStatuetteType[] { }; } }    
        private static readonly Type[] m_DoomArtifact = new Type[]
        {
            /*typeof(LegacyOfTheDreadLord),
            typeof(TheTaskmaster),
            typeof(TheDragonSlayer),
            typeof(ArmorOfFortune),
            typeof(GauntletsOfNobility),
            typeof(HelmOfInsight),
            typeof(HolyKnightsBreastplate),
            typeof(JackalsCollar),
            typeof(LeggingsOfBane),
            typeof(MidnightBracers),
            typeof(OrnateCrownOfTheHarrower),
            typeof(ShadowDancerLeggings),
            typeof(TunicOfFire),
            typeof(VoiceOfTheFallenKing),
            typeof(BraceletOfHealth),
            typeof(OrnamentOfTheMagician),
            typeof(RingOfTheElements),
            typeof(RingOfTheVile),
            typeof(Aegis),
            typeof(ArcaneShield),
            typeof(AxeOfTheHeavens),
            typeof(BladeOfInsanity),
            typeof(BoneCrusher),
            typeof(BreathOfTheDead),
            typeof(Frostbringer),
            typeof(SerpentsFang),
            typeof(StaffOfTheMagi),
            typeof(TheBeserkersMaul),
            typeof(TheDryadBow),
            typeof(DivineCountenance),
            typeof(HatOfTheMagi),
            typeof(HuntersHeaddress),
            typeof(SpiritOfTheTotem),*/
            typeof(AegisOfGrace),
            typeof(AnimatedLegsoftheInsaneTinker),
            typeof(ArmsOfArmstrong),
            typeof(BasiliskHideBreastplate),
            typeof(BouraTailShield),
            typeof(BrambleCoat),
            //typeof(BronzedArmoroftheValkyrie),  //not found?
            typeof(BulwarkLeggings),
            typeof(CastOffZombieSkin),
            typeof(CrownOfArcaneTemperament),
            typeof(DefenderOfTheMagus),
            typeof(DragonHideShield),
            typeof(DupresShield),
            typeof(EscutcheonDeAriadne),
            typeof(FeyLeggings),
            typeof(GargishSignOfChaos),
            typeof(GargishSignOfOrder),
            typeof(GargishWoodenShield),
            typeof(GauntletsOfAnger),
            typeof(GladiatorsCollar),
            typeof(GlovesOfSafeguarding),
            typeof(GlovesOfThePugilist),
            typeof(HealersTouch),
            typeof(HeartOfTheLion),
            typeof(HelmOfInsight),
            typeof(InquisitorsResolution),
            typeof(LeggingsOfEmbers),
            typeof(MantleOfTheFallen),
            typeof(MysticsGuard),
            typeof(OrcChieftainHelm),
            typeof(OrcishVisage),
            typeof(StitchersMittens),
            typeof(TwilightJacket)
        };
        [Constructable]
        public DarknightCreeper()
            : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            this.Name = NameList.RandomName("darknight creeper");
            this.Body = 313;
            this.BaseSoundID = 0xE0;

            this.SetStr(301, 330);
            this.SetDex(101, 110);
            this.SetInt(301, 330);

            this.SetHits(4000);

            this.SetDamage(22, 26);

            this.SetDamageType(ResistanceType.Physical, 85);
            this.SetDamageType(ResistanceType.Poison, 15);

            this.SetResistance(ResistanceType.Physical, 60);
            this.SetResistance(ResistanceType.Fire, 60);
            this.SetResistance(ResistanceType.Cold, 100);
            this.SetResistance(ResistanceType.Poison, 90);
            this.SetResistance(ResistanceType.Energy, 75);

            this.SetSkill(SkillName.DetectHidden, 80.0);
            this.SetSkill(SkillName.EvalInt, 118.1, 120.0);
            this.SetSkill(SkillName.Magery, 112.6, 120.0);
            this.SetSkill(SkillName.Meditation, 150.0);
            this.SetSkill(SkillName.Poisoning, 120.0);
            this.SetSkill(SkillName.MagicResist, 90.1, 90.9);
            this.SetSkill(SkillName.Tactics, 100.0);
            this.SetSkill(SkillName.Wrestling, 90.1, 90.9);
            this.SetSkill(SkillName.Necromancy, 120.1, 130.0);
            this.SetSkill(SkillName.SpiritSpeak, 120.1, 130.0);

            this.Fame = 22000;
            this.Karma = -22000;

            this.VirtualArmor = 34;
        }

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

        public static Type[] DoomArtifact  
        {
            get
            {
                return m_DoomArtifact;
            }
        }
      
        public override bool IgnoreYoungProtection
        {
            get
            {
                return Core.ML;
            }
        }
        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 bool BleedImmune
        {
            get
            {
                return true;
            }
        }
        public override Poison PoisonImmune
        {
            get
            {
                return Poison.Lethal;
            }
        }
        public override Poison HitPoison
        {
            get
            {
                return Poison.Lethal;
            }
        }
        public override int TreasureMapLevel
        {
            get
            {
                return 1;
            }
        }
        private static bool CheckLocation(Mobile m)
        {
            Region r = m.Region;

            if (r.IsPartOf(typeof(Server.Regions.HouseRegion)) || Server.Multis.BaseBoat.FindBoatAt(m, m.Map) != null)
                return false;
            //TODO: a CanReach of something check as opposed to above?

            if (r.IsPartOf("GauntletRegion"))
                return true;

            return (m.Map == Map.Malas);
        }

        public static void HandleKill(Mobile victim, Mobile killer)
        {

            PlayerMobile pm = killer as PlayerMobile;
            BaseCreature bc = victim as BaseCreature;

            if (!Core.AOS)
                return;
            //CHeck if players are in the region with the bosses
            if ( pm == null || bc == null || !CheckLocation(bc) || !CheckLocation(pm))
                return;
            //Make sure its a boss we killed!!
            bool boss = bc is Impaler || bc is DemonKnight || bc is DarknightCreeper || bc is FleshRenderer  || bc is ShadowKnight || bc is AbysmalHorror;
            if (!boss)
                return;
            
            double gpoints = pm.GauntletPoints;

            pm.GauntletPoints += (int)(bc.Fame * (1 + Math.Sqrt(pm.Luck) / 100))/2;

                //Increasing them will increase drops, over time.
                          //Exa.
                   // A = 0.001863316841; 
                   // B = 0.00001425531915;
                  
            //const double A = 0.000863316841;  //orig
            //const double B = 0.00000425531915;  //orig
           
            const double A = 0.000000000000;    //adjustment       
            const double B = 0.00000000000000;    //adjustment       

            double chance = A * Math.Pow(10, B * gpoints);
          

            double roll = Utility.RandomDouble();

            killer.PlaySound(0x5B4);

            if (chance > roll )
            {
                Item i = null;

                try
                {
                    i = Activator.CreateInstance(m_DoomArtifact[Utility.Random(m_DoomArtifact.Length)]) as Item;
                }
                catch
                {
                }

                if (i != null)
                {
                    pm.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.

                    if (!pm.PlaceInBackpack(i))
                    {
                        if (pm.BankBox != null && pm.BankBox.TryDropItem(killer, i, false))
                            pm.SendLocalizedMessage(1079730); // The item has been placed into your bank box.
                        else
                        {
                            pm.SendLocalizedMessage(1072523); // You find an artifact, but your backpack and bank are too full to hold it.
                            i.MoveToWorld(pm.Location, pm.Map);
                        }
                    }

                    pm.GauntletPoints = 0;
                }
            }
        }
     






















/*   
        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 override void GenerateLoot()
        {
            this.AddLoot(LootPack.UltraRich, 2);
        }

        public override bool OnBeforeDeath()
        {
            List<DamageStore> rights = GetLootingRights();

            Mobile winner = null;

            if (rights != null && rights.Count > 0)
            {
                rights.Sort();

                if(rights.Count >= 5)
                    winner = rights[Utility.Random(5)].m_Mobile;
                else if(rights.Count > 1)
                    winner = rights[Utility.Random(rights.Count)].m_Mobile;
                else
                    winner = rights[0].m_Mobile;
            }

            if(winner != null)
                GiveArtifact(winner, CreateArtifact(DoomArtifact));

                 Container pack = this.Backpack;
            if ( pack != null )
            {
                pack.Movable = true;
                pack.MoveToWorld( Location, Map );
            }

            Effects.SendLocationEffect( Location, Map, 0x376A, 10, 1 );
            return true;
        }

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

            Container pack = to.Backpack;

            if ( pack == null || !pack.TryDropItem( to, artifact, false ) )
                artifact.Delete();
            else
                to.SendLocalizedMessage( 1062317 ); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.
        }

        public bool IsEligible( Mobile m, Item Artifact )
        {
            return m.Player && m.Alive && m.InRange( Location, 32 ) && m.Backpack != null && m.Backpack.CheckHold( m, Artifact, false );
        }

        public Item CreateArtifact(Type[] list)
        {
            if (list.Length == 0)
                return null;

            int random = Utility.Random(list.Length);

            Type type = list[random];

            Item artifact = Loot.Construct(type);

            if (artifact is MonsterStatuette && StatueTypes.Length > 0)
            {
                ((MonsterStatuette)artifact).Type = StatueTypes[Utility.Random(StatueTypes.Length)];
                ((MonsterStatuette)artifact).LootType = LootType.Regular;
            }

            return artifact;
        }


        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();

            if (this.BaseSoundID == 471)
                this.BaseSoundID = 0xE0;
        }
    }
}
 
on lines 234 and 235 are my changes
[doublepost=1545010452][/doublepost]i'll try changing these numbers to this
A = 0.1863316841; B = 0.001425531915;
[doublepost=1545010652][/doublepost]Is that what you meant?
 
  1. double chance = A * Math.Pow(10, B * gpoints);

  2. double roll = Utility.RandomDouble
This is the algorithm you need to change, change those to equal 0. Then your chance will never be higher than your roll and the artist should stop dropping
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back