public InternalTarget(BaseOre ore, Mobile from) : base(2, false, TargetFlags.None) { player = from; //daat99 OWLTR end - mule forge this.m_Ore = ore; }
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. } } }
public InternalTarget(BaseOre ore) : base(2, false, TargetFlags.None) { m_Ore = ore; }
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 InternalTarget( BaseOre ore ) : base(2, false, TargetFlags.None) { m_Ore = ore; }
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_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 (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) { 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."); } }