public static void GetContextMenus(TownCrier tc, Mobile from, List <ContextMenuEntry> list) { if (from is PlayerMobile) { var pm = from as PlayerMobile; if (pm.AccessLevel >= EMAccess) { list.Add(new UpdateEMEntry(tc)); } var system = CityLoyaltySystem.GetCitizenship(pm, false); if (IsGovernor(pm, system)) { list.Add(new UpdateCityEntry(tc, system.City)); } Guild g = pm.Guild as Guild; if (g != null && pm.GuildRank != null && pm.GuildRank.Rank >= 3 && g.Leader == pm && (pm.AccessLevel > AccessLevel.Player || g.Members.Count >= MinGuildMemberCount)) { list.Add(new UpdateGuildEntry(from, tc)); } } }
public override void OnDoubleClick(Mobile from) { if (CityLoyaltySystem.Enabled && CityLoyaltySystem.IsSetup() && from.InRange(Location, 3)) { if (_Cooldown == null || !_Cooldown.ContainsKey(from) || _Cooldown[from] < DateTime.UtcNow) { var rope = new GuardsmansRope(); from.AddToBackpack(rope); from.SendLocalizedMessage(1152263); // You take a rope from the chest. Use it to arrest rioters and subdued raiders. if (_Cooldown == null) { _Cooldown = new Dictionary <Mobile, DateTime>(); } _Cooldown[from] = DateTime.UtcNow + TimeSpan.FromSeconds(60); } else { from.SendLocalizedMessage(1152264); // You must wait a moment before taking another rope. } } else { from.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x3B2, 1019045, from.NetState); // I can't reach that. } }
public static void Configure() { EventSink.WorldSave += OnSave; EventSink.WorldLoad += OnLoad; EventSink.QuestComplete += CompleteQuest; EventSink.OnKilledBy += OnKilledBy; Systems = new List <PointsSystem>(); QueensLoyalty = new QueensLoyalty(); VoidPool = new VoidPool(); DespiseCrystals = new DespiseCrystals(); ShameCrystals = new ShameCrystals(); CasinoData = new CasinoData(); Blackthorn = new BlackthornData(); CleanUpBritannia = new CleanUpBritanniaData(); ViceVsVirtue = new ViceVsVirtueSystem(); TreasuresOfKotlCity = new KotlCityData(); CityLoyaltySystem.ConstructSystems(); ArenaSystem = new PVPArenaSystem(); Khaldun = new KhaldunData(); TreasuresOfDoom = new DoomData(); SorcerersDungeon = new SorcerersDungeonData(); RisingTide = new RisingTide(); DoomGauntlet = new DoomGauntlet(); TreasuresOfTokuno = new TreasuresOfTokuno(); VirtueArtifacts = new VirtueArtifactsSystem(); FellowshipData = new FellowshipData(); }
private void IncreaseStage(int newStage) { if (newStage > 0) { RemoveCurrentTCMessage(); } if (newStage < Stages) { var cityInstance = CityLoyaltySystem.GetCityInstance(CityOrder[newStage]); if (cityInstance != null && cityInstance.Treasury >= (long)_DefaultCityGold) { Stage++; AddCurrentTCMessage(); } else { IncreaseStage(++newStage); } } else { Deactivate(); } }
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 }
public InternalEntry(PlayerMobile from, GuardCaptain guard) : base(1152366, 3) // City Banner { Player = from; Guard = guard; Enabled = CityLoyaltySystem.HasCitizenship(from, Guard.City); }
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 string ToString() { var sys = CityLoyaltySystem.GetCitizenship(Player, false); if (sys != null) { return(String.Format("Citizenship: {0}", sys.City.ToString())); } return(base.ToString()); }
//This logic determines worthiness via city loyalty. public override bool CanOffer() { CityLoyaltySystem system = CityLoyaltySystem.Monitor; //UOSI Make this Monitor if (system != null) { if (system.GetLoyaltyRating(Owner) >= LoyaltyRating.Commended) { return(true); } } return(false); }
public static void Configure() { EventSink.WorldSave += OnSave; EventSink.WorldLoad += OnLoad; Systems = new List <PointsSystem>(); QueensLoyalty = new QueensLoyalty(); VoidPool = new VoidPool(); DespiseCrystals = new DespiseCrystals(); ShameCrystals = new ShameCrystals(); CasinoData = new CasinoData(); Blackthorn = new BlackthornData(); CityLoyaltySystem.ConstructSystems(); }
private void SetDefaultCity() { if (LastCity == null || !LastCity.ContainsKey(User)) { LastCity = new Dictionary <PlayerMobile, City>(); var system = CityLoyaltySystem.GetCitizenship(User, false); if (system != null) { LastCity[User] = system.City; } } else { LastCity[User] = _City; } }
public override void OnClick() { if (Owner.From is PlayerMobile pm) { CityLoyaltySystem system = CityLoyaltySystem.GetCitizenship(pm, false); if (TownCryerSystem.IsGovernor(pm, system)) { if (TownCryerSystem.CityEntryCount(system.City) < TownCryerSystem.MaxPerCityGoverrnorEntries) { BaseGump.SendGump(new CreateCityEntryGump(pm, Cryer, system.City)); } else { pm.SendLocalizedMessage(1158038); // You have reached the maximum entry count. Please remove some and try again. } } } }
public static void Configure() { EventSink.WorldSave += OnSave; EventSink.WorldLoad += OnLoad; Systems = new List <PointsSystem>(); QueensLoyalty = new QueensLoyalty(); VoidPool = new VoidPool(); DespiseCrystals = new DespiseCrystals(); ShameCrystals = new ShameCrystals(); CasinoData = new CasinoData(); Blackthorn = new BlackthornData(); CleanUpBritannia = new CleanUpBritanniaData(); ViceVsVirtue = new ViceVsVirtueSystem(); TreasuresOfKotlCity = new KotlCityData(); CityLoyaltySystem.ConstructSystems(); }
public override void OnClick() { if (Player.Prompt != null) { Player.SendLocalizedMessage(1079166); // You already have a text entry request pending. } else { Player.SendLocalizedMessage(1155865); // Enter amount to deposit: Player.BeginPrompt( (from, text) => { int amount = Utility.ToInt32(text); if (amount > 0) { if (Banker.Withdraw(from, amount, true)) { CityLoyaltySystem.GetCityInstance(Herald.City).AddToTreasury(from, amount, true); Herald.SayTo(from, 1152926); // The City thanks you for your generosity! } else { from.SendLocalizedMessage(1155867); // The amount entered is invalid. Verify that there are sufficient funds to complete this transaction. } } else { from.SendLocalizedMessage(1155867); // The amount entered is invalid. Verify that there are sufficient funds to complete this transaction. } }, (from, text) => { from.SendLocalizedMessage(1155867); // The amount entered is invalid. Verify that there are sufficient funds to complete this transaction. }); } }
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 static bool IsGovernor(PlayerMobile pm, CityLoyaltySystem system) { return(system != null && system.Governor == pm); }
private void BuildSubtitle() { int y = 190; Guild guild = User.Guild as Guild; AddHtmlLocalized(55, y, 160, 16, 1115030, 0xFFFF, false, false); // Skills AddCallbackButton(20, y, 4005, 4007, 400, GumpButtonType.Reply, 0, b => { Category = TitleCategory.Skills; ShowingDescription = false; TitleClearing = false; Refresh(); }); y += 22; if (guild != null && User.GuildTitle != null) { AddHtmlLocalized(55, y, 160, 16, 1115033, 0xFFFF, false, false); // GUILD AddCallbackButton(20, y, 4005, 4007, 401, GumpButtonType.Reply, 0, b => { Category = TitleCategory.Guild; ShowingDescription = false; TitleClearing = false; Refresh(); }); y += 22; } if (User.CollectionTitles != null && User.CollectionTitles.Count > 0) { AddHtmlLocalized(55, y, 160, 16, 1115034, 0xFFFF, false, false); // Rewards AddCallbackButton(20, y, 4005, 4007, 402, GumpButtonType.Reply, 0, b => { Category = TitleCategory.RewardTitles; ShowingDescription = false; TitleClearing = false; Refresh(); }); y += 22; } List <VeteranTitle> vetTitles = Titles.GetVeteranTitles(User); if (vetTitles != null && vetTitles.Count > 0) { AddHtml(55, y, 160, 16, Color("#FFFFFF", "Veterans"), false, false); // Rewards AddCallbackButton(20, y, 4005, 4007, 403, GumpButtonType.Reply, 0, b => { Category = TitleCategory.Veteran; ShowingDescription = false; TitleClearing = false; Refresh(); }); } if (Category == TitleCategory.Skills) { if (!ShowingDescription || TitleSelected == -1) { int index = 0; int page = 1; AddPage(page); foreach (Skill sk in User.Skills) { if (sk.Base < 30) { continue; } AddHtml(260, 70 + (index * 22), 245, 16, Color("#FFFFFF", Titles.GetSkillTitle(User, sk)), false, false); AddCallbackButton(225, 70 + (index * 22), 4005, 4007, sk.Info.SkillID + 404, GumpButtonType.Reply, 0, b => { TitleSelected = b.ButtonID - 404; ShowingDescription = true; Refresh(); }); index++; CheckPage(ref index, ref page); } } else { string title = Titles.GetSkillTitle(User, User.Skills[(SkillName)TitleSelected]); AddHtmlLocalized(225, 70, 270, 140, 1115056 + TitleSelected, 0xFFFF, false, false); AddHtmlLocalized(225, 220, 160, 16, 1115029, 0xFFFF, false, false); // Subtitle AddHtml(275, 240, 245, 16, Color("#FFFFFF", title), false, false); AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title? AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false); // APPLY AddCallbackButton(445, 275, 4005, 4007, 102, GumpButtonType.Reply, 0, b => { AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED title = Titles.GetSkillTitle(User, User.Skills[(SkillName)TitleSelected]); User.SubtitleSkillTitle = title; User.SelectCollectionTitle(-1, true); User.DisplayGuildTitle = false; Refresh(false); }); } } else if (Category == TitleCategory.Guild && guild != null && User.GuildTitle != null) { if (!ShowingDescription || TitleSelected == -1) { AddHtml(260, 70, 245, 16, Color("#FFFFFF", String.Format("{0}, {1}", Utility.FixHtml(User.GuildTitle), Utility.FixHtml(guild.Name))), false, false); AddCallbackButton(225, 70, 4005, 4007, 500, GumpButtonType.Reply, 0, b => { TitleSelected = 1; ShowingDescription = true; Refresh(); }); } else { AddHtmlLocalized(225, 70, 270, 140, 1115039, 0xFFFF, false, false); // This is a custom guild title assigned by your guild leader. AddHtmlLocalized(225, 220, 160, 16, 1115029, 0xFFFF, false, false); // Subtitle AddHtml(275, 240, 245, 16, Color("#FFFFFF", String.Format("{0}, {1}", Utility.FixHtml(User.GuildTitle), Utility.FixHtml(guild.Name))), false, false); AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title? AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false); // APPLY AddCallbackButton(445, 275, 4005, 4007, 599, GumpButtonType.Reply, 0, b => { AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED User.DisplayGuildTitle = true; if (User.SubtitleSkillTitle != null) { User.SubtitleSkillTitle = null; } User.SelectCollectionTitle(-1, true); Refresh(false); }); } } else if (Category == TitleCategory.RewardTitles && User.CollectionTitles != null && User.CollectionTitles.Count > 0) { if (!ShowingDescription || TitleSelected == -1) { int index = 0; int page = 1; AddPage(page); for (int i = 0; i < User.CollectionTitles.Count; i++) { object title = User.CollectionTitles[i]; if (title is int) { string cust = null; if ((int)title == 1154017 && CityLoyaltySystem.HasCustomTitle(User, out cust)) { AddHtmlLocalized(260, 70 + (index * 22), 245, 16, 1154017, cust, 0xFFFF, false, false); } else { AddHtmlLocalized(260, 70 + (index * 22), 245, 16, (int)title, 0xFFFF, false, false); } } else if (title is string) { AddHtml(260, 70 + (index * 22), 245, 16, Color("#FFFFFF", (string)title), false, false); } AddCallbackButton(225, 70 + (index * 22), 4005, 4007, i + 600, GumpButtonType.Reply, 0, b => { TitleSelected = b.ButtonID - 600; ShowingDescription = true; Refresh(); }); index++; CheckPage(ref index, ref page); } } else if (TitleSelected >= 0 && User.CollectionTitles != null && TitleSelected < User.CollectionTitles.Count) { object title = User.CollectionTitles[TitleSelected]; object description = GetRewardTitleInfo(title); if (description is int) { AddHtmlLocalized(225, 70, 270, 140, (int)description, 0xFFFF, false, false); } else if (description is string) { AddHtml(225, 70, 270, 140, Color("#FFFFFF", (string)description), false, false); } AddHtmlLocalized(225, 220, 160, 16, 1115029, 0xFFFF, false, false); // Subtitle if (title is int) { string cust = null; if ((int)title == 1154017 && CityLoyaltySystem.HasCustomTitle(User, out cust)) { AddHtmlLocalized(275, 240, 245, 16, 1154017, cust, 0xFFFF, false, false); } else { AddHtmlLocalized(275, 240, 160, 32, (int)title, 0xFFFF, false, false); } } else { AddHtml(275, 240, 245, 16, Color("#FFFFFF", (string)title), false, false); } AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title? AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false); // APPLY AddCallbackButton(445, 275, 4005, 4007, 699, GumpButtonType.Reply, 0, b => { AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED Refresh(false); User.SelectCollectionTitle(TitleSelected, true); if (User.SubtitleSkillTitle != null) { User.SubtitleSkillTitle = null; } User.DisplayGuildTitle = false; }); } } else if (Category == TitleCategory.Veteran && vetTitles != null && vetTitles.Count > 0) { if (!ShowingDescription || TitleSelected == -1) { int index = 0; int page = 1; AddPage(page); for (int i = 0; i < vetTitles.Count; i++) { AddHtmlLocalized(260, 70 + (index * 22), 245, 16, vetTitles[i].Title, 0xFFFF, false, false); AddCallbackButton(225, 70 + (index * 22), 4005, 4007, i + 700, GumpButtonType.Reply, 0, b => { TitleSelected = b.ButtonID - 700; ShowingDescription = true; Refresh(); }); index++; CheckPage(ref index, ref page); } } else if (TitleSelected >= 0 && TitleSelected < vetTitles.Count) { VeteranTitle title = vetTitles[TitleSelected]; AddHtmlLocalized(225, 70, 270, 200, title.Title + 410, 0xFFFF, false, false); AddHtmlLocalized(225, 220, 160, 16, 1115029, 0xFFFF, false, false); // Subtitle AddHtmlLocalized(275, 240, 160, 32, title.Title, 0xFFFF, false, false); AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title? AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false); // APPLY AddCallbackButton(445, 275, 4005, 4007, 799, GumpButtonType.Reply, 0, b => { AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED title = vetTitles[TitleSelected]; User.CurrentVeteranTitle = title.Title; Refresh(false); }); } } }
private void BuildOverheadName() { int y = 190; AddHtmlLocalized(55, y, 160, 16, 1115030, 0xFFFF, false, false); // Skills AddCallbackButton(20, y, 4005, 4007, 300, GumpButtonType.Reply, 0, b => { Category = TitleCategory.Skills; ShowingDescription = false; TitleClearing = false; Refresh(); }); y += 22; List <int> rewards = GetCityTitles(); if (rewards != null && rewards.Count > 0) { AddHtmlLocalized(55, y, 160, 16, 1115034, 0xFFFF, false, false); // Rewards AddCallbackButton(20, y, 4005, 4007, 5435, GumpButtonType.Reply, 0, b => { Category = TitleCategory.RewardTitles; ShowingDescription = false; TitleClearing = false; Refresh(); }); y += 22; } Guild g = User.Guild as Guild; if (g != null) { AddHtmlLocalized(55, y, 160, 16, 1115033, 0xFFFF, false, false); // GUILD AddCallbackButton(20, y, 4005, 4007, 301, GumpButtonType.Reply, 0, b => { Category = TitleCategory.Guild; ShowingDescription = false; TitleClearing = false; Refresh(); }); } if (Category == TitleCategory.Skills) { if (!ShowingDescription || TitleSelected == -1) { int index = 0; int page = 1; AddPage(page); foreach (Skill sk in User.Skills) { if (sk.Base < 30) { continue; } AddHtml(260, 70 + (index * 22), 245, 16, Color("#FFFFFF", "the " + sk.Info.Title), false, false); AddCallbackButton(225, 70 + (index * 22), 4005, 4007, sk.Info.SkillID + 302, GumpButtonType.Reply, 0, b => { TitleSelected = b.ButtonID - 302; ShowingDescription = true; Refresh(); }); index++; CheckPage(ref index, ref page); /*if ((SkillName)sk.Info.SkillID == User.Skills.CurrentMastery && User.Skills.CurrentMastery != SkillName.Alchemy) * { * AddHtml(260, 70 + (index * 22), 160, 16, Color("#FFFFFF", MasteryInfo.GetTitle(User)), false, false); * AddCallbackButton(225, 70 + (index * 22), 4005, 4007, 350, GumpButtonType.Reply, 0, b => * { * TitleSelected = 350; * ShowingDescription = true; * Refresh(); * }); * * index++; * } * * CheckPage(ref index, ref page);*/ } } else { string title; int desc; /*if (TitleSelected == 350) * { * title = MasteryInfo.GetTitle(User); * desc = MasteryInfo.GetDescription(User); * } * else * { * title = "the " + User.Skills[(SkillName)TitleSelected].Info.Title; * desc = 1115056 + TitleSelected; * }*/ title = "the " + User.Skills[(SkillName)TitleSelected].Info.Title; desc = 1115056 + TitleSelected; AddHtmlLocalized(225, 70, 270, 140, desc, 0xFFFF, false, false); AddHtmlLocalized(225, 220, 160, 16, 1115028, 0xFFFF, false, false); // Overhead Name AddHtml(275, 240, 245, 16, Color("#FFFFFF", title), false, false); AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title? AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false); // APPLY AddCallbackButton(445, 275, 4005, 4007, 399, GumpButtonType.Reply, 0, b => { AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED title = "the " + User.Skills[(SkillName)TitleSelected].Info.Title; User.OverheadTitle = title; Refresh(false); }); } } else if (Category == TitleCategory.Guild && g != null) { if (!ShowingDescription || TitleSelected == -1) { AddHtml(260, 70, 160, 16, Color("#FFFFFF", String.Format("[{0}]", g.Abbreviation)), false, false); AddCallbackButton(225, 70, 4005, 4007, 397, GumpButtonType.Reply, 0, b => { ShowingDescription = true; TitleSelected = 351; Refresh(); }); } else { AddHtmlLocalized(225, 65, 270, 140, 1115040, 0xFFFF, false, false); // This is your guild's abbreviation. AddHtmlLocalized(225, 220, 160, 16, 1115028, 0xFFFF, false, false); // Overhead Name AddHtml(275, 240, 245, 16, Color("#FFFFFF", String.Format("[{0}]", g.Abbreviation)), false, false); AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title? AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false); // APPLY AddCallbackButton(445, 275, 4005, 4007, 398, GumpButtonType.Reply, 0, b => { AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED Refresh(false); User.OverheadTitle = null; User.ShowGuildAbbreviation = true; }); } } else if (Category == TitleCategory.RewardTitles && rewards != null && rewards.Count > 0) { if (!ShowingDescription || TitleSelected == -1) { int index = 0; int page = 1; AddPage(page); for (int i = 0; i < rewards.Count; i++) { int title = rewards[i]; if (title == 1154017) { continue; } AddHtmlLocalized(260, 70 + (index * 22), 245, 16, (int)title, 0xFFFF, false, false); AddCallbackButton(225, 70 + (index * 22), 4005, 4007, i + 2550, GumpButtonType.Reply, 0, b => { TitleSelected = b.ButtonID - 2550; ShowingDescription = true; Refresh(); }); index++; CheckPage(ref index, ref page); } } else if (TitleSelected >= 0 && TitleSelected < rewards.Count) { int title = rewards[TitleSelected]; object description = GetRewardTitleInfo(title); if (description is int) { AddHtmlLocalized(225, 70, 270, 140, (int)description, 0xFFFF, false, false); } else if (description is string) { AddHtml(225, 70, 270, 140, Color("#FFFFFF", (string)description), false, false); } AddHtmlLocalized(225, 220, 160, 16, 1115029, 0xFFFF, false, false); // Subtitle string cust = null; if (title == 1154017 && CityLoyaltySystem.HasCustomTitle(User, out cust)) { AddHtmlLocalized(275, 240, 245, 16, 1154017, cust, 0xFFFF, false, false); } else { AddHtmlLocalized(275, 240, 160, 32, (int)title, 0xFFFF, false, false); } AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title? AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false); // APPLY AddCallbackButton(445, 275, 4005, 4007, 5789, GumpButtonType.Reply, 0, b => { AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED Refresh(false); title = rewards[TitleSelected]; User.OverheadTitle = title.ToString(); }); } } }
public override void AddNameProperty(ObjectPropertyList list) { list.Add(1158906, String.Format("#{0}", CityLoyaltySystem.GetCityLocalization(_City).ToString())); // Maritime Trade Cargo Destined for ~1_CITY~ }
public override void OnResponse(RelayInfo info) { int id = info.ButtonID; switch (id) { case 0: break; case 1: case 2: case 3: case 4: { Category = (GumpCategory)id; Refresh(); break; } case 5: // << { Page = 0; Refresh(); break; } case 6: // < { Page = Math.Max(0, Page - 1); Refresh(); break; } case 7: // > { Page = Math.Min(Pages, Page + 1); Refresh(); break; } case 8: // >> { Page = Pages; Refresh(); break; } case 9: // Learn More - EM Page { User.LaunchBrowser(TownCryerSystem.EMEventsPage); Refresh(); break; } case 10: { City = City.Britain; Refresh(); break; } case 11: { City = City.Jhelom; Refresh(); break; } case 12: { City = City.Minoc; Refresh(); break; } case 13: { City = City.Moonglow; Refresh(); break; } case 14: { City = City.NewMagincia; Refresh(); break; } case 15: { City = City.SkaraBrae; Refresh(); break; } case 16: { City = City.Trinsic; Refresh(); break; } case 17: { City = City.Vesper; Refresh(); break; } case 18: { City = City.Yew; Refresh(); break; } default: { if (id < 200) { id -= 100; if (id >= 0 && id < TownCryerSystem.NewsEntries.Count) { BaseGump.SendGump(new TownCryerNewsGump(User, Cryer, TownCryerSystem.NewsEntries[id])); } } else if (id < 300) { id -= 200; if (id >= 0 && id < TownCryerSystem.ModeratorEntries.Count) { BaseGump.SendGump(new TownCryerEventModeratorGump(User, Cryer, TownCryerSystem.ModeratorEntries[id])); } } else if (id < 400) { id -= 300; if (id >= 0 && id < TownCryerSystem.CityEntries.Count) { BaseGump.SendGump(new TownCryerCityGump(User, Cryer, TownCryerSystem.CityEntries[id])); } } else if (id < 600) { id -= 400; if (id >= 0 && id < TownCryerSystem.GuildEntries.Count) { BaseGump.SendGump(new TownCryerGuildGump(User, Cryer, TownCryerSystem.GuildEntries[id])); } } else if (id < 3000) { if (id < 2500) { id -= 2000; if (id >= 0 && id < TownCryerSystem.ModeratorEntries.Count) { BaseGump.SendGump(new CreateEMEntryGump(User, Cryer, TownCryerSystem.ModeratorEntries[id])); } } else { id -= 2500; if (id >= 0 && id < TownCryerSystem.ModeratorEntries.Count) { TownCryerSystem.ModeratorEntries.RemoveAt(id); } Refresh(); } } else if (id < 4000) { var city = CityLoyaltySystem.GetCitizenship(User, false); if ((city != null && city.Governor == User) || User.AccessLevel >= AccessLevel.GameMaster) // Only Governors { if (id < 3500) { id -= 3000; if (id >= 0 && id < TownCryerSystem.CityEntries.Count) { BaseGump.SendGump(new CreateCityEntryGump(User, Cryer, City, TownCryerSystem.CityEntries[id])); } } else { id -= 3500; if (id >= 0 && id < TownCryerSystem.CityEntries.Count) { TownCryerSystem.CityEntries.RemoveAt(id); } } } Refresh(); } else if (id < 5000) { if (id < 4500) { id -= 4000; if (id >= 0 && id < TownCryerSystem.GuildEntries.Count) { BaseGump.SendGump(new CreateGuildEntryGump(User, Cryer, TownCryerSystem.GuildEntries[id])); } } else { id -= 4500; if (id >= 0 && id < TownCryerSystem.GuildEntries.Count) { TownCryerSystem.GuildEntries.RemoveAt(id); } Refresh(); } } } break; } }
public override bool CanPostGreeting(Server.Multis.BaseHouse house, Mobile m) { CityLoyaltySystem sys = CitySystem; return(sys != null && (m.AccessLevel >= AccessLevel.GameMaster || sys.Governor == m)); }