public bool Validate()
        {
            object root = RootParent;

            Mobile from = root as Mobile;

            if (from != null)
            {
                PlayerMobile pm    = from as PlayerMobile;
                AccessLevel  level = from.AccessLevel;

                if (pm != null)
                {
                    AccessLevelMod mod = AccessLevelToggler.RawAccessLevel(pm);
                    if (mod != null)
                    {
                        level = mod.Level;
                    }
                }

                if (level < m_AccessLevel)
                {
                    Delete();
                    return(false);
                }
            }

            return(true);
        }
Beispiel #2
0
        private static void OnLogin(LoginEventArgs e)
        {
            PlayerMobile mob = e.Mobile as PlayerMobile;

            if (AccessLevelToggler.GetRawAccessLevel(mob) == AccessLevel.Player)                 //Incase [staff was used
            {
                NameResultMessage result = NameVerification.Validate(mob.RawName, 2, 16, true, false, true, 1, NameVerification.SpaceDashPeriodQuote);
                if (result != NameResultMessage.Allowed)
                {
                    mob.SendGump(new NameChangeGump(mob));
                }
            }
        }
        public override bool VerifyMove(Mobile from)
        {
            PlayerMobile pm    = from as PlayerMobile;
            AccessLevel  level = from.AccessLevel;

            if (pm != null)
            {
                AccessLevelMod mod = AccessLevelToggler.RawAccessLevel(pm);
                if (mod != null)
                {
                    level = mod.Level;
                }
            }

            return(level >= m_AccessLevel);
        }
        public override bool OnEquip(Mobile from)
        {
            PlayerMobile pm    = from as PlayerMobile;
            AccessLevel  level = from.AccessLevel;

            if (pm != null)
            {
                AccessLevelMod mod = AccessLevelToggler.RawAccessLevel(pm);
                if (mod != null)
                {
                    level = mod.Level;
                }
            }

            if (level < m_AccessLevel)
            {
                from.SendMessage("You may not wear this.");
                return(false);
            }

            return(true);
        }