public override void OnDoubleClick(Mobile from) { if (!Movable) { return; } if (RootParent is BaseCreature) { from.SendLocalizedMessage(500447); // That is not accessible return; } if (!from.InRange(GetWorldLocation(), 2)) { from.SendLocalizedMessage(501976); // The ore is too far away. return; } if (!DefBlacksmithy.CheckForge(from, 1)) { from.SendFailureMessage("You must be near a forge to smelt ore!"); return; } var oreType = GetType(); var oreEntry = ZhConfig.Resources.Ores.Entries.Single(e => e.ResourceType == oreType); var difficulty = oreEntry.SmeltSkillRequired; if (!from.ShilCheckSkill(SkillName.Mining, (int)difficulty, 0)) { Consume(1); from.SendFailureMessage("You destroy some ore."); return; } var ingot = GetIngot(); ingot.Amount = Amount; from.PlaySound(0x2B); from.AddToBackpack(ingot); from.SendSuccessMessage($"You create {Amount} ingots and place them in your pack."); Delete(); return; }
public override void OnDoubleClick(Mobile from) { if (!Movable) { return; } if (RootParent is BaseCreature) { from.SendLocalizedMessage(500447); // That is not accessible return; } if (!from.InRange(GetWorldLocation(), 2)) { from.SendLocalizedMessage(1060178); // You are too far away to perform that action! return; } if (!DefBlacksmithy.CheckForge(from, 1)) { from.SendFailureMessage("You must be near a forge to smelt sand!"); return; } if (!from.ShilCheckSkill(SkillName.Blacksmith, points: 0)) { Consume(1); from.SendFailureMessage("You waste some sand."); return; } var glass = new RawGlass(Amount); from.PlaySound(0x2B); from.AddToBackpack(glass); from.SendSuccessMessage($"You create {Amount} raw glass and place it in your pack."); Delete(); }