public override void OnResponse(Mobile from, string text) { Regex InvalidPatt = new Regex("[^-a-zA-Z0-9' ]"); if (InvalidPatt.IsMatch(text)) { // Invalid chars from.SendMessage("You may only use numbers, letters, apostrophes, hyphens and spaces in the name to be changed."); } else if (!NameVerification.Validate(text, 2, 16, true, true, true, 1, NameVerification.SpaceDashPeriodQuote, NameVerification.BuildList(true, true, false, true))) { // Invalid for some other reason from.SendMessage("That title is not allowed here."); } else { vendor.Title = text; from.SendMessage("Thou hast successfully changed thy servant's title."); m_deed.Delete(); } }
public override void OnResponse(Mobile from, string text) { char[] exceptions = new char[] { ' ', '-', '.', '\'', ':', ',' }; Regex InvalidPatt = new Regex("[^-a-zA-Z0-9':, ]"); if (InvalidPatt.IsMatch(text)) { // Invalid chars from.SendMessage("You may only use numbers, letters, apostrophes, hyphens, colons, commas, and spaces in the inscription."); } else if (!NameVerification.Validate(text, 2, 32, true, true, true, 4, exceptions, NameVerification.BuildList(true, true, false, true))) { // Invalid for some other reason from.SendMessage("That inscription is not allowed here."); } else { m_rose.Name = text; m_rose.Personalized = true; from.SendMessage("Thou hast successfully inscribed thy rose."); } }