Esempio n. 1
0
        public static int GetHPBonus(Mobile m)
        {
            var spell = SkillMasterySpell.GetSpellForParty(m, typeof(InvigorateSpell));

            if (spell != null)
            {
                return(spell.StatBonus());
            }

            return(0);
        }
Esempio n. 2
0
        /// <summary>
        /// Called in Aos.cs, should include all damage types
        /// </summary>
        /// <param name="victim"></param>
        /// <param name="damager"></param>
        /// <param name="damage"></param>
        public static void OnDamage(Mobile victim, Mobile damager, DamageType type, ref int damage)
        {
            if (victim == null || damager == null)
            {
                return;
            }

            CheckTable(victim);

            foreach (SkillMasterySpell sp in EnumerateSpells(victim))
            {
                if (sp.DamageCanDisrupt && damage > sp.DamageThreshold)
                {
                    sp.Expire(true);
                }

                sp.OnDamaged(damager, victim, type, ref damage);
            }

            foreach (SkillMasterySpell sp in GetSpells(s => s.Target == victim))
            {
                sp.OnTargetDamaged(damager, victim, type, ref damage);
            }

            SkillMasteryMove move = SpecialMove.GetCurrentMove(victim) as SkillMasteryMove;

            if (move != null)
            {
                move.OnDamaged(damager, victim, type, ref damage);
            }

            PerseveranceSpell preserve = SkillMasterySpell.GetSpellForParty(victim, typeof(PerseveranceSpell)) as PerseveranceSpell;

            if (preserve != null)
            {
                preserve.AbsorbDamage(ref damage);
            }

            InspireSpell inspire = SkillMasterySpell.GetSpellForParty(damager, typeof(InspireSpell)) as InspireSpell;

            if (inspire != null)
            {
                inspire.DoDamage(ref damage);
            }

            CombatTrainingSpell.CheckDamage(damager, victim, type, ref damage);
        }
Esempio n. 3
0
        public static int GetAttributeBonus(Mobile m, SAAbsorptionAttribute attr)
        {
            int value = 0;

            switch (attr)
            {
            case SAAbsorptionAttribute.CastingFocus:
                SkillMasterySpell spell = SkillMasterySpell.GetSpellForParty(m, typeof(PerseveranceSpell));

                if (spell != null)
                {
                    value += spell.PropertyBonus2();
                }
                break;
            }

            return(value);
        }
Esempio n. 4
0
        public static int GetAttributeBonus(Mobile m, AosAttribute attr)
        {
            int value = 0;
            SkillMasterySpell spell = null;

            switch (attr)
            {
            case AosAttribute.AttackChance:
                spell = SkillMasterySpell.GetSpellForParty(m, typeof(InspireSpell));
                if (spell != null)
                {
                    value += spell.PropertyBonus();
                }

                spell = SkillMasterySpell.GetSpellForParty(m, typeof(TribulationSpell));
                if (spell != null)
                {
                    value += spell.PropertyBonus();
                }

                value += FocusedEyeSpell.HitChanceBonus(m);
                value += PlayingTheOddsSpell.HitChanceBonus(m);
                value += CalledShotSpell.GetHitChanceBonus(m);
                value += CombatTrainingSpell.GetHitChanceBonus(m);

                value += MasteryInfo.SavingThrowChance(m, attr);
                break;

            case AosAttribute.DefendChance:
                spell = SkillMasterySpell.GetSpellForParty(m, typeof(PerseveranceSpell));

                if (spell != null)
                {
                    value += spell.PropertyBonus();
                }

                if (Server.Spells.SkillMasteries.WhiteTigerFormSpell.IsActive(m))
                {
                    value += 20;
                }

                value += MasteryInfo.SavingThrowChance(m, attr);
                break;

            case AosAttribute.RegenHits:
                spell = SkillMasterySpell.GetSpellForParty(m, typeof(ResilienceSpell));

                if (spell != null)
                {
                    value += spell.PropertyBonus();
                }
                break;

            case AosAttribute.RegenStam:
                spell = SkillMasterySpell.GetSpellForParty(m, typeof(ResilienceSpell));

                if (spell != null)
                {
                    value += spell.PropertyBonus();
                }
                break;

            case AosAttribute.RegenMana:
                spell = SkillMasterySpell.GetSpellForParty(m, typeof(ResilienceSpell));

                if (spell != null)
                {
                    value += spell.PropertyBonus();
                }
                break;

            case AosAttribute.WeaponDamage:
                spell = SkillMasterySpell.GetSpellForParty(m, typeof(InspireSpell));

                if (spell != null)
                {
                    value += spell.DamageBonus();
                }

                value += MasteryInfo.SavingThrowChance(m, attr);
                break;

            case AosAttribute.SpellDamage:
                spell = SkillMasterySpell.GetSpellForParty(m, typeof(InspireSpell));

                if (spell != null)
                {
                    value += spell.PropertyBonus();
                }
                break;

            case AosAttribute.WeaponSpeed:
                value += RampageSpell.GetBonus(m, RampageSpell.BonusType.SwingSpeed);
                value += PlayingTheOddsSpell.SwingSpeedBonus(m);
                value -= StaggerSpell.GetStagger(m);
                break;

            case AosAttribute.BonusStr:
                value += MasteryInfo.SavingThrowChance(m, attr);
                break;
            }

            return(value);
        }