public override bool OnDragDrop(Mobile from, Item item) { if (PackAnimal.CheckAccess(this, from)) { if (item is BaseOre) { BaseOre m_Ore = item as BaseOre; int toConsume = m_Ore.Amount; if (toConsume > 30000) { toConsume = 30000; } else if (m_Ore.Amount < 2) { from.SendLocalizedMessage(501989); // You burn away the impurities but are left with no useable metal. m_Ore.Delete(); return(true); } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = toConsume * 2; m_Ore.Consume(toConsume); from.PlaySound(0x57); AddToBackpack(ingot); return(true); } } return(base.OnDragDrop(from, item)); }
public void ConvertOretoIngot(Mobile from) { this.Skills.Mining.Cap = 120; Container backpack = this.Backpack; BankBox bank = from.BankBox; IronOre item = (IronOre)backpack.FindItemByType(typeof(IronOre)); if (item is BaseOre) { BaseOre m_Ore = item as BaseOre; int toConsume = m_Ore.Amount; if (toConsume > 30000) { toConsume = 30000; } else if (m_Ore.Amount < 2) { m_Ore.Delete(); } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = toConsume * 2; m_Ore.Consume(toConsume); this.PlaySound(0x57); this.AddToBackpack(item); this.AddToBackpack(ingot); } ShadowOre item1 = (ShadowOre)backpack.FindItemByType(typeof(ShadowOre)); if (item1 is BaseOre) { BaseOre m_Ore = item1 as BaseOre; int toConsume = m_Ore.Amount; if (toConsume > 30000) { toConsume = 30000; } else if (m_Ore.Amount < 2) { m_Ore.Delete(); } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = toConsume * 2; m_Ore.Consume(toConsume); this.PlaySound(0x57); this.AddToBackpack(item); this.AddToBackpack(ingot); } BronzeOre item2 = (BronzeOre)backpack.FindItemByType(typeof(BronzeOre)); if (item2 is BaseOre) { BaseOre m_Ore = item2 as BaseOre; int toConsume = m_Ore.Amount; if (toConsume > 30000) { toConsume = 30000; } else if (m_Ore.Amount < 2) { m_Ore.Delete(); } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = toConsume * 2; m_Ore.Consume(toConsume); this.PlaySound(0x57); this.AddToBackpack(item); this.AddToBackpack(ingot); } CopperOre item3 = (CopperOre)backpack.FindItemByType(typeof(CopperOre)); if (item3 is BaseOre) { BaseOre m_Ore = item3 as BaseOre; int toConsume = m_Ore.Amount; if (toConsume > 30000) { toConsume = 30000; } else if (m_Ore.Amount < 2) { m_Ore.Delete(); } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = toConsume * 2; m_Ore.Consume(toConsume); this.PlaySound(0x57); this.AddToBackpack(item); this.AddToBackpack(ingot); } GoldOre item4 = (GoldOre)backpack.FindItemByType(typeof(GoldOre)); if (item4 is BaseOre) { BaseOre m_Ore = item4 as BaseOre; int toConsume = m_Ore.Amount; if (toConsume > 30000) { toConsume = 30000; } else if (m_Ore.Amount < 2) { m_Ore.Delete(); } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = toConsume * 2; m_Ore.Consume(toConsume); this.PlaySound(0x57); this.AddToBackpack(item); this.AddToBackpack(ingot); } DullcopperOre item5 = (DullcopperOre)backpack.FindItemByType(typeof(DullcopperOre)); if (item5 is BaseOre) { BaseOre m_Ore = item5 as BaseOre; int toConsume = m_Ore.Amount; if (toConsume > 30000) { toConsume = 30000; } else if (m_Ore.Amount < 2) { m_Ore.Delete(); } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = toConsume * 2; m_Ore.Consume(toConsume); this.PlaySound(0x57); this.AddToBackpack(item); this.AddToBackpack(ingot); } AgapiteOre item6 = (AgapiteOre)backpack.FindItemByType(typeof(AgapiteOre)); if (item6 is BaseOre) { BaseOre m_Ore = item6 as BaseOre; int toConsume = m_Ore.Amount; if (toConsume > 30000) { toConsume = 30000; } else if (m_Ore.Amount < 2) { m_Ore.Delete(); } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = toConsume * 2; m_Ore.Consume(toConsume); this.PlaySound(0x57); this.AddToBackpack(item); this.AddToBackpack(ingot); } VeriteOre item7 = (VeriteOre)backpack.FindItemByType(typeof(VeriteOre)); if (item7 is BaseOre) { BaseOre m_Ore = item7 as BaseOre; int toConsume = m_Ore.Amount; if (toConsume > 30000) { toConsume = 30000; } else if (m_Ore.Amount < 2) { m_Ore.Delete(); } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = toConsume * 2; m_Ore.Consume(toConsume); this.PlaySound(0x57); this.AddToBackpack(item); this.AddToBackpack(ingot); } ValoriteOre item8 = (ValoriteOre)backpack.FindItemByType(typeof(ValoriteOre)); if (item8 is BaseOre) { BaseOre m_Ore = item8 as BaseOre; int toConsume = m_Ore.Amount; if (toConsume > 30000) { toConsume = 30000; } else if (m_Ore.Amount < 2) { m_Ore.Delete(); } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = toConsume * 2; m_Ore.Consume(toConsume); this.PlaySound(0x57); this.AddToBackpack(item); this.AddToBackpack(ingot); } }