Esempio n. 1
0
        private static bool CheckHit(Mobile to, Mobile from)
        {
            if (!Core.TOL)
            {
                return(true);
            }

            double toChance   = Math.Min(45 + BaseArmor.GetRefinedDefenseChance(to), AosAttributes.GetValue(to, AosAttribute.DefendChance)) + 1;
            double fromChance = AosAttributes.GetValue(from, AosAttribute.AttackChance) + 1;

            double hitChance = toChance / (fromChance * 2);

            if (Utility.RandomDouble() < hitChance)
            {
                if (BaseWeapon.CheckParry(to))
                {
                    to.FixedEffect(0x37B9, 10, 16);
                    to.Animate(AnimationType.Parry, 0);
                    return(false);
                }

                return(true);
            }

            to.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, false, "*miss*");
            return(false);
        }
Esempio n. 2
0
        public static bool CheckSpellEvasion(Mobile defender)
        {
            if (IsEvading(defender) && VerifyCast(defender, false) && BaseWeapon.CheckParry(defender))                     // As per OSI, uses the exact same parry code
            {
                defender.Emote("*evades*");
                defender.FixedEffect(0x37B9, 10, 16);
                return(true);
            }

            return(false);
        }
Esempio n. 3
0
        public static bool CheckSpellEvasion(Mobile defender)
        {
            BaseWeapon weap = defender.FindItemOnLayer(Layer.OneHanded) as BaseWeapon;

            if (weap == null)
            {
                weap = defender.FindItemOnLayer(Layer.TwoHanded) as BaseWeapon;
            }

            if (Core.ML)
            {
                if (defender.Spell != null && defender.Spell.IsCasting)
                {
                    return(false);
                }

                if (weap != null)
                {
                    if (defender.Skills[weap.Skill].Base < 50)
                    {
                        return(false);
                    }
                }
                else if (!(defender.FindItemOnLayer(Layer.TwoHanded) is BaseShield))
                {
                    return(false);
                }
            }

            if (IsEvading(defender) && BaseWeapon.CheckParry(defender))
            {
                defender.Emote("*evades*"); // Yes.  Eew.  Blame OSI.
                defender.FixedEffect(0x37B9, 10, 16);

                if (Core.SA)
                {
                    defender.Animate(AnimationType.Block, 0);
                }

                return(true);
            }

            return(false);
        }
Esempio n. 4
0
        public static bool CheckSpellEvasion(Mobile defender)
        {
            BaseWeapon weap = defender.FindItemOnLayer(Layer.OneHanded) as BaseWeapon;

            if (weap == null)
            {
                weap = defender.FindItemOnLayer(Layer.TwoHanded) as BaseWeapon;
            }

            if (Core.ML && defender.Spell != null && defender.Spell.IsCasting)
            {
                return(false);
            }
            else if (IsEvading(defender) && BaseWeapon.CheckParry(defender) && (!Core.ML || defender.Skills[weap.Skill].Base > 50) && (weap != null || defender.FindItemOnLayer(Layer.TwoHanded) as BaseShield != null))
            {
                defender.Emote("*evades*");                   // Yes.  Eew.  Blame OSI.
                defender.FixedEffect(0x37B9, 10, 16);
                return(true);
            }

            return(false);
        }