public override void OnResponse(Mobile from, string text) { if (m_Item == null || m_Item.Deleted) { return; } if (m_Item.IsChildOf(from.Backpack)) { string title = Utility.FixHtml(text.Trim()); if (title.Length > 20) { from.SendLocalizedMessage(501178); // That title is too long. } else if (!BaseGuildGump.CheckProfanity(title)) { from.SendLocalizedMessage(501179); // That title is disallowed. } else { from.Title = title; from.SendAsciiMessage("Your title has been changed!"); Effects.SendLocationEffect(from.Location, from.Map, 14170, 20, 1944, 0); from.PlaySound(0x064C); m_Item.Consume(); } } else { from.SendLocalizedMessage(1045156); // You must have the deed in your backpack to use it. } }
public override void OnResponse(NetState state, RelayInfo info) { if ((Guild.NewGuildSystem && !BaseGuildGump.IsLeader(m_Mobile, m_Guild)) || (!Guild.NewGuildSystem && GuildGump.BadLeader(m_Mobile, m_Guild))) { return; } GuildType newType; switch (info.ButtonID) { default: newType = m_Guild.Type; break; case 1: newType = GuildType.Regular; break; case 2: newType = GuildType.Order; break; case 3: newType = GuildType.Chaos; break; } if (m_Guild.Type != newType) { PlayerState pl = PlayerState.Find(m_Mobile); if (pl != null) { m_Mobile.SendLocalizedMessage(1010405); // You cannot change guild types while in a Faction! } else if (m_Guild.TypeLastChange.AddDays(7) > DateTime.Now) { m_Mobile.SendLocalizedMessage(1011142); // You have already changed your guild type recently. // TODO: Clilocs 1011142-1011145 suggest a timer for pending changes } else { m_Guild.Type = newType; m_Guild.GuildMessage(1018022, true, newType.ToString()); // Guild Message: Your guild type has changed: } } if (Guild.NewGuildSystem) { if (m_Mobile is PlayerMobile) { m_Mobile.SendGump(new GuildInfoGump((PlayerMobile)m_Mobile, m_Guild)); } return; } GuildGump.EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild)); }
public override void OnResponse(RelayInfo info) { TextRelay relay = info.GetTextEntry(1); CityLoyaltyEntry entry = City.GetPlayerEntry <CityLoyaltyEntry>(Citizen); if (entry == null) { return; } if (relay == null || string.IsNullOrEmpty(relay.Text)) { if (entry != null) { entry.CustomTitle = null; Citizen.RemoveRewardTitle(1154017, true); if (User != Citizen) { User.SendMessage("You have removed their title."); Citizen.SendMessage("{0} has removed your city title.", User.Name); } else { User.SendMessage("You have removed your title."); } } } else { string text = Utility.FixHtml(relay.Text); if (BaseGuildGump.CheckProfanity(text) && text.Trim().Length > 3) { if (entry != null && entry.IsCitizen) { Citizen.AddRewardTitle(1154017); // ~1_TITLE~ of ~2_CITY~ entry.CustomTitle = text.Trim(); if (User != Citizen) { User.SendMessage("You have bestowed {0} the title: {1} of {2}.", Citizen.Name, text, City.Definition.Name); } Citizen.SendLocalizedMessage(1155605, string.Format("{0}\t{1}", text, City.Definition.Name)); // Thou hath been bestowed the title ~1_TITLE~! - ~1_TITLE~ of ~2_CITY~ } } else { User.SendLocalizedMessage(501179); // That title is disallowed. } } }
public override void OnResponse(NetState state, RelayInfo info) { if (Guild.NewGuildSystem && !BaseGuildGump.IsLeader(m_Mobile, m_Guild) || !Guild.NewGuildSystem && GuildGump.BadLeader(m_Mobile, m_Guild)) { return; } var newType = info.ButtonID switch { 1 => GuildType.Regular, 2 => GuildType.Order, 3 => GuildType.Chaos, _ => m_Guild.Type }; if (m_Guild.Type != newType) { var pl = PlayerState.Find(m_Mobile); if (pl != null) { m_Mobile.SendLocalizedMessage(1010405); // You cannot change guild types while in a Faction! } else if (m_Guild.TypeLastChange.AddDays(7) > Core.Now) { m_Mobile.SendLocalizedMessage(1011142); // You have already changed your guild type recently. // TODO: Clilocs 1011142-1011145 suggest a timer for pending changes } else { m_Guild.Type = newType; m_Guild.GuildMessage(1018022, true, newType.ToString()); // Guild Message: Your guild type has changed: } } if (Guild.NewGuildSystem) { if (m_Mobile is PlayerMobile mobile) { mobile.SendGump(new GuildInfoGump(mobile, m_Guild)); } return; } GuildGump.EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild)); } }
public override void OnResponse(NetState state, RelayInfo info) { if ((Guild.NewGuildSystem && !BaseGuildGump.IsLeader(m_Mobile, m_Guild)) || (!Guild.NewGuildSystem && GuildGump.BadLeader(m_Mobile, m_Guild))) { return; } if (m_Guild.TypeLastChange.AddDays(7) > DateTime.Now) { m_Mobile.SendLocalizedMessage(1005292); // Your guild type will be changed in one week. } else { GuildType newType; switch (info.ButtonID) { default: return; // Close case 1: newType = GuildType.Regular; break; case 2: newType = GuildType.Order; break; case 3: newType = GuildType.Chaos; break; } if (m_Guild.Type == newType) { return; } m_Guild.Type = newType; m_Guild.GuildMessage(1018022, true, newType.ToString()); // Guild Message: Your guild type has changed: } if (Guild.NewGuildSystem) { if (m_Mobile is PlayerMobile) { m_Mobile.SendGump(new GuildInfoGump((PlayerMobile)m_Mobile, m_Guild)); } return; } GuildGump.EnsureClosed(m_Mobile); m_Mobile.SendGump(new GuildmasterGump(m_Mobile, m_Guild)); }
public override void OnResponse(NetState state, RelayInfo info) { switch (info.ButtonID) { case 0: break; case 1: User.LaunchBrowser("http://uo.com/wiki/ultima-online-wiki/publish-notes/publish-86/"); User.SendGump(new ConfirmSignupGump(User)); break; case 2: Guild g = User.Guild as Guild; if (g != null && BaseGuildGump.IsLeader(User, g)) { ViceVsVirtueSystem.Instance.TryAddGuild(g); } break; } }
public override void OnResponse(Mobile from, string text) { if (m_Deed == null || m_Deed.Deleted || m_Cloth == null || m_Cloth.Deleted) { return; } if (!m_Deed.IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1045156); // You must have the deed in your backpack to use it. return; } if (!m_Cloth.IsChildOf(from.Backpack)) { from.SendAsciiMessage("The clothing must be in your backpack."); return; } string name = Utility.FixHtml(text.Trim()); if (name.Length > 20) { from.SendAsciiMessage("That name is too long."); } else if (!BaseGuildGump.CheckProfanity(name)) { from.SendAsciiMessage("That name is disallowed."); } else { m_Cloth.Name = name; from.SendAsciiMessage("The name on your clothing has been changed!"); Effects.SendLocationEffect(from.Location, from.Map, 14170, 20, 1946, 0); from.PlaySound(0x064E); m_Deed.Consume(); } }