public override void GetProperties(ObjectPropertyList list) { base.GetProperties(list); if (HuntingSystem.Instance == null) { return; } if (!HuntingSystem.Instance.Leaders.ContainsKey(m_HuntType)) { HuntingSystem.Instance.Leaders[m_HuntType] = new List <HuntingKillEntry>(); } List <HuntingKillEntry> entries = HuntingSystem.Instance.Leaders[m_HuntType]; HuntingKillEntry entry = null; if (entries.Count > 0) { entry = entries[0]; } if (entry != null) { HuntingTrophyInfo info = HuntingTrophyInfo.GetInfo(m_HuntType); if (info != null) { list.Add(1155708, entry.Owner != null ? entry.Owner.Name : "Unknown"); // Hunter: ~1_NAME~ list.Add(1155709, entry.DateKilled.ToShortDateString()); // Date of Kill: ~1_DATE~ if (entry.Location != null) { list.Add(1061114, entry.Location); // Location: ~1_val~ } list.Add(1155718, info.Species.ToString()); if (info.MeasuredBy == MeasuredBy.Length) { list.Add(1155711, entry.Measurement.ToString()); // Length: ~1_VAL~ } else if (info.MeasuredBy == MeasuredBy.Wingspan) { list.Add(1155710, entry.Measurement.ToString()); // Wingspan: ~1_VAL~ } else { list.Add(1072789, entry.Measurement.ToString()); // Weight: ~1_WEIGHT~ } } } if (HuntingSystem.Instance != null && HuntingSystem.Instance.Active) { list.Add("Season Ends: {0}", HuntingSystem.Instance.SeasonEnds.ToShortDateString()); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int v = reader.ReadInt(); m_Owner = reader.ReadMobile(); m_ProducedTrophy = reader.ReadBool(); m_HasSubmitted = reader.ReadBool(); if (reader.ReadInt() == 1) { m_KillEntry = new HuntingKillEntry(reader); } if (m_Owner != null && !m_HasSubmitted) { m_Permits.Add(this); } }
public BestKillGump(int filter) : base(20, 20) { if (HuntingSystem.Instance == null) { return; } m_Filter = filter; if (m_Filter < -1) { m_Filter = 23; } if (m_Filter > 23) { m_Filter = -1; } List <HuntingKillEntry> useList = new List <HuntingKillEntry>(); if (m_Filter == -1) { foreach (KeyValuePair <HuntType, List <HuntingKillEntry> > kvp in HuntingSystem.Instance.Top10) { if (kvp.Value.Count > 0) { useList.AddRange(kvp.Value); } } } else if (HuntingSystem.Instance.Top10.ContainsKey((HuntType)m_Filter)) { useList = HuntingSystem.Instance.Top10[(HuntType)m_Filter]; } AddBackground(0, 0, 500, 400, 9250); AddHtml(0, 15, 500, 16, "<Center>Top 10 Kills</Center>", false, false); AddHtml(20, 40, 150, 16, "<Basefont Color=#A52A2A>Hunter</Basefont>", false, false); AddHtml(170, 40, 120, 16, "<Basefont Color=#A52A2A>Species</Basefont>", false, false); AddHtml(290, 40, 150, 16, "<Basefont Color=#A52A2A>Measurement</Basefont>", false, false); AddHtml(390, 40, 110, 16, "<Basefont Color=#A52A2A>Date Killed</Basefont>", false, false); useList.Sort(); int y = 80; for (int i = 0; i < useList.Count && i < 10; i++) { HuntingKillEntry entry = useList[i]; HuntingTrophyInfo info = HuntingTrophyInfo.Infos[entry.KillIndex]; AddHtml(20, y, 150, 16, entry.Owner != null ? FormatFont(entry.Owner.Name, i) : FormatFont("Unknown", i), false, false); AddHtml(170, y, 120, 16, FormatFont(GetHuntTypeString(info.HuntType), i), false, false); AddHtml(290, y, 100, 16, info.MeasuredBy == MeasuredBy.Weight ? FormatFont(entry.Measurement.ToString() + " stones", i) : FormatFont(entry.Measurement.ToString() + " feet", i), false, false); AddHtml(390, y, 150, 16, FormatFont(entry.DateKilled.ToShortDateString(), i), false, false); y += 20; } AddHtml(0, 365, 500, 16, String.Format("<Center>{0}</Center>", GetHuntTypeString()), false, false); AddButton(150, 365, 4014, 4016, 1, GumpButtonType.Reply, 0); AddButton(328, 365, 4005, 4007, 2, GumpButtonType.Reply, 0); }