コード例 #1
0
 public InternalTimer(Mobile from, BaseMiningRocks miningRocks, RunescapePickaxe pickaxe)
     : base(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(2), 30)
 {
     player     = from;
     rocks      = miningRocks;
     pick       = pickaxe;
     successful = false;
     count      = 0;
 }
コード例 #2
0
        private Item SelectBestPick(Mobile from, Container pack)
        {
            RunescapePickaxe item = null;

            Item[] picks = pack.FindItemsByType(typeof(RunescapePickaxe));
            foreach (Item pickitem in picks)
            {
                if (pickitem is RunescapePickaxe)
                {
                    RunescapePickaxe pick = (RunescapePickaxe)pickitem;
                    if ((item != null && pick.WeaponType > item.WeaponType) || (item == null))
                    {
                        if (Utilities.CanUse(from, pick))
                        {
                            item = pick;
                        }
                    }
                }
            }

            return(item);
        }
コード例 #3
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);
        }
コード例 #4
0
ファイル: MiningRocks.cs プロジェクト: greeduomacro/RuneUO
 public InternalTimer(Mobile from, BaseMiningRocks miningRocks, RunescapePickaxe pickaxe)
     : base(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(2), 30)
 {
     player = from;
     rocks = miningRocks;
     pick = pickaxe;
     successful = false;
     count = 0;
 }
コード例 #5
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;
        }