Ejemplo n.º 1
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 OnDamaged(Mobile victim, Mobile damager, ref int damage)
        {
            if (victim == null)
            {
                return;
            }

            CheckTable(victim);

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

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

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

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

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

            SkillMasterySpell spell = SkillMasterySpell.GetSpellForParty(victim, typeof(PerseveranceSpell));

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

            CombatTrainingSpell.CheckDamage(damager, victim, ref damage);
        }