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. } }
public void SmeltOre(Mobile from) { object forge = null; IPooledEnumerable eable = from.GetItemsInRange(2); foreach (Item item in eable) { if (IsForge(item)) { forge = item; break; } } eable.Free(); eable = from.GetMobilesInRange(2); foreach (Mobile mob in eable) { if (IsForge(mob)) { forge = mob; break; } } eable.Free(); if (forge == null) { for (int x = from.X - 2; forge == null && x < from.X + 2; x++) { for (int y = from.Y - 2; forge == null && y < from.Y + 2; y++) { StaticTile[] tiles = from.Map.Tiles.GetStaticTiles(x, y, true); for (int j = 0; forge == null && j < tiles.Length; j++) { StaticTarget st = new StaticTarget(tiles[j], tiles[j].ID); if (IsForge(st)) { forge = st; } } } } } if (forge != null) { double difficulty; switch (Resource) { default: difficulty = 50.0; break; case CraftResource.DullCopper: difficulty = 65.0; break; case CraftResource.ShadowIron: difficulty = 70.0; break; case CraftResource.Copper: difficulty = 75.0; break; case CraftResource.Bronze: difficulty = 80.0; break; case CraftResource.Gold: difficulty = 85.0; break; case CraftResource.Agapite: difficulty = 90.0; break; case CraftResource.Verite: difficulty = 95.0; break; case CraftResource.Valorite: difficulty = 99.0; break; } double minSkill = difficulty - 25.0; double maxSkill = difficulty + 25.0; if (difficulty > 50.0 && difficulty > from.Skills[SkillName.Mining].Value) { from.SendLocalizedMessage(501986); // You have no idea how to smelt this strange ore! } //else if ( Amount <= 1 ) // from.SendLocalizedMessage( 501987 ); // There is not enough metal-bearing ore in this pile to make an ingot. else { /* * int successes = 0; * int count = Amount / 2; * * for ( int i = 0;i < count; i++ ) * if ( from.CheckTargetSkill( SkillName.Mining, forge, minSkill, maxSkill ) ) * successes++; * * Consume( count * 2 ); * * if ( successes > 0 ) * { * string[] locals = new string[3]; * * BaseIngot ingot = GetIngot(); * ingot.Amount = successes; * * if ( Parent != from.Backpack && Parent is Container && RootParent == from && ((Container)Parent).TryDropItem( from, ingot, false ) ) //Its in a container, on the player * { * if ( locals[0] == null ) * locals[0] = "back in the same container"; * } * else if ( from.AddToBackpack( ingot ) ) * { * if ( locals[1] == null ) * locals[1] = "in your backpack"; * } * else if ( locals[2] == null ) * locals[2] = "on the floor"; * * string localText = String.Empty; * //Trimmed list * List<string> localslist = new List<string>(); * for ( int i = 0;i < locals.Length; i++ ) * if ( locals[i] != null ) * localslist.Add( locals[i] ); * * //We know there is at least ONE location * localText = localslist[0]; * * for ( int i = 1;i < localslist.Count; i++ ) * localText = String.Format( "{0},{1}{2}", localText, (i+1 < localslist.Count) ? " and" : " ", localslist[i] ); * * from.SendMessage( "You smelt the ore removing the impurities and put the metal {0}.", localText ); * } * else * from.SendLocalizedMessage( 501990 ); // You burn away the impurities but are left with less useable metal. * * from.PlaySound( 0x2B ); // Smelting/Bellow noise */ bool atcap = from.Skills[SkillName.Mining].Value > from.Skills[SkillName.Mining].Cap || from.Skills[SkillName.Mining].Value >= maxSkill; //int amountIngot = atcap ? (Amount / 2) : 1; //int amountOre = amountIngot * 2; int amountIngot = atcap ? Amount : 1; from.PlaySound(0x2B); // Smelting/Bellow noise if (from.CheckTargetSkill(SkillName.Mining, forge, minSkill, maxSkill)) { string[] locals = new string[3]; BaseIngot ingot = GetIngot(); double chanceOfDoublingIronSmelt = from.Skills[SkillName.Mining].Value / 200.0; // 50% chance at 100 if (ingot.Resource == CraftResource.Iron && chanceOfDoublingIronSmelt > Utility.RandomDouble()) // per 10 skill, 5% chance of 2 ingots { ingot.Amount = amountIngot * 2; from.SendMessage("You skillfully extract extra metal out of the ore pile."); } else { ingot.Amount = amountIngot; } if (Parent != from.Backpack && Parent is Container && RootParent == from && ((Container)Parent).TryDropItem(from, ingot, false)) //Its in a container, on the player { if (locals[0] == null) { locals[0] = "back in the same container"; } } else if (from.AddToBackpack(ingot)) { if (locals[1] == null) { locals[1] = "in your backpack"; } } else if (locals[2] == null) { locals[2] = "on the floor"; } string localText = String.Empty; //Trimmed list List <string> localslist = new List <string>(); for (int i = 0; i < locals.Length; i++) { if (locals[i] != null) { localslist.Add(locals[i]); } } //We know there is at least ONE location localText = localslist[0]; for (int i = 1; i < localslist.Count; i++) { localText = String.Format("{0},{1}{2}", localText, (i + 1 < localslist.Count) ? " and" : " ", localslist[i]); } from.SendMessage("You smelt the ore removing the impurities and put the metal {0}.", localText); Consume(amountIngot); } else { Consume(Math.Max(amountIngot / 2, 1)); from.SendLocalizedMessage(501990); // You burn away the impurities but are left with less useable metal. } } } else { from.SendLocalizedMessage(500420); // You are not near a forge. } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Ore.Deleted) { return; } if (!from.InRange(m_Ore.GetWorldLocation(), 2)) { from.SendLocalizedMessage(501976); // The ore is too far away. return; } if (targeted is DyeTub && m_Ore is Server.Misc.Coal && Server.Misc.Coal.CanMakeDyetub(from)) { DyeTub dt = (DyeTub)targeted; if (!dt.Redyable) { from.SendAsciiMessage("The color of that tub cannot be changed."); return; } if (dt.DyedHue == 0x497) { dt.UsesRemaining += 10; } else { dt.UsesRemaining = 10; } dt.DyedHue = 0x497; m_Ore.Consume(1); using (System.IO.StreamWriter w = new System.IO.StreamWriter(System.IO.Path.Combine(Core.BaseDirectory, "Coal.log"), true)) { w.AutoFlush = true; w.WriteLine("{0}", from); } } if (IsForge(targeted)) { double difficulty = 0; double minSkill = difficulty - 25.0; double maxSkill = difficulty + 25.0; if (difficulty > 50.0 && difficulty > from.Skills[SkillName.Mining].Value) { from.SendLocalizedMessage(501986); // You have no idea how to smelt this strange ore! return; } if (from.CheckTargetSkill(SkillName.Mining, targeted, minSkill, maxSkill)) { int toConsume = m_Ore.Amount; if (toConsume <= 0) { from.SendLocalizedMessage(501987); // There is not enough metal-bearing ore in this pile to make an ingot. } else { if (toConsume > 30000) { toConsume = 30000; } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = toConsume * 2; m_Ore.Consume(toConsume); from.AddToBackpack(ingot); //from.PlaySound( 0x57 ); from.SendLocalizedMessage(501988); // You smelt the ore removing the impurities and put the metal in your backpack. } } else if (m_Ore.Amount < 2) { from.SendLocalizedMessage(501989); // You burn away the impurities but are left with no useable metal. m_Ore.Delete(); } else { from.SendLocalizedMessage(501990); // You burn away the impurities but are left with less useable metal. m_Ore.Amount /= 2; } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Ore.Deleted) { return; } if (!from.InRange(m_Ore.GetWorldLocation(), 2)) { from.SendLocalizedMessage(501976); // The ore is too far away. return; } if (IsForge(targeted)) { double difficulty; switch (m_Ore.Resource) { default: difficulty = 50.0; break; case CraftResource.DullCopper: difficulty = 65.0; break; case CraftResource.ShadowIron: difficulty = 70.0; break; case CraftResource.Copper: difficulty = 75.0; break; case CraftResource.Bronze: difficulty = 80.0; break; case CraftResource.Gold: difficulty = 85.0; break; case CraftResource.Agapite: difficulty = 90.0; break; case CraftResource.Verite: difficulty = 95.0; break; case CraftResource.Valorite: difficulty = 99.0; break; } double minSkill = difficulty - 25.0; double maxSkill = difficulty + 25.0; if (difficulty > 50.0 && difficulty > from.Skills[SkillName.Mining].Value) { from.SendLocalizedMessage(501986); // You have no idea how to smelt this strange ore! return; } if (from.CheckTargetSkill(SkillName.Mining, targeted, minSkill, maxSkill)) { int toConsume = m_Ore.Amount; if (toConsume <= 0) { from.SendLocalizedMessage(501987); // There is not enough metal-bearing ore in this pile to make an ingot. } else { if (toConsume > 30000) { toConsume = 30000; } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = toConsume * 2; m_Ore.Consume(toConsume); from.AddToBackpack(ingot); //from.PlaySound( 0x57 ); from.SendLocalizedMessage(501988); // You smelt the ore removing the impurities and put the metal in your backpack. } } else if (m_Ore.Amount < 2) { from.SendLocalizedMessage(501989); // You burn away the impurities but are left with no useable metal. m_Ore.Delete(); } else { from.SendLocalizedMessage(501990); // You burn away the impurities but are left with less useable metal. m_Ore.Amount /= 2; } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Ore.Deleted) { return; } if (!from.InRange(m_Ore.GetWorldLocation(), 2)) { from.SendAsciiMessage("The ore is too far away."); // The ore is too far away. return; } if (IsForge(targeted)) { double difficulty; switch (m_Ore.Resource) { default: difficulty = 50.0; break; case CraftResource.DullCopper: difficulty = 65.0; break; case CraftResource.ShadowIron: difficulty = 70.0; break; case CraftResource.Copper: difficulty = 75.0; break; case CraftResource.Bronze: difficulty = 80.0; break; case CraftResource.Gold: difficulty = 85.0; break; case CraftResource.Agapite: difficulty = 90.0; break; case CraftResource.Verite: difficulty = 95.0; break; case CraftResource.Valorite: difficulty = 99.0; break; } double minSkill = difficulty - 25.0; double maxSkill = difficulty + 25.0; if (difficulty > 50.0 && difficulty > from.Skills[SkillName.Mining].Value) { from.SendAsciiMessage("You have no idea how to smelt this strange ore!"); // You have no idea how to smelt this strange ore! return; } int toConsume = m_Ore.Amount; if (m_Ore.ItemID == 0x19B7) { if (toConsume < 2) { from.SendAsciiMessage("There is not enough metal-bearing ore in this pile to make an ingot."); // There is not enough metal-bearing ore in this pile to make an ingot. return; } } else if (m_Ore.ItemID == 0x19B8 || m_Ore.ItemID == 0x19BA) { if (toConsume < 1) { from.SendAsciiMessage("There is not enough metal-bearing ore in this pile to make an ingot."); return; } } if (from.CheckTargetSkill(SkillName.Mining, targeted, minSkill, maxSkill)) { if (m_Ore.ItemID == 0x19B7) { if (toConsume < 2) { from.SendAsciiMessage("There is not enough metal-bearing ore in this pile to make an ingot."); // There is not enough metal-bearing ore in this pile to make an ingot. } else { int count = 0; while ((count + 2) <= m_Ore.Amount) { count += 2; } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = count / 2; m_Ore.Consume(count); from.AddToBackpack(ingot); //from.PlaySound( 0x57 ); from.SendAsciiMessage("You smelt the ore removing the impurities and put the metal in your backpack."); // You smelt the ore removing the impurities and put the metal in your backpack. } } else if (m_Ore.ItemID == 0x19B8 || m_Ore.ItemID == 0x19BA) { if (toConsume < 1) { from.SendAsciiMessage("There is not enough metal-bearing ore in this pile to make an ingot."); } else { if (toConsume > 60000) { toConsume = 60000; } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = toConsume; m_Ore.Consume(toConsume); from.AddToBackpack(ingot); //from.PlaySound( 0x57 ); from.SendAsciiMessage("You smelt the ore removing the impurities and put the metal in your backpack."); // You smelt the ore removing the impurities and put the metal in your backpack. } } else { if (toConsume <= 0) { from.SendAsciiMessage("There is not enough metal-bearing ore in this pile to make an ingot."); // There is not enough metal-bearing ore in this pile to make an ingot. } else { if (toConsume > 30000) { toConsume = 30000; } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = toConsume * 2; m_Ore.Consume(toConsume); from.AddToBackpack(ingot); //from.PlaySound( 0x57 ); from.SendAsciiMessage("You smelt the ore removing the impurities and put the metal in your backpack."); // You smelt the ore removing the impurities and put the metal in your backpack. } } } else if (m_Ore.Amount < 2) { from.SendAsciiMessage("You burn away the impurities but are left with no useable metal."); // You burn away the impurities but are left with no useable metal. m_Ore.Delete(); } else { from.SendAsciiMessage("You burn away the impurities but are left with less useable metal."); // You burn away the impurities but are left with less useable metal. m_Ore.Amount /= 2; } } else if (IsOrePile(targeted)) //combining stuff { if (m_Ore == targeted) { return; } BaseOre targetedOre = (BaseOre)targeted; int transferAmount = 0; int transferItemID = 0; if (IsLargeOrePile(m_Ore)) { if (IsLargeOrePile(targetedOre)) { transferAmount = m_Ore.Amount; transferItemID = targetedOre.ItemID; } else if (IsMediumOrePile(targetedOre)) { transferAmount = m_Ore.Amount * 2; transferItemID = targetedOre.ItemID; } else if (IsSmallOrePile(targetedOre)) { transferAmount = m_Ore.Amount * 4; transferItemID = targetedOre.ItemID; } } else if (IsMediumOrePile(m_Ore)) { if (IsLargeOrePile(targetedOre)) { transferAmount = targetedOre.Amount * 2; transferItemID = m_Ore.ItemID; } else if (IsMediumOrePile(targetedOre)) { transferAmount = m_Ore.Amount; transferItemID = m_Ore.ItemID; } else if (IsSmallOrePile(targetedOre)) { transferAmount = m_Ore.Amount * 2; transferItemID = targetedOre.ItemID; } } else if (IsSmallOrePile(m_Ore)) { if (IsLargeOrePile(targetedOre)) { transferAmount = targetedOre.Amount * 4; transferItemID = m_Ore.ItemID; } else if (IsMediumOrePile(targetedOre)) { transferAmount = targetedOre.Amount * 2; transferItemID = m_Ore.ItemID; } else if (IsSmallOrePile(targetedOre)) { transferAmount = m_Ore.Amount; transferItemID = m_Ore.ItemID; } } targetedOre.Amount += transferAmount; targetedOre.ItemID = transferItemID; m_Ore.Delete(); } }
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); }
protected override void OnTarget(Mobile from, object targeted) { if (m_Ore.Deleted) { return; } if (!from.InRange(m_Ore.GetWorldLocation(), 2)) { from.SendLocalizedMessage(501976); // The ore is too far away. return; } #region Combine Ore if (targeted is BaseOre) { BaseOre ore = (BaseOre)targeted; if (!ore.Movable) { return; } else if (m_Ore == ore) { from.SendLocalizedMessage(501972); // Select another pile or ore with which to combine this. from.Target = new InternalTarget(ore); return; } else if (ore.Resource != m_Ore.Resource) { from.SendLocalizedMessage(501979); // You cannot combine ores of different metals. return; } int worth = ore.Amount; if (ore.ItemID == 0x19B9) { worth *= 8; } else if (ore.ItemID == 0x19B7) { worth *= 2; } else { worth *= 4; } int sourceWorth = m_Ore.Amount; if (m_Ore.ItemID == 0x19B9) { sourceWorth *= 8; } else if (m_Ore.ItemID == 0x19B7) { sourceWorth *= 2; } else { sourceWorth *= 4; } worth += sourceWorth; int plusWeight = 0; int newID = ore.ItemID; if (ore.DefaultWeight != m_Ore.DefaultWeight) { if (ore.ItemID == 0x19B7 || m_Ore.ItemID == 0x19B7) { newID = 0x19B7; } else if (ore.ItemID == 0x19B9) { newID = m_Ore.ItemID; plusWeight = ore.Amount * 2; } else { plusWeight = m_Ore.Amount * 2; } } if ((ore.ItemID == 0x19B9 && worth > 120000) || ((ore.ItemID == 0x19B8 || ore.ItemID == 0x19BA) && worth > 60000) || (ore.ItemID == 0x19B7 && worth > 30000)) { from.SendLocalizedMessage(1062844); // There is too much ore to combine. return; } else if (ore.RootParent is Mobile && (plusWeight + ((Mobile)ore.RootParent).Backpack.TotalWeight) > ((Mobile)ore.RootParent).Backpack.MaxWeight) { from.SendLocalizedMessage(501978); // The weight is too great to combine in a container. return; } ore.ItemID = newID; if (ore.ItemID == 0x19B9) { ore.Amount = worth / 8; } else if (ore.ItemID == 0x19B7) { ore.Amount = worth / 2; } else { ore.Amount = worth / 4; } m_Ore.Delete(); return; } #endregion if (IsForge(targeted)) { double difficulty; switch (m_Ore.Resource) { default: difficulty = 50.0; break; case CraftResource.DullCopper: difficulty = 65.0; break; case CraftResource.ShadowIron: difficulty = 70.0; break; case CraftResource.Copper: difficulty = 75.0; break; case CraftResource.Bronze: difficulty = 80.0; break; case CraftResource.Gold: difficulty = 85.0; break; case CraftResource.Agapite: difficulty = 90.0; break; case CraftResource.Verite: difficulty = 95.0; break; case CraftResource.Valorite: difficulty = 99.0; break; case CraftResource.Rusty: difficulty = 99.0; break; case CraftResource.Silver: difficulty = 99.0; break; case CraftResource.PureCopper: difficulty = 99.0; break; case CraftResource.BronzeAlloy: difficulty = 99.0; break; case CraftResource.Shadow: difficulty = 99.0; break; case CraftResource.Rose: difficulty = 99.0; break; case CraftResource.Lime: difficulty = 99.0; break; case CraftResource.Fuscia: difficulty = 99.0; break; case CraftResource.Bloodrock: difficulty = 99.0; break; case CraftResource.ChromeBlue: difficulty = 99.0; break; case CraftResource.ChromeCopper: difficulty = 99.0; break; case CraftResource.Pansy: difficulty = 99.0; break; case CraftResource.Stinger: difficulty = 99.0; break; case CraftResource.Royal: difficulty = 99.0; break; case CraftResource.BlueSteel: difficulty = 99.0; break; case CraftResource.Ice: difficulty = 99.0; break; case CraftResource.Lemon: difficulty = 99.0; break; case CraftResource.Blackrock: difficulty = 99.0; break; case CraftResource.RoseQuartz: difficulty = 99.0; break; case CraftResource.Mint: difficulty = 99.0; break; case CraftResource.Aqua: difficulty = 99.0; break; case CraftResource.Daemon: difficulty = 99.0; break; case CraftResource.Mythril: difficulty = 99.0; break; case CraftResource.Titanium: difficulty = 99.0; break; case CraftResource.Kryptonite: difficulty = 99.0; break; case CraftResource.Diamond: difficulty = 99.0; break; case CraftResource.Jolt: difficulty = 99.0; break; case CraftResource.Uranium: difficulty = 99.0; break; case CraftResource.Opiate: difficulty = 99.0; break; case CraftResource.Negative: difficulty = 99.0; break; case CraftResource.Deus: difficulty = 99.0; break; case CraftResource.DarkDeus: difficulty = 99.0; break; } double minSkill = difficulty - 25.0; double maxSkill = difficulty + 25.0; if (difficulty > 50.0 && difficulty > from.Skills[SkillName.Mining].Value) { from.SendLocalizedMessage(501986); // You have no idea how to smelt this strange ore! return; } if (m_Ore.ItemID == 0x19B7 && m_Ore.Amount < 2) { from.SendLocalizedMessage(501987); // There is not enough metal-bearing ore in this pile to make an ingot. return; } if (from.CheckTargetSkill(SkillName.Mining, targeted, minSkill, maxSkill)) { int toConsume = m_Ore.Amount; if (toConsume <= 0) { from.SendLocalizedMessage(501987); // There is not enough metal-bearing ore in this pile to make an ingot. } else { if (toConsume > 30000) { toConsume = 30000; } int ingotAmount; if (m_Ore.ItemID == 0x19B7) { ingotAmount = toConsume / 2; if (toConsume % 2 != 0) { --toConsume; } } else if (m_Ore.ItemID == 0x19B9) { ingotAmount = toConsume * 2; } else { ingotAmount = toConsume; } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = ingotAmount; m_Ore.Consume(toConsume); from.AddToBackpack(ingot); //from.PlaySound( 0x57 ); from.SendLocalizedMessage(501988); // You smelt the ore removing the impurities and put the metal in your backpack. } } else { if (m_Ore.Amount < 2) { if (m_Ore.ItemID == 0x19B9) { m_Ore.ItemID = 0x19B8; } else { m_Ore.ItemID = 0x19B7; } } else { m_Ore.Amount /= 2; } from.SendLocalizedMessage(501990); // You burn away the impurities but are left with less useable metal. } } }
protected void SmeltOre(Mobile from) { if (Deleted) { return; } if (!from.InRange(GetWorldLocation(), 4) || !from.InLOS(this)) { from.SendAsciiMessage("The ore is too far away."); return; } if (IsForgeClose(from) == null) { from.SendAsciiMessage("You neeed to stand close to a forge to do this."); return; } double difficulty; switch (Resource) { default: difficulty = 0.0; break; case CraftResource.OldCopper: difficulty = 35.0; break; case CraftResource.ShadowIron: difficulty = 50.0; break; case CraftResource.Silver: difficulty = 55.0; break; case CraftResource.Verite: difficulty = 60.0; break; case CraftResource.Rose: difficulty = 65.0; break; case CraftResource.Gold: difficulty = 70.0; break; case CraftResource.Ice: difficulty = 72.5; break; case CraftResource.Havoc: difficulty = 72.5; break; case CraftResource.Valorite: difficulty = 75.0; break; case CraftResource.BloodRock: difficulty = 75.0; break; case CraftResource.Aqua: difficulty = 80.0; break; case CraftResource.Fire: difficulty = 82.0; break; case CraftResource.Mytheril: difficulty = 87.5; break; case CraftResource.SandRock: difficulty = 90.0; break; case CraftResource.BlackDiamond: difficulty = 92.5; break; case CraftResource.BlackRock: difficulty = 95.0; break; case CraftResource.Oceanic: difficulty = 97.0; break; case CraftResource.DaemonSteel: difficulty = 99.0; break; case CraftResource.Reactive: difficulty = 99.5; break; case CraftResource.Adamantium: difficulty = 100.0; break; case CraftResource.Sapphire: difficulty = 100.0; break; //Unused case CraftResource.DullCopper: difficulty = 65.0; break; case CraftResource.Copper: difficulty = 100.0; break; case CraftResource.Bronze: difficulty = 65.0; break; case CraftResource.Agapite: difficulty = 100.0; break; case CraftResource.Opiate: difficulty = 82.5; break; } double minSkill = difficulty - 25.0; double maxSkill = difficulty + 25.0; if (difficulty > 50.0 && difficulty > from.Skills[SkillName.Mining].Value) { from.SendAsciiMessage("You do not have the required skill to smelt this ore!"); return; } if (Amount <= 50 && from.Skills[SkillName.Mining].Value >= minSkill) { int toConsume = Amount; if (toConsume <= 0) { from.SendLocalizedMessage(501987); // There is not enough metal-bearing ore in this pile to make an ingot. } else { if (toConsume > 30000) { toConsume = 30000; } BaseIngot ingot = GetIngot(); ingot.Amount = toConsume; Consume(toConsume); from.AddToBackpack(ingot); from.SendLocalizedMessage(501988); // You smelt the ore removing the impurities and put the metal in your backpack. } } else if (from.CheckTargetSkill(SkillName.Mining, IsForgeClose(from), minSkill, maxSkill)) { int toConsume = Amount; if (toConsume <= 0) { from.SendLocalizedMessage(501987); // There is not enough metal-bearing ore in this pile to make an ingot. } else { if (toConsume > 30000) { toConsume = 30000; } BaseIngot ingot = GetIngot(); ingot.Amount = toConsume; Consume(toConsume); from.AddToBackpack(ingot); from.SendLocalizedMessage(501988); // You smelt the ore removing the impurities and put the metal in your backpack. } } else if (Amount < 2) { from.SendLocalizedMessage(501989); // You burn away the impurities but are left with no useable metal. Delete(); } else { from.SendLocalizedMessage(501990); // You burn away the impurities but are left with less useable metal. Amount /= 2; } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Ore.Deleted) { return; } if (!from.InRange(m_Ore.GetWorldLocation(), 2)) { from.SendLocalizedMessage(501976); // The ore is too far away. return; } #region Combine Ore if (targeted is BaseOre) { BaseOre ore = (BaseOre)targeted; if (!ore.Movable) { return; } else if (m_Ore == ore) { from.SendLocalizedMessage(501972); // Select another pile or ore with which to combine this. from.Target = new InternalTarget(ore); return; } else if (ore.Resource != m_Ore.Resource) { from.SendLocalizedMessage(501979); // You cannot combine ores of different metals. return; } int worth = ore.Amount; if (ore.ItemID == 0x19B9) { worth *= 8; } else if (ore.ItemID == 0x19B7) { worth *= 2; } else { worth *= 4; } int sourceWorth = m_Ore.Amount; if (m_Ore.ItemID == 0x19B9) { sourceWorth *= 8; } else if (m_Ore.ItemID == 0x19B7) { sourceWorth *= 2; } else { sourceWorth *= 4; } worth += sourceWorth; int plusWeight = 0; int newID = ore.ItemID; if (ore.DefaultWeight != m_Ore.DefaultWeight) { if (ore.ItemID == 0x19B7 || m_Ore.ItemID == 0x19B7) { newID = 0x19B7; } else if (ore.ItemID == 0x19B9) { newID = m_Ore.ItemID; plusWeight = ore.Amount * 2; } else { plusWeight = m_Ore.Amount * 2; } } if ((ore.ItemID == 0x19B9 && worth > 120000) || ((ore.ItemID == 0x19B8 || ore.ItemID == 0x19BA) && worth > 60000) || (ore.ItemID == 0x19B7 && worth > 30000)) { from.SendLocalizedMessage(1062844); // There is too much ore to combine. return; } else if (ore.RootParent is Mobile && (plusWeight + ((Mobile)ore.RootParent).Backpack.TotalWeight) > ((Mobile)ore.RootParent).Backpack.MaxWeight) { from.SendLocalizedMessage(501978); // The weight is too great to combine in a container. return; } ore.ItemID = newID; if (ore.ItemID == 0x19B9) { ore.Amount = worth / 8; } else if (ore.ItemID == 0x19B7) { ore.Amount = worth / 2; } else { ore.Amount = worth / 4; } m_Ore.Delete(); return; } #endregion if (IsForge(targeted)) { double difficulty; switch (m_Ore.Resource) { default: difficulty = 50.0; break; case CraftResource.Iron: difficulty = 0.0; break; case CraftResource.Gold: difficulty = 1.0; break; case CraftResource.Spike: difficulty = 5.0; break; case CraftResource.Fruity: difficulty = 10.0; break; case CraftResource.Bronze: difficulty = 15.0; break; case CraftResource.IceRock: difficulty = 20.0; break; case CraftResource.BlackDwarf: difficulty = 25.0; break; case CraftResource.DullCopper: difficulty = 30.0; break; case CraftResource.Platinum: difficulty = 35.0; break; case CraftResource.SilverRock: difficulty = 40.0; break; case CraftResource.DarkPagan: difficulty = 45.0; break; case CraftResource.Copper: difficulty = 50.0; break; case CraftResource.Mystic: difficulty = 55.0; break; case CraftResource.Spectral: difficulty = 60.0; break; case CraftResource.OldBritain: difficulty = 65.0; break; case CraftResource.Onyx: difficulty = 70.0; break; case CraftResource.RedElven: difficulty = 75.0; break; case CraftResource.Undead: difficulty = 80.0; break; case CraftResource.Pyrite: difficulty = 85.0; break; case CraftResource.Virginity: difficulty = 90.0; break; case CraftResource.Malachite: difficulty = 95.0; break; case CraftResource.Lavarock: difficulty = 97.0; break; case CraftResource.Azurite: difficulty = 98.0; break; case CraftResource.Dripstone: difficulty = 100.0; break; case CraftResource.Executor: difficulty = 104.0; break; case CraftResource.Peachblue: difficulty = 108.0; break; case CraftResource.Destruction: difficulty = 112.0; break; case CraftResource.Anra: difficulty = 116.0; break; case CraftResource.Crystal: difficulty = 119.0; break; case CraftResource.Doom: difficulty = 122.0; break; case CraftResource.Goddess: difficulty = 125.0; break; case CraftResource.NewZulu: difficulty = 129.0; break; case CraftResource.EbonTwilightSapphire: difficulty = 130.0; break; case CraftResource.DarkSableRuby: difficulty = 130.0; break; case CraftResource.RadiantNimbusDiamond: difficulty = 140.0; break; } double minSkill = difficulty - 25.0; double maxSkill = difficulty + 25.0; if (difficulty > 50.0 && difficulty > from.Skills[SkillName.Mining].Value) { from.SendLocalizedMessage(501986); // You have no idea how to smelt this strange ore! return; } if (m_Ore.ItemID == 0x19B7 && m_Ore.Amount < 2) { from.SendLocalizedMessage( 501987); // There is not enough metal-bearing ore in this pile to make an ingot. return; } if (from.CheckTargetSkill(SkillName.Mining, targeted, minSkill, maxSkill)) { int toConsume = m_Ore.Amount; if (toConsume <= 0) { from.SendLocalizedMessage( 501987); // There is not enough metal-bearing ore in this pile to make an ingot. } else { if (toConsume > 30000) { toConsume = 30000; } int ingotAmount; if (m_Ore.ItemID == 0x19B7) { ingotAmount = toConsume / 2; if (toConsume % 2 != 0) { --toConsume; } } else if (m_Ore.ItemID == 0x19B9) { ingotAmount = toConsume * 2; } else { ingotAmount = toConsume; } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = ingotAmount; m_Ore.Consume(toConsume); from.AddToBackpack(ingot); //from.PlaySound( 0x57 ); from.SendLocalizedMessage( 501988); // You smelt the ore removing the impurities and put the metal in your backpack. } } else { if (m_Ore.Amount < 2) { if (m_Ore.ItemID == 0x19B9) { m_Ore.ItemID = 0x19B8; } else { m_Ore.ItemID = 0x19B7; } } else { m_Ore.Amount /= 2; } from.SendLocalizedMessage( 501990); // You burn away the impurities but are left with less useable metal. } } }
protected override void OnTarget(Mobile from, object targeted) { bool hasForge, hasAnvil; DefBlacksmithy.CheckAnvilAndForge(from, 4, out hasAnvil, out hasForge); if (targeted is BaseIngot && m_Tool is BaseTool) { if (hasAnvil && hasForge) { BaseTool tool = (BaseTool)m_Tool; BaseIngot ingot = (BaseIngot)targeted; CraftSubRes subRes = CustomCraftMenu.GetSubRes(DefBlacksmithy.CraftSystem, targeted.GetType(), null); int num = CraftResources.GetIndex(ingot.Resource); if (subRes == null || !CustomCraftMenu.ResourceInfoList.ContainsKey(subRes)) { from.SendAsciiMessage("You can't use that."); return; } if (from.Skills[DefBlacksmithy.CraftSystem.MainSkill].Base < subRes.RequiredSkill) { from.SendAsciiMessage("You cannot work this strange and unusual metal."); return; } from.SendGump(new CraftGump(from, m_CraftSystem, tool, null, num)); //from.SendMenu( new CustomCraftMenu( from, DefBlacksmithy.CraftSystem, ( (BaseTool)m_Tool ), -1, targeted.GetType(), CustomCraftMenu.ResourceInfoList[subRes].ResourceIndex ) ); } else { from.SendAsciiMessage("You need to be close to a forge and anvil to smith."); } } else if (targeted is BaseIngot && !(m_Tool is BaseTool)) { from.SendAsciiMessage("You need to use a smith's hammer on that."); } else { if (!hasAnvil) { from.SendAsciiMessage("You need to be close to an anvil to repair."); return; } int number; if (targeted is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)targeted; SkillName skill = m_CraftSystem.MainSkill; int toWeaken = 0; if (Core.AOS) { toWeaken = 1; } else if (skill != SkillName.Tailoring) { double skillLevel = from.Skills[skill].Base; if (skillLevel >= 90.0) { toWeaken = 1; } else if (skillLevel >= 70.0) { toWeaken = 2; } else { toWeaken = 3; } } if (m_CraftSystem.CraftItems.SearchForSubclass(weapon.GetType()) == null && !IsSpecialWeapon(weapon)) { number = 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract. } else if (!weapon.IsChildOf(from.Backpack)) { number = 1044275; // The item must be in your backpack to repair it. } else if (weapon.MaxHitPoints <= 0 || weapon.HitPoints == weapon.MaxHitPoints) { number = 1044281; // That item is in full repair } else if (weapon.MaxHitPoints <= toWeaken) { number = 1044278; // That item has been repaired many times, and will break if repairs are attempted again. } else { if (CheckWeaken(from, skill, weapon.HitPoints, weapon.MaxHitPoints)) { weapon.MaxHitPoints -= toWeaken; weapon.HitPoints = Math.Max(0, weapon.HitPoints - toWeaken); } if (CheckRepairDifficulty(from, skill, weapon.HitPoints, weapon.MaxHitPoints)) { number = 1044279; // You repair the item. m_CraftSystem.PlayCraftEffect(from); weapon.HitPoints = weapon.MaxHitPoints; } else { number = 1044280; // You fail to repair the item. [And the contract is destroyed] m_CraftSystem.PlayCraftEffect(from); } } } else if (targeted is BaseArmor) { BaseArmor armor = (BaseArmor)targeted; SkillName skill = m_CraftSystem.MainSkill; int toWeaken = 0; if (Core.AOS) { toWeaken = 1; } else if (skill != SkillName.Tailoring) { double skillLevel = from.Skills[skill].Base; if (skillLevel >= 90.0) { toWeaken = 1; } else if (skillLevel >= 70.0) { toWeaken = 2; } else { toWeaken = 3; } } if (m_CraftSystem.CraftItems.SearchForSubclass(armor.GetType()) == null) { number = 1044277; } // That item cannot be repaired. // You cannot repair that item with this type of repair contract. else if (!armor.IsChildOf(from.Backpack)) { number = 1044275; // The item must be in your backpack to repair it. } else if (armor.MaxHitPoints <= 0 || armor.HitPoints == armor.MaxHitPoints) { number = 1044281; // That item is in full repair } else if (armor.MaxHitPoints <= toWeaken) { number = 1044278; } // That item has been repaired many times, and will break if repairs are attempted again. else { if (CheckWeaken(from, skill, armor.HitPoints, armor.MaxHitPoints)) { armor.MaxHitPoints -= toWeaken; armor.HitPoints = Math.Max(0, armor.HitPoints - toWeaken); } if (CheckRepairDifficulty(from, skill, armor.HitPoints, armor.MaxHitPoints)) { number = 1044279; // You repair the item. m_CraftSystem.PlayCraftEffect(from); armor.HitPoints = armor.MaxHitPoints; } else { number = 1044280; // You fail to repair the item. [And the contract is destroyed] m_CraftSystem.PlayCraftEffect(from); } } } else if (targeted is Item) { number = 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract. } else { number = 500426; // You can't repair that. } from.SendAsciiMessage(CliLoc.LocToString(number)); } }
public InternalTarget( BaseIngot ingot ) : base(2, false, TargetFlags.None) { m_Ingot = ingot; }
protected override void OnTarget(Mobile from, object targeted) { if (m_Ore.Deleted) { return; } if (!from.InRange(m_Ore.GetWorldLocation(), 2)) { from.SendLocalizedMessage(501976); // The ore is too far away. return; } #region Combine Ore if (targeted is BaseOre) { BaseOre ore = (BaseOre)targeted; if (!ore.Movable) { return; } else if (m_Ore == ore) { from.SendLocalizedMessage(501972); // Select another pile or ore with which to combine this. from.Target = new InternalTarget(ore); return; } else if (ore.Resource != m_Ore.Resource) { from.SendLocalizedMessage(501979); // You cannot combine ores of different metals. return; } int worth = ore.Amount; if (ore.ItemID == 0x19B9) { worth *= 8; } else if (ore.ItemID == 0x19B7) { worth *= 2; } else { worth *= 4; } int sourceWorth = m_Ore.Amount; if (m_Ore.ItemID == 0x19B9) { sourceWorth *= 8; } else if (m_Ore.ItemID == 0x19B7) { sourceWorth *= 2; } else { sourceWorth *= 4; } worth += sourceWorth; int plusWeight = 0; int newID = ore.ItemID; if (ore.DefaultWeight != m_Ore.DefaultWeight) { if (ore.ItemID == 0x19B7 || m_Ore.ItemID == 0x19B7) { newID = 0x19B7; } else if (ore.ItemID == 0x19B9) { newID = m_Ore.ItemID; plusWeight = ore.Amount * 2; } else { plusWeight = m_Ore.Amount * 2; } } if ((ore.ItemID == 0x19B9 && worth > 120000) || ((ore.ItemID == 0x19B8 || ore.ItemID == 0x19BA) && worth > 60000) || (ore.ItemID == 0x19B7 && worth > 30000)) { from.SendLocalizedMessage(1062844); // There is too much ore to combine. return; } else if (ore.RootParent is Mobile && (plusWeight + ((Mobile)ore.RootParent).Backpack.TotalWeight) > ((Mobile)ore.RootParent).Backpack.MaxWeight) { from.SendLocalizedMessage(501978); // The weight is too great to combine in a container. return; } ore.ItemID = newID; if (ore.ItemID == 0x19B9) { ore.Amount = worth / 8; m_Ore.Delete(); } else if (ore.ItemID == 0x19B7) { ore.Amount = worth / 2; m_Ore.Delete(); } else { ore.Amount = worth / 4; m_Ore.Delete(); } return; } #endregion if (IsForge(targeted)) { double difficulty; switch (m_Ore.Resource) { default: difficulty = 0.0; break; case CraftResource.Cuivre: difficulty = 40.0; break; case CraftResource.Bronze: difficulty = 40.0; break; case CraftResource.Acier: difficulty = 60.0; break; case CraftResource.Argent: difficulty = 60.0; break; case CraftResource.Or: difficulty = 60.0; break; case CraftResource.Mytheril: difficulty = 80.0; break; case CraftResource.Luminium: difficulty = 80.0; break; case CraftResource.Obscurium: difficulty = 80.0; break; case CraftResource.Mystirium: difficulty = 90.0; break; case CraftResource.Dominium: difficulty = 90.0; break; case CraftResource.Venarium: difficulty = 90.0; break; case CraftResource.Eclarium: difficulty = 100.0; break; case CraftResource.Athenium: difficulty = 100.0; break; case CraftResource.Umbrarium: difficulty = 100.0; break; } double minSkill = difficulty - 25.0; double maxSkill = difficulty + 25.0; if (difficulty > 50.0 && difficulty > from.Skills[SkillName.Excavation].Value) { from.SendLocalizedMessage(501986); // You have no idea how to smelt this strange ore! return; } if (m_Ore.Amount <= 1 && m_Ore.ItemID == 0x19B7) { from.SendLocalizedMessage(501987); // There is not enough metal-bearing ore in this pile to make an ingot. return; } if (from.CheckTargetSkill(SkillName.Excavation, targeted, minSkill, maxSkill)) { if (m_Ore.Amount <= 0) { from.SendLocalizedMessage(501987); // There is not enough metal-bearing ore in this pile to make an ingot. } else { int amount = m_Ore.Amount; if (m_Ore.Amount > 30000) { amount = 30000; } BaseIngot ingot = m_Ore.GetIngot(); if (m_Ore.ItemID == 0x19B7) { if (m_Ore.Amount % 2 == 0) { amount /= 2; m_Ore.Delete(); } else { amount /= 2; m_Ore.Amount = 1; } } else if (m_Ore.ItemID == 0x19B9) { amount *= 2; m_Ore.Delete(); } else { amount /= 1; m_Ore.Delete(); } ingot.Amount = amount; from.AddToBackpack(ingot); //from.PlaySound( 0x57 ); from.SendLocalizedMessage(501988); // You smelt the ore removing the impurities and put the metal in your backpack. } } else if (m_Ore.Amount < 2 && m_Ore.ItemID == 0x19B9) { from.SendLocalizedMessage(501990); // You burn away the impurities but are left with less useable metal. m_Ore.ItemID = 0x19B8; } else if (m_Ore.Amount < 2 && m_Ore.ItemID == 0x19B8 || m_Ore.ItemID == 0x19BA) { from.SendLocalizedMessage(501990); // You burn away the impurities but are left with less useable metal. m_Ore.ItemID = 0x19B7; } else { from.SendLocalizedMessage(501990); // You burn away the impurities but are left with less useable metal. m_Ore.Amount /= 2; } } }
public void AddResourceImage(BaseIngot ingot) { AddItem(295, 289, ingot.ItemID, ingot.Hue); }
protected override void OnTarget(Mobile from, object targeted) { if (m_Ore.Deleted) { return; } if (!from.InRange(m_Ore.GetWorldLocation(), 3) || !from.InLOS(m_Ore)) { from.SendLocalizedMessage(501976); // The ore is too far away. return; } #region Combine Ore /* * if (targeted is BaseOre) * { * BaseOre ore = (BaseOre)targeted; * if (!ore.Movable) * return; * else if (m_Ore == ore) * { * from.SendLocalizedMessage(501972); // Select another pile or ore with which to combine this. * from.Target = new InternalTarget(ore); * return; * } * else if (ore.Resource != m_Ore.Resource) * { * from.SendLocalizedMessage(501979); // You cannot combine ores of different metals. * return; * } * * int worth = ore.Amount; * if (ore.ItemID == 0x19B9) * worth *= 8; * else if (ore.ItemID == 0x19B7) * worth *= 2; * else * worth *= 4; * int sourceWorth = m_Ore.Amount; * if (m_Ore.ItemID == 0x19B9) * sourceWorth *= 8; * else if (m_Ore.ItemID == 0x19B7) * sourceWorth *= 2; * else * sourceWorth *= 4; * worth += sourceWorth; * * int plusWeight = 0; * int newID = ore.ItemID; * if (ore.DefaultWeight != m_Ore.DefaultWeight) * { * if (ore.ItemID == 0x19B7 || m_Ore.ItemID == 0x19B7) * { * newID = 0x19B7; * } * else if (ore.ItemID == 0x19B9) * { * newID = m_Ore.ItemID; * plusWeight = ore.Amount * 2; * } * else * { * plusWeight = m_Ore.Amount * 2; * } * } * * if ((ore.ItemID == 0x19B9 && worth > 120000) || ((ore.ItemID == 0x19B8 || ore.ItemID == 0x19BA) && worth > 60000) || (ore.ItemID == 0x19B7 && worth > 30000)) * { * from.SendLocalizedMessage(1062844); // There is too much ore to combine. * return; * } * else if (ore.RootParent is Mobile && (plusWeight + ((Mobile)ore.RootParent).Backpack.TotalWeight) > ((Mobile)ore.RootParent).Backpack.MaxWeight) * { * from.SendLocalizedMessage(501978); // The weight is too great to combine in a container. * return; * } * * ore.ItemID = newID; * if (ore.ItemID == 0x19B9) * { * ore.Amount = worth / 8; * m_Ore.Delete(); * } * else if (ore.ItemID == 0x19B7) * { * ore.Amount = worth / 2; * m_Ore.Delete(); * } * else * { * ore.Amount = worth / 4; * m_Ore.Delete(); * } * return; * } */ #endregion if (IsForge(targeted)) { double difficulty; switch (m_Ore.Resource) { default: difficulty = 50.0; break; case CraftResource.DullCopper: difficulty = 65.0; break; case CraftResource.ShadowIron: difficulty = 70.0; break; case CraftResource.Copper: difficulty = 75.0; break; case CraftResource.Bronze: difficulty = 80.0; break; case CraftResource.Gold: difficulty = 85.0; break; case CraftResource.Agapite: difficulty = 90.0; break; case CraftResource.Verite: difficulty = 95.0; break; case CraftResource.Valorite: difficulty = 99.0; break; } double minSkill = difficulty - 25.0; double maxSkill = difficulty + 25.0; if (difficulty > 50.0 && difficulty > from.Skills[SkillName.Mining].Value) { from.SendLocalizedMessage(501986); // You have no idea how to smelt this strange ore! return; } /* * if (m_Ore.Amount <= 1 && m_Ore.ItemID == 0x19B7) * { * from.SendLocalizedMessage(501987); // There is not enough metal-bearing ore in this pile to make an ingot. * return; * } */ if (from.CheckTargetSkill(SkillName.Mining, targeted, minSkill, maxSkill)) { int toConsume = m_Ore.Amount; if (toConsume <= 0) { from.SendLocalizedMessage(501987); // There is not enough metal-bearing ore in this pile to make an ingot. } else { //int amount = m_Ore.Amount; //if (m_Ore.Amount > 30000) // amount = 30000; if (toConsume > 30000) { toConsume = 30000; } BaseIngot ingot = m_Ore.GetIngot(); /* * if (m_Ore.ItemID == 0x19B7) * { * if (m_Ore.Amount % 2 == 0) * { * amount /= 2; * m_Ore.Delete(); * } * else * { * amount /= 2; * m_Ore.Amount = 1; * } * } * * else if (m_Ore.ItemID == 0x19B9) * { * amount *= 2; * m_Ore.Delete(); * } * * else * { * amount /= 1; * m_Ore.Delete(); * } * * ingot.Amount = amount; */ ingot.Amount = toConsume * 2; m_Ore.Consume(toConsume); from.AddToBackpack(ingot); from.SendLocalizedMessage(501988); // You smelt the ore removing the impurities and put the metal in your backpack. } } //else if ( m_Ore.Amount < 2 && m_Ore.ItemID == 0x19B9 ) else if (m_Ore.Amount < 2) { //from.SendLocalizedMessage( 501990 ); // You burn away the impurities but are left with less useable metal. //m_Ore.ItemID = 0x19B8; from.SendLocalizedMessage(501989); // You burn away the impurities but are left with no useable metal. m_Ore.Delete(); } /* * else if (m_Ore.Amount < 2 && m_Ore.ItemID == 0x19B8 || m_Ore.ItemID == 0x19BA) * { * from.SendLocalizedMessage(501990); // You burn away the impurities but are left with less useable metal. * m_Ore.ItemID = 0x19B7; * } */ else { from.SendLocalizedMessage(501990); // You burn away the impurities but are left with less useable metal. m_Ore.Amount /= 2; } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Ore.Deleted) { return; } if (!from.InRange(m_Ore.GetWorldLocation(), 2)) { from.SendLocalizedMessage(501976); // The ore is too far away. return; } #region Combine Ore if (targeted is BaseOre) { BaseOre ore = (BaseOre)targeted; if (!ore.Movable) { return; } else if (m_Ore == ore) { from.SendLocalizedMessage(501972); // Select another pile or ore with which to combine from.Target = new InternalTarget(ore); return; } else if (ore.Resource != m_Ore.Resource) { from.SendLocalizedMessage(501979); // You cannot combine ores of different metals. return; } int worth = ore.Amount; if (ore.ItemID == 0x19B9) { worth *= 8; } else if (ore.ItemID == 0x19B7) { worth *= 2; } else { worth *= 4; } int sourceWorth = m_Ore.Amount; if (m_Ore.ItemID == 0x19B9) { sourceWorth *= 8; } else if (m_Ore.ItemID == 0x19B7) { sourceWorth *= 2; } else { sourceWorth *= 4; } worth += sourceWorth; int plusWeight = 0; int newID = ore.ItemID; if (ore.DefaultWeight != m_Ore.DefaultWeight) { if (ore.ItemID == 0x19B7 || m_Ore.ItemID == 0x19B7) { newID = 0x19B7; } else if (ore.ItemID == 0x19B9) { newID = m_Ore.ItemID; plusWeight = ore.Amount * 2; } else { plusWeight = m_Ore.Amount * 2; } } if ((ore.ItemID == 0x19B9 && worth > 120000) || ((ore.ItemID == 0x19B8 || ore.ItemID == 0x19BA) && worth > 60000) || (ore.ItemID == 0x19B7 && worth > 30000)) { from.SendLocalizedMessage(1062844); // There is too much ore to combine. return; } else if (ore.RootParent is Mobile && (plusWeight + ((Mobile)ore.RootParent).Backpack.TotalWeight) > ((Mobile)ore.RootParent).Backpack.MaxWeight) { from.SendLocalizedMessage(501978); // The weight is too great to combine in a container. return; } ore.ItemID = newID; if (ore.ItemID == 0x19B9) { ore.Amount = worth / 8; } else if (ore.ItemID == 0x19B7) { ore.Amount = worth / 2; } else { ore.Amount = worth / 4; } m_Ore.Delete(); return; } #endregion if (IsForge(targeted)) { double difficulty; #region Void Pool Rewards bool talisman = false; SmeltersTalisman t = from.FindItemOnLayer(Layer.Talisman) as SmeltersTalisman; if (t != null && t.Resource == m_Ore.Resource) { talisman = true; } #endregion switch (m_Ore.Resource) { default: difficulty = 50.0; break; case CraftResource.DullCopper: difficulty = 65.0; break; case CraftResource.ShadowIron: difficulty = 70.0; break; case CraftResource.Copper: difficulty = 75.0; break; case CraftResource.Bronze: difficulty = 80.0; break; case CraftResource.Gold: difficulty = 85.0; break; case CraftResource.Agapite: difficulty = 90.0; break; case CraftResource.Verite: difficulty = 95.0; break; case CraftResource.Valorite: difficulty = 99.0; break; } double minSkill = difficulty - 25.0; double maxSkill = difficulty + 25.0; if (difficulty > 50.0 && difficulty > from.Skills[SkillName.Mining].Value && !talisman) { from.SendLocalizedMessage(501986); // You have no idea how to smelt this strange ore! return; } if (m_Ore.ItemID == 0x19B7 && m_Ore.Amount < 2) { from.SendLocalizedMessage(501987); // There is not enough metal-bearing ore in this pile to make an ingot. return; } if (talisman || from.CheckTargetSkill(SkillName.Mining, targeted, minSkill, maxSkill)) { int toConsume = m_Ore.Amount; if (toConsume <= 0) { from.SendLocalizedMessage(501987); // There is not enough metal-bearing ore in this pile to make an ingot. } else { if (toConsume > 30000) { toConsume = 30000; } int ingotAmount; if (m_Ore.ItemID == 0x19B7) { ingotAmount = toConsume / 2; if (toConsume % 2 != 0) { --toConsume; } } else if (m_Ore.ItemID == 0x19B9) { ingotAmount = toConsume * 2; } else { ingotAmount = toConsume; } BaseIngot ingot = m_Ore.GetIngot(); ingot.Amount = ingotAmount; if (m_Ore.HasSocket <Caddellite>()) { ingot.AttachSocket(new Caddellite()); } m_Ore.Consume(toConsume); from.AddToBackpack(ingot); //from.PlaySound( 0x57 ); if (talisman && t != null) { t.UsesRemaining--; from.SendLocalizedMessage(1152620); // The magic of your talisman guides your hands as you purify the metal. Success is ensured! } else { from.SendLocalizedMessage(501988); // You smelt the ore removing the impurities and put the metal in your backpack. } } } else { if (m_Ore.Amount < 2) { if (m_Ore.ItemID == 0x19B9) { m_Ore.ItemID = 0x19B8; } else { m_Ore.ItemID = 0x19B7; } } else { m_Ore.Amount /= 2; } from.SendLocalizedMessage(501990); // You burn away the impurities but are left with less useable metal. } } }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is BaseOre) { BaseOre m_Ore = (BaseOre)targeted; if (m_Ore.Deleted) { return; } if (!from.InRange(m_Ore.GetWorldLocation(), 2)) { from.SendMessage("The ore is too far away."); return; } double difficulty; switch (m_Ore.Resource) { default: difficulty = 50.0; break; case CraftResource.DullCopper: difficulty = 65.0; break; case CraftResource.ShadowIron: difficulty = 70.0; break; case CraftResource.Copper: difficulty = 75.0; break; case CraftResource.Bronze: difficulty = 80.0; break; case CraftResource.Gold: difficulty = 85.0; break; case CraftResource.Agapite: difficulty = 90.0; break; case CraftResource.Verite: difficulty = 95.0; break; case CraftResource.Valorite: difficulty = 99.0; break; case CraftResource.Nepturite: difficulty = 99.0; break; case CraftResource.Obsidian: difficulty = 99.0; break; case CraftResource.Mithril: difficulty = 99.0; break; case CraftResource.Xormite: difficulty = 99.0; break; case CraftResource.Dwarven: difficulty = 101.0; break; } double minSkill = difficulty - 25.0; double maxSkill = difficulty + 25.0; if (difficulty > 50.0 && difficulty > from.Skills[SkillName.Mining].Value) { from.SendLocalizedMessage(501986); // You have no idea how to smelt this strange ore! return; } if (m_Ore.Amount <= 1 && m_Ore.ItemID == 0x19B7) { from.SendLocalizedMessage(501987); // There is not enough metal-bearing ore in this pile to make an ingot. return; } if (from.CheckTargetSkill(SkillName.Mining, targeted, minSkill, maxSkill)) { if (m_Ore.Amount <= 0) { from.SendLocalizedMessage(501987); // There is not enough metal-bearing ore in this pile to make an ingot. } else { int amount = m_Ore.Amount; if (m_Ore.Amount > 30000) { amount = 30000; } BaseIngot ingot = m_Ore.GetIngot(); if (m_Ore.ItemID == 0x19B7) { if (m_Ore.Amount % 2 == 0) { amount /= 2; m_Ore.Delete(); } else { amount /= 2; m_Ore.Amount = 1; } } else if (m_Ore.ItemID == 0x19B9) { amount *= 2; m_Ore.Delete(); } else { amount /= 1; m_Ore.Delete(); } ingot.Amount = amount; from.AddToBackpack(ingot); from.PlaySound(0x208); from.SendLocalizedMessage(501988); // You smelt the ore removing the impurities and put the metal in your backpack. m_Tool.ConsumeCharge(from); } } else if (m_Ore.Amount < 2 && m_Ore.ItemID == 0x19B9) { from.SendLocalizedMessage(501990); // You burn away the impurities but are left with less useable metal. m_Ore.ItemID = 0x19B8; from.PlaySound(0x208); m_Tool.ConsumeCharge(from); } else if (m_Ore.Amount < 2 && m_Ore.ItemID == 0x19B8 || m_Ore.ItemID == 0x19BA) { from.SendLocalizedMessage(501990); // You burn away the impurities but are left with less useable metal. m_Ore.ItemID = 0x19B7; from.PlaySound(0x208); m_Tool.ConsumeCharge(from); } else { from.SendLocalizedMessage(501990); // You burn away the impurities but are left with less useable metal. m_Ore.Amount /= 2; from.PlaySound(0x208); m_Tool.ConsumeCharge(from); } } else { from.SendMessage("You can only use this on ore."); } }