Exemple #1
0
        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.GetMod(pm);
                    if (mod != null)
                    {
                        level = mod.Level;
                    }
                }

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

            return(true);
        }
Exemple #2
0
        public override bool VerifyMove(Mobile from)
        {
            PlayerMobile pm    = from as PlayerMobile;
            AccessLevel  level = from.AccessLevel;

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

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

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

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

            return(true);
        }