Ejemplo n.º 1
0
        private static TimeSpan Mobile_HitsRegenRate(Mobile from)
        {
            int points = from.GetMagicalAttribute(AosAttribute.RegenHits);

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

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

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

            if (from.Player && from.Race == Race.Human)
            {
                points += 2;
            }

            if (SurgeShield.IsUnderSurgeEffect(from, SurgeEffect.HitPoint))
            {
                points += 10;
            }

            Utility.FixMin(ref points, 0);

            // Publish 42: Added caps to stat regen rates: HP Regeneration: 18
            if (from.Player)
            {
                Utility.FixMax(ref points, 18);
            }

            if (CheckBump(from))
            {
                points += 40;
            }

            return(TimeSpan.FromSeconds(1.0 / (0.1 * (1 + points))));
        }
Ejemplo n.º 2
0
        private static TimeSpan Mobile_StamRegenRate(Mobile from)
        {
            if (from.Skills == null)
            {
                return(Mobile.DefaultStamRate);
            }

            CheckBonusSkill(from, from.Stam, from.StamMax, SkillName.Focus);

            int points = from.GetMagicalAttribute(AosAttribute.RegenStam) + (int)(from.Skills[SkillName.Focus].Value * 0.1);

            if (CheckTransform(from, typeof(VampiricEmbraceSpell)))
            {
                points += 15;
            }

            if (CheckAnimal(from, typeof(Kirin)))
            {
                points += 20;
            }

            if (CheckBump(from))
            {
                points += 40;
            }

            if (SurgeShield.IsUnderSurgeEffect(from, SurgeEffect.Stamina))
            {
                points += 10;
            }

            Utility.FixMin(ref points, -1);

            // Publish 42: Added caps to stat regen rates: Stamina Regeneration: 24
            if (from.Player)
            {
                Utility.FixMax(ref points, 24);
            }

            return(TimeSpan.FromSeconds(1.0 / (0.1 * (2 + points))));
        }
Ejemplo n.º 3
0
        private static TimeSpan Mobile_ManaRegenRate(Mobile from)
        {
            if (from.Skills == null)
            {
                return(Mobile.DefaultManaRate);
            }

            if (!from.Meditating)
            {
                CheckBonusSkill(from, from.Mana, from.ManaMax, SkillName.Meditation);
            }

            double basePoints = 2.0;

            double meditation = from.Skills[SkillName.Meditation].Value;
            double focus      = from.Skills[SkillName.Focus].Value;

            double meditationBonus = 0.0;

            if (AllowMeditation(from))
            {
                meditationBonus = (from.Int + (3 * meditation)) / 40.0;

                if (meditation >= 100.0)
                {
                    meditationBonus *= 1.1;
                }

                if (from.Meditating)
                {
                    meditationBonus *= 2.0;
                }

                CheckBonusSkill(from, from.Mana, from.ManaMax, SkillName.Focus);
            }

            double focusBonus = (int)(focus * 0.05);

            double baseItemBonus = (meditation / 2.0 + focus / 4.0) / 90.0;

            baseItemBonus = (baseItemBonus * 0.65) + 2.35;

            double intensityBonus = from.GetMagicalAttribute(AosAttribute.RegenMana);

            // ********** Special Bonuses **********
            if (CheckTransform(from, typeof(VampiricEmbraceSpell)))
            {
                intensityBonus += 3;
            }
            else if (CheckTransform(from, typeof(LichFormSpell)))
            {
                intensityBonus += 13;
            }
            // *************************************

            // Gargoyle Racial Ability: Mystic Insight
            if (from.Player && from.Race == Race.Gargoyle)
            {
                intensityBonus += 2;
            }
            // *************************************

            if (intensityBonus > 30)
            {
                intensityBonus = 30;
            }

            intensityBonus = Math.Sqrt(intensityBonus);

            double itemBonus = (baseItemBonus * intensityBonus) - (baseItemBonus - 1);

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

            double totalPoints = basePoints + meditationBonus + focusBonus + itemBonus;

            if (CheckBump(from))
            {
                totalPoints += 40;
            }

            if (SurgeShield.IsUnderSurgeEffect(from, SurgeEffect.Mana))
            {
                totalPoints += 10;
            }

            if (totalPoints < 1)
            {
                totalPoints = 1;
            }

            return(TimeSpan.FromSeconds(1.0 / (0.1 * ((int)totalPoints))));
        }