public TurnInEntry(Mobile mobile, BaseTurnInMobile vendor) : base(vendor.TurnInLocalization, 2) { m_Mobile = mobile; m_Vendor = vendor; m_Buttons = m_Vendor.FindRedeemableItems(m_Mobile); if (m_Buttons.Count() > 0) { Enabled = true; } else { Enabled = false; } }
public override void HandleButtonResponse(NetState sender, int adjustedButton, ImageTileButtonInfo buttonInfo) { PlayerMobile pm = sender.Mobile as PlayerMobile; Item item = ((ItemTileButtonInfo)buttonInfo).Item; if (!(pm != null && item.IsChildOf(pm.Backpack) && pm.InRange(m_Collector.Location, 7))) { return; } m_Collector.AwardPoints(pm, item, m_Collector.TurnInPoints); item.Delete(); IEnumerable <ItemTileButtonInfo> buttons = m_Collector.FindRedeemableItems(pm); if (buttons != null && buttons.Count() > 0) { pm.SendGump(new TurnInGump(m_Collector, buttons)); } }