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(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(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(); } }