Esempio n. 1
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (from == null)
            {
                return;
            }

            Container pack = from.Backpack;

            string name = GetString(info, 1);

            if (name != null)
            {
                name = name.Trim();
            }

            if (name == "Type here...")
            {
            }
            else if (name != "")
            {
                if (!NameVerification.Validate(name, 2, 16, true, false, true, 1, NameVerification.SpaceOnly))
                {
                    from.SendMessage(0X22, "That name is unacceptable or already taken.");
                    return;
                }
                else if (CharacterCreation.CheckDupe(from, name) && pack.ConsumeTotal(typeof(Gold), 2000))
                {
                    from.SendMessage(0X22, "Your name is now {0}.", name);
                    from.Name     = name;
                    from.CantWalk = false;
                    return;
                }
                else if (CharacterCreation.CheckDupe(from, name) && !(pack.ConsumeTotal(typeof(Gold), 2000)))
                {
                    from.SendMessage(0X22, "You do not have enough gold!");
                    return;
                }
                else
                {
                    from.SendMessage(0X22, "That name is unacceptable or already taken.");
                    return;
                }
            }
            else
            {
                from.SendMessage(0X22, "You must enter a name.");
            }
        }
Esempio n. 2
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (from == null)
            {
                return;
            }

            string name = GetString(info, 1);

            if (name != null)
            {
                name = name.Trim();
            }
            else
            {
                from.SendMessage(0X22, "You may enter a name.");
                from.SendGump(new NameAlterGump(from));
            }

            if (name != "")
            {
                if (!NameVerification.Validate(name, 2, 16, true, false, true, 1, NameVerification.SpaceOnly))
                {
                    from.SendMessage(0X22, "That name is unacceptable or already taken.");
                    return;
                }
                else if (CharacterCreation.CheckDupe(from, name))
                {
                    from.SendMessage(0X22, "Your name is now {0}.", name);
                    from.Name     = name;
                    from.CantWalk = false;
                    return;
                }
                else if (CharacterCreation.CheckDupe(from, name))
                {
                    from.SendMessage(0X22, "That name is unacceptable or already taken.");
                    return;
                }
            }
            else
            {
                from.SendMessage(0X22, "You must enter a name.");
            }

            from.SendGump(new NameAlterGump(from));
        }