public override int CanCraft(Mobile from, BaseTool tool, Type itemType) { if (tool == null || tool.Deleted || tool.UsesRemaining < 0) { return(1044038); // You have worn out your tool! } else if (!BaseTool.CheckTool(tool, from)) { return(1048146); // If you have a tool equipped, you must use that tool. } else if (!(from is PlayerMobile && ((PlayerMobile)from).Glassblowing && from.Skills[SkillName.Alchemy].Base >= 100.0)) { return(1044634); // You havent learned glassblowing. } else if (!BaseTool.CheckAccessible(tool, from)) { return(1044263); // The tool must be on your person to use. } bool anvil, forge; DefBlacksmithy.CheckAnvilAndForge(from, 2, out anvil, out forge); if (forge) { return(0); } return(1044628); // You must be near a forge to blow glass. }
protected override void OnTarget(Mobile from, object targeted) { int num = m_CraftSystem.CanCraft(from, m_Tool, null); if (num > 0) { if (num == 1044267) { bool anvil, forge; DefBlacksmithy.CheckAnvilAndForge(from, 2, out anvil, out forge); if (!anvil) { num = 1044266; // You must be near an anvil } else if (!forge) { num = 1044265; // You must be near a forge. } } from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, num)); } else { SmeltResult result = SmeltResult.Invalid; bool isStoreBought = false; int message; if (targeted is BaseArmor) { result = Resmelt(from, (BaseArmor)targeted, ((BaseArmor)targeted).Resource); isStoreBought = !((BaseArmor)targeted).PlayerConstructed; } else if (targeted is BaseWeapon) { result = Resmelt(from, (BaseWeapon)targeted, ((BaseWeapon)targeted).Resource); isStoreBought = !((BaseWeapon)targeted).PlayerConstructed; } else if (targeted is DragonBardingDeed) { result = Resmelt(from, (DragonBardingDeed)targeted, ((DragonBardingDeed)targeted).Resource); isStoreBought = false; } switch (result) { default: case SmeltResult.Invalid: message = 1044272; break; // You can't melt that down into ingots. case SmeltResult.NoSkill: message = 1044269; break; // You have no idea how to work this metal. case SmeltResult.Success: message = isStoreBought ? 500418 : 1044270; break; // You melt the item down into ingots. } from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, message)); } }