public override void GetProperties(ObjectPropertyList list) { base.GetProperties(list); list.Add(1151737, String.Format("#{0}", CityLoyaltySystem.CityLocalization(Entry.Destination))); // Destination City: ~1_city~ list.Add(1076255); // NO-TRADE int weight = Items.Sum(x => x.Amount); list.Add(1072241, "{0}\t{1}\t{2}\t{3}", Items.Count, DefaultMaxItems, weight, DefaultMaxWeight); // Contents: ~1_COUNT~/~2_MAXCOUNT items, ~3_WEIGHT~/~4_MAXWEIGHT~ stones list.Add(1072210, "75"); // Weight reduction: ~1_PERCENTAGE~% if (Entry.Details != null) { for (int i = 0; i < Entry.Details.Count; i++) { if (Utility.ToInt32(Entry.Details[i].Name) > 0) { list.Add(1116453 + i, String.Format("#{0}\t{1}\t{2}", Entry.Details[i].Name, Entry.Details[i].Count(this), Entry.Details[i].Amount)); // ~1_val~: ~2_val~/~3_val~ } else { list.Add(1116453 + i, String.Format("{0}\t{1}\t{2}", Entry.Details[i].Name, Entry.Details[i].Count(this), Entry.Details[i].Amount)); // ~1_val~: ~2_val~/~3_val~ } } } if (!Expired) { int hours = (int)Math.Max(1, (Expires - DateTime.UtcNow).TotalHours); list.Add(1153090, hours.ToString()); // Lifespan: ~1_val~ hours } }
public override void GetProperties(ObjectPropertyList list) { base.GetProperties(list); list.Add(1151737, String.Format("#{0}", CityLoyaltySystem.CityLocalization(Entry.Destination))); // Destination City: ~1_city~ list.Add(1076255); // NO-TRADE list.Add(1072210, "75"); // Weight reduction: ~1_PERCENTAGE~% if (Entry.Details != null) { for (int i = 0; i < Entry.Details.Count; i++) { if (Utility.ToInt32(Entry.Details[i].Name) > 0) { list.Add(1116453 + i, String.Format("#{0}\t{1}\t{2}", Entry.Details[i].Name, GetAmount(Entry.Details[i].ItemType), Entry.Details[i].Amount)); // ~1_val~: ~2_val~/~3_val~ } else { list.Add(1116453 + i, String.Format("{0}\t{1}\t{2}", Entry.Details[i].Name, GetAmount(Entry.Details[i].ItemType), Entry.Details[i].Amount)); // ~1_val~: ~2_val~/~3_val~ } } } if (!Expired) { int hours = (int)Math.Max(1, (Expires - DateTime.UtcNow).TotalHours); list.Add(1153090, hours.ToString()); // Lifespan: ~1_val~ hours } }
public override void AddGumpLayout() { base.AddGumpLayout(); if (Citizenship == null) { return; } AddHtmlLocalized(45, 40, 250, 16, 1152883, false, false); // Citizenship: AddHtmlLocalized(200, 40, 100, 16, CityLoyaltySystem.CityLocalization(Citizenship.City), false, false); AddHtmlLocalized(30, 70, 280, 200, 1152887, String.Format("#{0}", CityLoyaltySystem.GetCityLocalization(Citizenship.City).ToString()), 1, false, true); /*If you renounce your citizenship, you will be stripped of all titles gained with your current * city, and you must wait 7 days before declaring citizenship again.<br><br>Are you sure you wish * to renounce your citizenship with ~1_CITY~?*/ AddHtmlLocalized(115, 280, 150, 16, 1152888, false, false); // Renounce Citizenship AddButton(100, 285, 2103, 2104, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(115, 300, 150, 16, 1152889, false, false); // Cancel AddButton(100, 305, 2103, 2104, 2, GumpButtonType.Reply, 0); }
public override void AddGumpLayout() { if (!CityLoyaltySystem.Enabled || CityLoyaltySystem.Cities == null) { return; } base.AddGumpLayout(); int y = 40; for (int i = 0; i < CityLoyaltySystem.Cities.Count; i++) { CityLoyaltySystem city = CityLoyaltySystem.Cities[i]; if (city.CanUtilize && Citizenship == null && CityLoyaltySystem.CanAddCitizen(User)) { AddButton(30, y + 3, 2103, 2104, 100 + i, GumpButtonType.Reply, 0); } AddHtmlLocalized(50, y, 200, 16, CityLoyaltySystem.CityLocalization(city.City), false, false); AddHtmlLocalized(200, y, 200, 16, CityLoyaltySystem.RatingLocalization(city.GetLoyaltyRating(User)), false, false); y += 20; } y += 20; AddHtmlLocalized(70, y, 250, 16, 1152883, false, false); // Citizenship: AddHtmlLocalized(200, y, 100, 16, Citizenship != null ? CityLoyaltySystem.CityLocalization(Citizenship.City) : 1152884, false, false); y += 40; if (!CityLoyaltySystem.IsSetup()) { AddHtml(70, y, 250, 60, "City Loyalty System has not been enabled by your server owner yet.", false, false); } else if (Citizenship != null) { AddHtmlLocalized(115, y - 5, 150, 16, 1152890, false, false); // Citizenship Titles AddButton(100, y, 2103, 2104, 1, GumpButtonType.Reply, 0); y += 20; AddHtmlLocalized(115, y - 5, 150, 16, 1152888, false, false); // Renounce Citizenship AddButton(100, y, 2103, 2104, 2, GumpButtonType.Reply, 0); } else { if (CityLoyaltySystem.CanAddCitizen(User)) { AddHtmlLocalized(30, y, 280, 90, 1152885, false, false); /*Click the gem next to the name of a city to declare your * citizenship. You may renounce citizenship, but afterwards * you may not declare new citizenship for one week.*/ } else { AddHtmlLocalized(30, y, 285, 80, 1152886, CityLoyaltySystem.NextJoinCity(User).ToString(), 0, false, false); /*You recently renounced citizenship, so you must wait ~1_COUNT~ * more days before you may declare citizenship again.*/ } } }