public override void OnDoubleClick(Mobile from) { Container backpack = from.Backpack; CopperIngot item1 = (CopperIngot)backpack.FindItemByType(typeof(CopperIngot)); if (item1 != null) { BaseIngot m_Ore1 = item1 as BaseIngot; int toConsume = m_Ore1.Amount; if ((m_Ore1.Amount > 499) && (m_Ore1.Amount < 501)) { m_Ore1.Delete(); from.SendLocalizedMessage(1113048); // You've successfully converted the metal. from.AddToBackpack(new VeriteIngot(500)); Delete(); } else if ((m_Ore1.Amount < 500) || (m_Ore1.Amount > 500)) { from.SendLocalizedMessage(1113046); // You can only convert five hundred ingots at a time. } } else { from.SendLocalizedMessage(1078618); // The item must be in your backpack to be exchanged. } }
public override void OnDoubleClick(Mobile from) { Container backpack = from.Backpack; DullCopperIngot item1 = (DullCopperIngot)backpack.FindItemByType(typeof(DullCopperIngot)); if (item1 != null) { BaseIngot m_Ore1 = item1 as BaseIngot; int toConsume = m_Ore1.Amount; if ((m_Ore1.Amount > 499) && (m_Ore1.Amount < 501)) { m_Ore1.Delete(); from.SendMessage("You've successfully converted the Metal."); from.AddToBackpack(new GoldIngot(500)); this.Delete(); } else if ((m_Ore1.Amount < 500) || (m_Ore1.Amount > 500)) { from.SendMessage("You can only convert 500 Dull Copper Ingots at a time."); } } else { from.SendMessage("There isn't DullCopper Ingots in your Backpack."); } }
public override void OnDoubleClick(Mobile from) { Container backpack = from.Backpack; IronIngot item1 = (IronIngot)backpack.FindItemByType(typeof(IronIngot)); if (item1 != null) { BaseIngot m_Ore1 = item1 as BaseIngot; int toConsume = m_Ore1.Amount; if ((m_Ore1.Amount > 499) && (m_Ore1.Amount < 501)) { m_Ore1.Delete(); switch (Utility.Random(4)) { case 0: from.AddToBackpack(new DullCopperIngot(500)); break; case 2: from.AddToBackpack(new ShadowIronIngot(500)); break; case 1: from.AddToBackpack(new CopperIngot(500)); break; case 3: from.AddToBackpack(new BronzeIngot(500)); break; } from.SendMessage("You've successfully converted the Metal."); this.Delete(); } else if ((m_Ore1.Amount < 500) || (m_Ore1.Amount > 500)) { from.SendMessage("You can only convert 500 Iron Ingots at a time."); } } else { from.SendMessage("There isn't Iron Ingots in your Backpack."); } }
public override void OnDoubleClick(Mobile from) { Container backpack = from.Backpack; IronIngot item1 = (IronIngot)backpack.FindItemByType(typeof(IronIngot)); if (item1 != null) { BaseIngot m_Ore1 = item1 as BaseIngot; int toConsume = m_Ore1.Amount; if ((m_Ore1.Amount > 499) && (m_Ore1.Amount < 501)) { m_Ore1.Delete(); switch (Utility.Random(4)) { case 0: from.AddToBackpack(new DullCopperIngot(500)); break; case 2: from.AddToBackpack(new ShadowIronIngot(500)); break; case 1: from.AddToBackpack(new CopperIngot(500)); break; case 3: from.AddToBackpack(new BronzeIngot(500)); break; } from.SendLocalizedMessage(1113048); // You've successfully converted the metal. this.Delete(); } else if ((m_Ore1.Amount < 500) || (m_Ore1.Amount > 500)) { from.SendLocalizedMessage(1113046); // You can only convert five hundred ingots at a time. } } else { from.SendLocalizedMessage(1078618); // The item must be in your backpack to be exchanged. } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Deed.Deleted) { return; } int number; if (m_Deed.Commodity != null) { number = 1047028; // The commodity deed has already been filled. } else if (targeted is Item) { BankBox box = from.FindBankNoCreate(); string XferResource = "..."; int XferAmount = 0; int r = 0; if (box != null && m_Deed.IsChildOf(box) && ((Item)targeted).IsChildOf(box)) { // RESOURCE EDIT if (targeted is BaseIngot) // || targeted is BaseBoards || targeted is BaseLog || targeted is BaseLeather || targeted is BaseScales || targeted is BasePowder || targeted is BaseCrystal) { from.SendMessage("You require a 'Special Commodity Deed' for this custom resource item..."); number = 1047027; m_Deed.Delete(); BaseIngot youringots = (BaseIngot)targeted; string s_resource = Convert.ToString(youringots.Resource); XferAmount = youringots.Amount; switch (s_resource) { case "Iron": r = 1; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youringots.Delete(); break; case "DullCopper": r = 2; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youringots.Delete(); break; case "ShadowIron": r = 3; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youringots.Delete(); break; case "Copper": r = 4; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youringots.Delete(); break; case "Bronze": r = 5; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youringots.Delete(); break; case "Gold": r = 6; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youringots.Delete(); break; case "Silver": r = 7; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youringots.Delete(); break; case "Agapite": r = 8; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youringots.Delete(); break; case "Verite": r = 9; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youringots.Delete(); break; case "Valorite": r = 10; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youringots.Delete(); break; case "Jade": r = 11; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youringots.Delete(); break; case "Moonstone": r = 12; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youringots.Delete(); break; case "Sunstone": r = 13; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youringots.Delete(); break; //case "": r = 13; box.DropItem(new YaksCommodityDeed(XferAmount, r)); youringots.Delete(); break; } } else if (targeted is BaseLeather) // || targeted is BaseBoards || targeted is BaseLog || targeted is BaseLeather || targeted is BaseScales || targeted is BasePowder || targeted is BaseCrystal) { from.SendMessage("You require a 'Special Commodity Deed' for this custom resource item..."); number = 1047027; m_Deed.Delete(); BaseLeather youritem = (BaseLeather)targeted; string s_resource = Convert.ToString(youritem.Resource); XferAmount = youritem.Amount; switch (s_resource) { case "RegularLeather": r = 101; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "SpinedLeather": r = 102; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "HornedLeather": r = 103; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "BarbedLeather": r = 104; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "DaemonLeather": r = 105; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "DragonLeather": r = 106; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; } } else if (targeted is BaseScales) // || targeted is BaseBoards || targeted is BaseLog || targeted is BaseLeather || targeted is BaseScales || targeted is BasePowder || targeted is BaseCrystal) { from.SendMessage("You require a 'Special Commodity Deed' for this custom resource item..."); number = 1047027; m_Deed.Delete(); BaseScales youritem = (BaseScales)targeted; string s_resource = Convert.ToString(youritem.Resource); XferAmount = youritem.Amount; switch (s_resource) { case "RedScales": r = 201; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "YellowScales": r = 202; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "BlackScales": r = 203; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "GreenScales": r = 204; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "WhiteScales": r = 205; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "BlueScales": r = 206; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; //case "IceScales": r = 207; box.DropItem(new YaksCommodityDeed(XferAmount, r)); youritem.Delete(); break; } } else if (targeted is BaseLog)// || targeted is BaseLog || targeted is BaseLeather || targeted is BaseScales || targeted is BasePowder || targeted is BaseCrystal) { from.SendMessage("You require a 'Special Commodity Deed' for this custom resource item..."); number = 1047027; m_Deed.Delete(); BaseLog youritem = (BaseLog)targeted; string s_resource = Convert.ToString(youritem.Resource); XferAmount = youritem.Amount; switch (s_resource) { case "Regular": r = 301; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Oak": r = 302; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Ash": r = 303; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Yew": r = 304; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Heartwood": r = 305; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Bloodwood": r = 306; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Frostwood": r = 307; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Pine": r = 308; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Cedar": r = 309; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Cherry": r = 310; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Mahogany": r = 311; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; } } else if (targeted is BaseBoards)// || targeted is BaseLog || targeted is BaseLeather || targeted is BaseScales || targeted is BasePowder || targeted is BaseCrystal) { from.SendMessage("You require a 'Special Commodity Deed' for this custom resource item..."); number = 1047027; m_Deed.Delete(); BaseBoards youritem = (BaseBoards)targeted; string s_resource = Convert.ToString(youritem.Resource); XferAmount = youritem.Amount; switch (s_resource) { case "Regular": r = 401; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Oak": r = 402; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Ash": r = 03; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Yew": r = 404; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Heartwood": r = 405; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Bloodwood": r = 406; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Frostwood": r = 407; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Pine": r = 408; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Cedar": r = 409; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Cherry": r = 410; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; case "Mahogany": r = 411; box.DropItem(new SpecialCommodityDeed(XferAmount, r)); youritem.Delete(); break; } } else { if (m_Deed.SetCommodity((Item)targeted)) { number = 1047030; // The commodity deed has been filled. } else { number = 1047027; // That is not a commodity the bankers will fill a commodity deed with. } } } else { number = 1047026; // That must be in your bank box to use it. } } else { number = 1047027; // That is not a commodity the bankers will fill a commodity deed with. } from.SendLocalizedMessage(number); }