public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (m_Table.Deleted || !from.InRange(m_Table.GetWorldLocation(), 3) || !DesignContext.Check(from)) { return; } int buttonID = info.ButtonID; int index = (buttonID / 2); int drp = buttonID % 2; if (index >= 0 && index < m_Table.Entries.Count && drp == 1) { DaviesLockerEntry e = (DaviesLockerEntry)m_Table.Entries[index]; if (m_Table.CheckAccess(from)) { m_Table.DropTMap(from, e, index); from.CloseGump(typeof(DaviesLockerGump)); from.SendGump(new DaviesLockerGump(m_Table)); } else { from.SendLocalizedMessage(502413); // That cannot be done while the Table is locked down. } } else if (index >= 1 && index < m_Table.Entries.Count + 1 && drp == 0) { index = index - 1; DaviesLockerEntry e = (DaviesLockerEntry)m_Table.Entries[index]; if (m_Table.CheckAccess(from)) { from.CloseGump(typeof(DaviesLockerGump)); from.SendGump(new DaviesLockerGump(m_Table)); m_Table.ViewMap(from, e, index); } else { from.SendLocalizedMessage(502413); // That cannot be done while the Table is locked down. } } else if (buttonID == 1000) { from.SendMessage("Target a Treasure Map or S.O.S."); from.Target = new DaviesLockerTarget(m_Table); } }
private void AddDetails(int index, int count) { int btn = (index * 2) + 1; if (index < m_Table.Entries.Count) { DaviesLockerEntry e = (DaviesLockerEntry)m_Table.Entries[index]; int hue = GetMapHue(e.Map); AddLabel(110, 520, 2041, String.Format("Maps: {0} of 500", m_Table.Entries.Count)); // # of Maps AddButton(133, 170 + (count * 35), 2117, 2118, btn, GumpButtonType.Reply, 0); // Get Button AddLabel(174, 167 + (count * 35), hue, String.Format("{0}", e.Map)); // Facet if (e.type == 3) { AddLabel(290, 167 + (count * 35), hue, String.Format("M-I-B")); //Level - MIB AddLabel(417, 167 + (count * 35), hue, String.Format("Unknown")); //Coords - MIB AddLabel(550, 167 + (count * 35), hue, String.Format("Unopened")); //Status - MIB } else if (e.type == 2) { AddLabel(290, 167 + (count * 35), hue, String.Format("S-O-S")); //Level - SOS (not shown on SOS) AddLabel(417, 167 + (count * 35), hue, String.Format("{0}", e.Location3d)); //Coords - SOS AddLabel(550, 167 + (count * 35), hue, String.Format("Opened")); //Status - SOS } else { string leveldesc; if (e.Level == 1) { leveldesc = "Plainly"; } else if (e.Level == 2) { leveldesc = "Expertly"; } else if (e.Level == 3) { leveldesc = "Adeptly"; } else if (e.Level == 4) { leveldesc = "Cleverly"; } else if (e.Level == 5) { leveldesc = "Deviously"; } else if (e.Level == 6) { leveldesc = "Ingeniously"; } else if (e.Level == 7) { leveldesc = "Diabolically"; } else { leveldesc = "Unknown"; } AddLabel(290, 167 + (count * 35), hue, String.Format("{0} - {1}", e.Level, leveldesc)); //Level - TMAP if (e.Decoder == null) { AddLabel(417, 167 + (count * 35), hue, String.Format("Unknown")); //Coords - TMAP AddLabel(550, 167 + (count * 35), hue, String.Format("Not Decoded")); //Status - TMAP } else { AddLabel(417, 167 + (count * 35), hue, e.Mapnumber == "Unknown Spot" ? String.Format("{0}", e.Location2d) : String.Format("{0}", e.Mapnumber)); AddLabel(550, 167 + (count * 35), hue, String.Format("Decoded ")); //Status - TMAP } } } }
private int GetLevel(DaviesLockerEntry entry) { if (entry is SOSEntry) return 1153568; // S-O-S else if(entry is TreasureMapEntry) return 1153572 + entry.Level; return 1153569; // Unknown }
private int GetStatus(DaviesLockerEntry entry) { if (entry is SOSEntry) { SOSEntry sosEntry = (SOSEntry)entry; if (!sosEntry.Opened) return 1153570; // Unopened if (sosEntry.IsAncient) return 1153572; // Ancient return 1153571; // Opened } else if (entry is TreasureMapEntry) { TreasureMapEntry mapEntry = (TreasureMapEntry)entry; if (mapEntry.Completed) return 1153582; // Completed else if (mapEntry.Decoder != null) return 1153581; // Decoded else return 1153580; // Not Decoded } return 1153569; // Unknown }
private void ConstructEntry(Mobile from, DaviesLockerEntry entry) { Item item = null; if (entry is SOSEntry) item = Construct((SOSEntry)entry); else if (entry is TreasureMapEntry) item = Construct((TreasureMapEntry)entry); if (item != null) { Container pack = from.Backpack; if (pack == null || !pack.TryDropItem(from, item, false)) item.Delete(); else { if (m_List.Contains(entry)) m_List.Remove(entry); //TODO: Message? } } }