protected override void OnTarget(Mobile from, object targeted) { int num = m_CraftSystem.CanCraft(from, m_Tool, null); if (num > 0) { from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, num)); return; } RecycleResult result = RecycleResult.Invalid; string message; Item item = targeted as Item; if (item == null) { return; } else { result = Recycle(from, item); } switch (result) { default: case RecycleResult.Invalid: message = "That cannot be recycled."; break; case RecycleResult.NoSkill: message = "You do not know how to recycle this material."; break; case RecycleResult.Success: message = "You recycle the item."; break; } from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, message)); }
protected override void OnTarget(Mobile from, object targeted) { if (from == null) { return; } int num = m_CraftSystem.CanCraft(from, m_Tool, null); if (num > 0) { from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, num)); return; } RecycleResult result = RecycleResult.Invalid; string message = ""; CraftContext craftContext = m_CraftSystem.GetContext(from); if (craftContext == null) { return; } if (craftContext.RecycleOption == CraftRecycleOption.RecycleEverything && targeted == from && from.Backpack != null) { result = Recycle(from, from.Backpack); switch (result) { case RecycleResult.Invalid: message = "That cannot be recycled."; break; case RecycleResult.InvalidEntireBackpack: message = "No recyclable items were found in your backpack."; break; case RecycleResult.NoSkill: message = "You do not know how to recycle this material."; break; case RecycleResult.Success: message = "You recycle an item."; break; case RecycleResult.SuccessMultiple: message = "You recycle several items."; break; } from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, message)); return; } Item item = targeted as Item; if (item == null) { return; } else { result = Recycle(from, item); } switch (result) { case RecycleResult.Invalid: message = "That cannot be recycled."; break; case RecycleResult.InvalidEntireBackpack: message = "No recyclable items were found in your backpack."; break; case RecycleResult.NoSkill: message = "You do not know how to recycle this material."; break; case RecycleResult.Success: message = "You recycle an item."; break; case RecycleResult.SuccessMultiple: message = "You recycle several items."; break; } from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, message)); }