public override void OnResponse(NetState sender, RelayInfo info) { if (m_Ticket.Deleted) { return; } int number = 0; Item item = null; Item item2 = null; switch (info.ButtonID) { case 1: item = new Sextant(); number = 1010494; break; // A sextant has been placed in your backpack. case 2: item = new HairRestylingDeed(); number = 501933; break; // A coupon for a free hair restyling has been placed in your backpack. case 3: item = new Spellbook(0xFFFFFFFF); number = 1010495; break; // A spellbook with all 1st to 4th circle spells has been placed in your backpack. case 4: item = new FireworksWand(); number = 501935; break; // A wand of fireworks has been placed in your backpack. case 5: item = new Spyglass(); number = 501936; break; // A spyglass has been placed in your backpack. case 6: item = new DyeTub(); item2 = new Dyes(); number = 501937; break; // The dyes and dye tub have been placed in your backpack. } if (item != null) { m_Ticket.Delete(); m_From.SendLocalizedMessage(number); m_From.AddToBackpack(item); if (item2 != null) { m_From.AddToBackpack(item2); } } }
public static string FormatLocation(Point3D loc, Map map, bool displayMap) { StringBuilder result = new StringBuilder(); int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if (Sextant.Format(loc, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { result.AppendFormat("{0}°{1}'{2},{3}°{4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); } else { result.AppendFormat("{0},{1}", loc.X, loc.Y); } if (displayMap) { result.AppendFormat(" ({0})", map); } return(result.ToString()); }