Example #1
0
        public static BaseRunescapeGem FindGem(Mobile from, Ores oreType, RunescapePickaxe pick)
        {
            BaseRunescapeGem gem      = null;
            double           chance   = 0.005; // Half of 1%
            Item             necklace = from.FindItemOnLayer(Layer.Neck);

            if (necklace != null && necklace is AmuletOfGlory)
            {
                chance = 0.015;                                                           // Increased to 1.5% chance if wearing Glory Ammy
            }
            chance = oreType >= Ores.Mithril ? chance + 0.005 : chance;                   // increased by another half percent if Mith rock and above
            chance = pick.WeaponType >= RuneWeaponType.Mithril ? chance + 0.005 : chance; // increased by another half percent if Mith pick and above

            if (chance > Utility.RandomDouble())
            {
                int select = Utility.Random(100);

                if (select > 97)
                {
                    gem = new DiamondGem();
                }
                else if (select > 90)
                {
                    gem = new RubyGem();
                }
                else if (select > 60)
                {
                    gem = new EmeraldGem();
                }
                else
                {
                    gem = new SapphhireGem();
                }
            }

            return(gem);
        }
        public static BaseRunescapeGem FindGem(Mobile from, Ores oreType, RunescapePickaxe pick)
        {
            BaseRunescapeGem gem = null;
            double chance = 0.005; // Half of 1%
            Item necklace = from.FindItemOnLayer(Layer.Neck);
            if (necklace != null && necklace is AmuletOfGlory)
                chance = 0.015; // Increased to 1.5% chance if wearing Glory Ammy
            chance = oreType >= Ores.Mithril ? chance + 0.005 : chance; // increased by another half percent if Mith rock and above
            chance = pick.WeaponType >= RuneWeaponType.Mithril ? chance + 0.005 : chance; // increased by another half percent if Mith pick and above

            if (chance > Utility.RandomDouble())
            {
                int select = Utility.Random(100);

                if (select>97) gem=new DiamondGem();
                else if (select>90) gem = new RubyGem();
                else if (select>60) gem=new EmeraldGem();
                else gem = new SapphhireGem();
            }

            return gem;
        }