public override void AddGumpLayout() { base.AddGumpLayout(); AddHtmlLocalized(57, 155, 100, 20, 1158040, false, false); // City: AddHtmlLocalized(110, 155, 200, 20, CityLoyaltySystem.GetCityLocalization(City), false, false); AddHtmlLocalized(57, 185, 50, 20, 1158027, false, false); // Author: AddLabel(110, 185, 0, Entry != null ? Entry.Author : User.Name); AddHtmlLocalized(58, 215, 100, 20, 1158026, false, false); // Headline: AddBackground(58, 235, 740, 20, 0x2486); AddTextEntry(59, 235, 739, 20, 0, 1, Entry != null ? Entry.Title : ""); AddHtmlLocalized(58, 265, 150, 20, 1158028, false, false); // Body Paragraph 1: AddBackground(58, 285, 740, 40, 0x2486); AddTextEntry(59, 285, 739, 40, 0, 2, Entry != null ? Entry.Body : ""); AddBackground(155, 330, 20, 20, 0x2486); AddHtmlLocalized(58, 330, 150, 20, 1158031, false, false); // Expiry (in days): AddTextEntry(155, 330, 19, 20, 0, 3, ""); AddImage(85, 425, 0x5EF); AddButton(40, 615, 0x601, 0x602, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(73, 615, 150, 20, 1077787, false, false); // Submit }
private void BuildCityPage() { AddButton(233, 150, City == City.Britain ? 0x5E5 : 0x5E4, City == City.Britain ? 0x5E5 : 0x5E4, 10, GumpButtonType.Reply, 0); AddTooltip(CityLoyaltySystem.GetCityLocalization(City.Britain)); AddButton(280, 150, City == City.Jhelom ? 0x5E7 : 0x5E6, City == City.Jhelom ? 0x5E7 : 0x5E6, 11, GumpButtonType.Reply, 0); AddTooltip(CityLoyaltySystem.GetCityLocalization(City.Jhelom)); AddButton(327, 150, City == City.Minoc ? 0x5E5 : 0x5E4, City == City.Minoc ? 0x5E5 : 0x5E4, 12, GumpButtonType.Reply, 0); AddTooltip(CityLoyaltySystem.GetCityLocalization(City.Minoc)); AddButton(374, 150, City == City.Moonglow ? 0x5E3 : 0x5E2, City == City.Moonglow ? 0x5E3 : 0x5E2, 13, GumpButtonType.Reply, 0); AddTooltip(CityLoyaltySystem.GetCityLocalization(City.Moonglow)); AddButton(418, 150, City == City.NewMagincia ? 0x5DD : 0x5DC, City == City.NewMagincia ? 0x5DD : 0x5DC, 14, GumpButtonType.Reply, 0); AddTooltip(CityLoyaltySystem.GetCityLocalization(City.NewMagincia)); AddButton(463, 150, City == City.SkaraBrae ? 0x5DF : 0x5DE, City == City.SkaraBrae ? 0x5DF : 0x5DE, 15, GumpButtonType.Reply, 0); AddTooltip(CityLoyaltySystem.GetCityLocalization(City.SkaraBrae)); AddButton(509, 150, City == City.Trinsic ? 0x5E1 : 0x5E0, City == City.Trinsic ? 0x5E1 : 0x5E0, 16, GumpButtonType.Reply, 0); AddTooltip(CityLoyaltySystem.GetCityLocalization(City.Trinsic)); AddButton(555, 150, City == City.Vesper ? 0x5ED : 0x5ED, City == City.Vesper ? 0x5ED : 0x5EC, 17, GumpButtonType.Reply, 0); AddTooltip(CityLoyaltySystem.GetCityLocalization(City.Vesper)); AddButton(601, 150, City == City.Yew ? 0x5E9 : 0x5E8, City == City.Yew ? 0x5E9 : 0x5E8, 18, GumpButtonType.Reply, 0); AddTooltip(CityLoyaltySystem.GetCityLocalization(City.Yew)); AddHtmlLocalized(0, 260, 854, 20, CenterLoc, string.Format("#{0}", TownCryerSystem.GetCityLoc(City)), 0, false, false); // The Latest News from the City of ~1_CITY~ int y = 300; for (int i = 0; i < TownCryerSystem.CityEntries.Count && i < TownCryerSystem.MaxPerCityGoverrnorEntries; i++) { var entry = TownCryerSystem.CityEntries[i]; if (entry.City != City) { continue; } AddButton(50, y, 0x5FB, 0x5FC, 300 + i, GumpButtonType.Reply, 0); AddLabelCropped(87, y, 700, 20, 0, entry.Title); var city = CityLoyaltySystem.GetCitizenship(User, false); if ((city != null && city.Governor == User) || User.AccessLevel >= AccessLevel.GameMaster) // Only Governors { AddButton(735, y, 0x5FD, 0x5FE, 3000 + i, GumpButtonType.Reply, 0); AddButton(760, y, 0x5FF, 0x600, 3500 + i, GumpButtonType.Reply, 0); } y += 23; } AddImage(230, 460, 0x5F0); }
public void OnBodTurnIn(PlayerMobile pm, FestivalElf elf, double points) { if (PointTable.ContainsKey(pm)) { PointTable[pm] += points; } else { PointTable[pm] = points; } var toNext = PointsToNext; if (toNext == -1) { return; } double perc = PointsThisStage / PointsToNext; if (perc >= 1.0) { elf.Say(1157164, string.Format("{0}\t#{1}", pm.Name, CityLoyaltySystem.GetCityLocalization(CurrentCity)), 1150); // ~1_PLAYER~ has advanced the Artisan Festival in the City of ~2_CITY~! TownTree.Stage++; FireworkShow(elf); } else { int loc; if (perc < .25) { loc = 1159273; // There is quite a ways to go before the tree will grow! } else if (perc < .50) { loc = 1159277; // The tree is about a quarter of the way before it will grow! } else if (perc < .75) { loc = 1159276; // The tree is about half way before it will grow! } else if (perc < .90) { loc = 1159275; // The tree is about a three-quarters of the way before it will grow! } else { loc = 1159274; // The tree is very close to being ready to grow! } Timer.DelayCall(() => elf.Say(loc, 1150)); } }
public override void OnClick() { CityLoyaltySystem thisSystem = CityLoyaltySystem.GetCityInstance(Guard.City); CityLoyaltySystem theirSystem = CityLoyaltySystem.GetCitizenship(Player); Guard.CheckBannerCooldown(); if (theirSystem != null && thisSystem != null && CityLoyaltySystem.HasCitizenship(Player, Guard.City)) { if (Guard.IsInBannerCooldown(Player)) { Guard.SayTo(Player, 1152364, string.Format("#{0}", CityLoyaltySystem.BannerLocalization(thisSystem.City))); // I have quite a backlog of orders and I cannot satisfy your request for a ~1_ITEM~ right now. } if (theirSystem.GetLoyaltyRating(Player) < LoyaltyRating.Adored) { Guard.SayTo(Player, 1152363, string.Format("#{0}", CityLoyaltySystem.GetCityLocalization(thisSystem.City))); // I apologize, but you are not well-enough renowned in the city of ~1_CITY~ to make this purchase. } else { string args = string.Format("#{0}\t{1}", CityLoyaltySystem.BannerLocalization(thisSystem.City), CityLoyaltySystem.BannerCost.ToString("N0", CultureInfo.GetCultureInfo("en-US"))); Player.SendGump(new ConfirmCallbackGump(Player, 1049004, 1152365, Player, args, Guard.OnConfirm)); } } }
public override void AddNameProperty(ObjectPropertyList list) { list.Add(1158906, String.Format("#{0}", CityLoyaltySystem.GetCityLocalization(_City).ToString())); // Maritime Trade Cargo Destined for ~1_CITY~ }