internal void DamageBySpell(SpellDamageInfo damageInfo)
            {
                unit.Spells.CalculateSpellDamageTaken(ref damageInfo);

                EventHandler.ExecuteEvent(EventHandler.GlobalDispatcher, GameEvents.ServerDamageDone, damageInfo);

                unit.DealDamage(damageInfo.Target, (int)damageInfo.Damage, damageInfo.SpellDamageType);
            }
Пример #2
0
            internal void DamageBySpell(SpellDamageInfo damageInfo, Spell spell = null)
            {
                unit.Spells.CalculateSpellDamageTaken(ref damageInfo, spell);

                EventHandler.ExecuteEvent(EventHandler.GlobalDispatcher, GameEvents.ServerDamageDone, damageInfo);

                for (int i = unit.Auras.AuraApplications.Count - 1; i >= 0; i--)
                {
                    AuraApplication application = unit.Auras.AuraApplications[i];

                    for (int j = 0; j < application.Aura.AuraInfo.AuraScriptables.Count; j++)
                    {
                        AuraScriptable auraScriptable = application.Aura.AuraInfo.AuraScriptables[j];
                        if (auraScriptable is IAuraScriptSpellDamageHandler spellDamageHandler)
                        {
                            spellDamageHandler.OnSpellDamageDone(damageInfo);
                        }
                    }
                }

                unit.DealDamage(damageInfo.Target, (int)damageInfo.Damage, damageInfo.SpellDamageType);
            }