public override void OnResponse(NetState state, RelayInfo info) { base.OnResponse(state, info); Mobile from = state.Mobile; switch (info.ButtonID) { case 1: { if (Auction.CheckModifyAuction(User, true)) { if (Auction.AuctionItem != null) { if (Auction.AuctionItem.LabelNumber != 0) { from.SendLocalizedMessage(1152339, string.Format("#{0}", Auction.AuctionItem.LabelNumber)); // A reward of ~1_ITEM~ has been placed in your backpack. } else { from.SendLocalizedMessage(1152339, Auction.AuctionItem.Name); // A reward of ~1_ITEM~ has been placed in your backpack. } Auction.AuctionItem.Movable = true; from.AddToBackpack(Auction.AuctionItem); Auction.AuctionItem = null; } from.Target = new InternalTarget(Auction, this); } else { Refresh(); } break; } case 2: { if (Auction.CheckModifyAuction(User)) { TextRelay relay = info.GetTextEntry(1); string str = null; if (relay != null) { str = relay.Text; } if (str != null || Guilds.BaseGuildGump.CheckProfanity(str, 140)) { Auction.Description = Utility.FixHtml(str.Trim()); } else { from.SendLocalizedMessage(1150315); // That text is unacceptable. } } Refresh(); break; } case 3: { if (Auction.CheckModifyAuction(User)) { Auction.Duration = 60; } Refresh(); break; } case 4: { if (Auction.CheckModifyAuction(User)) { Auction.Duration = 4320; } Refresh(); break; } case 5: { if (Auction.CheckModifyAuction(User)) { Auction.Duration = 7200; } Refresh(); break; } case 6: { if (Auction.CheckModifyAuction(User)) { Auction.Duration = 10080; } Refresh(); break; } case 7: { if (Auction.CheckModifyAuction(User)) { TextRelay relay1 = info.GetTextEntry(2); string plat1 = null; string gold1 = null; if (relay1 != null) { plat1 = relay1.Text; } relay1 = info.GetTextEntry(3); if (relay1 != null) { gold1 = relay1.Text; } long platAmnt = Utility.ToInt64(plat1); long goldAmnt = Utility.ToInt64(gold1); if (platAmnt >= 0 && goldAmnt >= 0) { _TempBid += platAmnt * Account.CurrencyThreshold; _TempBid += goldAmnt; } else { from.SendLocalizedMessage(1150315); // That text is unacceptable. _NoBid = true; } if (!_NoBid) { if (Auction.OnGoing && Auction.BidHistory == null) { Auction.CurrentBid = _TempBid; } Auction.StartBid = _TempBid; } } Refresh(); break; } case 8: { if (Auction.CheckModifyAuction(User)) { TextRelay relay2 = info.GetTextEntry(4); string plat2 = null; string gold2 = null; if (relay2 != null) { plat2 = relay2.Text; } relay2 = info.GetTextEntry(5); if (relay2 != null) { gold2 = relay2.Text; } long platAmnt2 = Utility.ToInt64(plat2); long goldAmnt2 = Utility.ToInt64(gold2); if (platAmnt2 >= 0 && goldAmnt2 >= 0) { _TempBuyout += platAmnt2 * Account.CurrencyThreshold; _TempBuyout += goldAmnt2; } else { from.SendLocalizedMessage(1150315); // That text is unacceptable. } Auction.Buyout = _TempBuyout; } Refresh(); break; } case 9: { if (Auction.StartBid <= 0) { User.SendLocalizedMessage(1156434); // You must set a starting bid. } else { Auction.OnBegin(); } Refresh(); break; } case 23: { if (Auction.OnGoing && Auction.HighestBid == null) { Auction.ClaimPrize(User); } break; } } }
public override void OnResponse(NetState state, RelayInfo info) { base.OnResponse(state, info); switch (info.ButtonID) { case 1: if (Auction.CheckModifyAuction(User, true)) { User.BeginTarget(-1, false, TargetFlags.None, (from, targeted) => { Item item = targeted as Item; if (!IsBadItem(item)) { if (item == Auction.AuctionItem) { User.SendMessage("You have removed the item from the auction."); Auction.AuctionItem = null; item.Movable = true; User.AddToBackpack(item); } else if (item.IsChildOf(User.Backpack)) { if (Auction.AuctionItem != null) { Auction.AuctionItem.Movable = true; User.AddToBackpack(Auction.AuctionItem); Auction.AuctionItem = null; User.SendMessage("You swap out auction items."); } else { User.SendMessage("You have selected an auction item."); } Auction.AuctionItem = item; item.Movable = false; item.MoveToWorld(new Point3D(Safe.X, Safe.Y, Safe.Z + Safe.Components[0].ItemData.CalcHeight), Safe.Map); } } else { User.SendMessage("You cannot add that to your auction."); } Refresh(); }); } break; case 2: TextRelay relay = info.GetTextEntry(1); string str = null; if (relay != null) { str = relay.Text; } if (str == null || str.Trim().Length > 150 || !Server.Guilds.BaseGuildGump.CheckProfanity(str)) { User.SendMessage(0x22, "Invalid description."); } else { Auction.Description = Utility.FixHtml(str.Trim()); } Refresh(); break; case 3: if (Auction.CheckModifyAuction(User)) { Auction.Duration = 3; } Refresh(); break; case 4: if (Auction.CheckModifyAuction(User)) { Auction.Duration = 5; } Refresh(); break; case 5: if (Auction.CheckModifyAuction(User)) { Auction.Duration = 7; } Refresh(); break; case 6: TextRelay relay1 = info.GetTextEntry(2); string plat1 = null; string gold1 = null; if (relay1 != null) { plat1 = relay1.Text; } relay1 = info.GetTextEntry(3); if (relay1 != null) { gold1 = relay1.Text; } long platAmnt = Utility.ToInt64(plat1); long goldAmnt = Utility.ToInt64(gold1); if (Auction.CheckModifyAuction(User) && platAmnt >= 0 && goldAmnt >= 0) { if (platAmnt > long.MaxValue) { User.SendMessage("Who in Sosaria has that much gold? Try a lower amount."); break; } _TempBid += platAmnt * Account.CurrencyThreshold; if (goldAmnt > long.MaxValue) { User.SendMessage("That bid is too high. Try converting some of your gold bid into a plat bid."); return; } _TempBid += goldAmnt; } else { _NoBid = true; } if (!_NoBid) { Auction.CurrentBid = _TempBid; } Refresh(); break; case 7: TextRelay relay2 = info.GetTextEntry(4); string plat2 = null; string gold2 = null; if (relay2 != null) { plat2 = relay2.Text; } relay2 = info.GetTextEntry(5); if (relay2 != null) { gold2 = relay2.Text; } long platAmnt2 = Utility.ToInt64(plat2); long goldAmnt2 = Utility.ToInt64(gold2); if (Auction.CheckModifyAuction(User) && platAmnt2 >= 0 && goldAmnt2 >= 0) { if (platAmnt2 > long.MaxValue) { User.SendMessage("Who in Sosaria has that much gold? Try a lower amount."); return; } _TempBuyout += platAmnt2 * Account.CurrencyThreshold; if (goldAmnt2 > long.MaxValue) { User.SendMessage("That bid is too high. Try converting some of your gold bid into a plat bid."); return; } _TempBuyout += goldAmnt2; } Auction.Buyout = _TempBuyout; Refresh(); break; case 8: if (Auction.CurrentBid <= 0) { User.SendLocalizedMessage(1156434); // You must set a starting bid. } else { Auction.OnBegin(); } Refresh(); break; case 23: if (Auction.OnGoing && Auction.HighestBid == null) { Auction.Cancel(); } break; } }