示例#1
0
        public static double HitPointRegen(Mobile from)
        {
            double points = AosAttributes.GetValue(from, AosAttribute.RegenHits);

            if (from is BaseCreature)
            {
                points += ((BaseCreature)from).DefaultHitsRegen;
            }

            if (Core.ML && from is PlayerMobile && from.Race == Race.Human)     //Is this affected by the cap?
            {
                points += 2;
            }

            if (points < 0)
            {
                points = 0;
            }

            if (Core.ML && from is PlayerMobile)        //does racial bonus go before/after?
            {
                points = Math.Min(points, 18);
            }

            if (CheckTransform(from, typeof(HorrificBeastSpell)))
            {
                points += 20;
            }

            if (CheckAnimal(from, typeof(Dog)) || CheckAnimal(from, typeof(Cat)))
            {
                points += from.Skills[SkillName.Ninjitsu].Fixed / 30;
            }

            // Skill Masteries - goes after cap
            points += RampageSpell.GetBonus(from, RampageSpell.BonusType.HitPointRegen);
            points += CombatTrainingSpell.RegenBonus(from);
            points += BarrabHemolymphConcentrate.HPRegenBonus(from);

            if (Core.AOS)
            {
                foreach (RegenBonusHandler handler in HitsBonusHandlers)
                {
                    points += handler(from);
                }
            }

            return(points);
        }
        private static TimeSpan Mobile_HitsRegenRate(Mobile from)
        {
            int points = AosAttributes.GetValue(from, AosAttribute.RegenHits);

            if (from is BaseCreature && !((BaseCreature)from).IsAnimatedDead)
            {
                points += 4;
            }

            if ((from is BaseCreature && ((BaseCreature)from).IsParagon) || from is Leviathan)
            {
                points += 40;
            }

            if (Core.ML && from.Race == Race.Human)     //Is this affected by the cap?
            {
                points += 2;
            }

            if (points < 0)
            {
                points = 0;
            }

            if (Core.ML && from is PlayerMobile)        //does racial bonus go before/after?
            {
                points = Math.Min(points, 18);
            }

            if (CheckTransform(from, typeof(HorrificBeastSpell)))
            {
                points += 20;
            }

            if (from is BaseCreature && ((BaseCreature)from).HumilityBuff > 0)
            {
                switch (((BaseCreature)@from).HumilityBuff)
                {
                case 1:
                    points += 10;
                    break;

                case 2:
                    points += 20;
                    break;

                case 3:
                    points += 30;
                    break;
                }
            }

            if (CheckAnimal(from, typeof(Dog)) || CheckAnimal(from, typeof(Cat)))
            {
                points += from.Skills[SkillName.Ninjitsu].Fixed / 30;
            }

            // Skill Masteries
            points += RampageSpell.GetBonus(from, RampageSpell.BonusType.HitPointRegen);
            points += CombatTrainingSpell.RegenBonus(from);
            points += BarrabHemolymphConcentrate.HPRegenBonus(from);

            if (Core.AOS)
            {
                foreach (RegenBonusHandler handler in HitsBonusHandlers)
                {
                    points += handler(from);
                }
            }

            return(TimeSpan.FromSeconds(1.0 / (0.1 * (1 + points))));
        }