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