HasTimer() public static method

public static HasTimer ( Mobile m ) : bool
m Mobile
return bool
Exemplo n.º 1
0
        // Reveal uses magery and detect hidden vs. hide and stealth
        private static bool CheckDifficulty(Mobile from, Mobile m)
        {
            // Reveal always reveals vs. invisibility spell
            if (!Core.AOS || InvisibilitySpell.HasTimer(m))
            {
                return(true);
            }

            int magery       = from.Skills[SkillName.Magery].Fixed;
            int detectHidden = from.Skills[SkillName.DetectHidden].Fixed;

            int hiding  = m.Skills[SkillName.Hiding].Fixed;
            int stealth = m.Skills[SkillName.Stealth].Fixed;
            int divisor = hiding /*+ stealth*/;

            int chance;

            if (divisor > 0)
            {
                chance = 50 * (magery + detectHidden) / divisor;
            }
            else
            {
                chance = 100;
            }

            return(chance > Utility.Random(100));
        }
Exemplo n.º 2
0
        // Reveal uses magery and detect hidden vs. hide and stealth
        private static bool CheckDifficulty(Mobile from, Mobile m)
        {
            // Reveal always reveals vs. invisibility spell
            if (!Core.AOS || InvisibilitySpell.HasTimer(m))
            {
                return(true);
            }

            var magery       = from.Skills.Magery.Fixed;
            var detectHidden = from.Skills.DetectHidden.Fixed;

            var hiding  = m.Skills.Hiding.Fixed;
            var stealth = m.Skills.Stealth.Fixed;
            var divisor = hiding + stealth;

            int chance;

            if (divisor > 0)
            {
                chance = 50 * (magery + detectHidden) / divisor;
            }
            else
            {
                chance = 100;
            }

            return(chance > Utility.Random(100));
        }