diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index 04c747c8ba5..332f4fba74a 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -238,6 +238,10 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (38760,'spell_void_blast'), (33558,'spell_draw_shadows_trigger'), (34662,'spell_bear_command'), +(36815,'spell_shock_barrier'), +(39228,'spell_argussian_compass'), +(41341,'spell_balance_of_power'), +(41475,'spell_reflective_shield_malande'), (41624,'spell_enfeeble_removal'), (32264,'spell_shirrak_inhibit_magic'), (33332,'spell_suppression_blast'), @@ -1004,11 +1008,17 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (52285,'spell_will_of_the_necropolis'), (52286,'spell_will_of_the_necropolis'), (50452,'spell_bloodworm'), +(49145,'spell_spell_deflection'), +(49495,'spell_spell_deflection'), +(49497,'spell_spell_deflection'), (50453,'spell_health_leech_passive'), (55078,'spell_death_knight_disease'), (55095,'spell_death_knight_disease'), (65142,'spell_crypt_fever_serverside'), (51052,'spell_anti_magic_zone'), +(48707,'spell_anti_magic_shell_absorb_self'), +(50462,'spell_anti_magic_shell_zone'), +(50461,'spell_anti_zone_absorb'), (55090,'spell_scourge_strike'), (55265,'spell_scourge_strike'), (55270,'spell_scourge_strike'), @@ -1046,6 +1056,20 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES -- Priest INSERT INTO spell_scripts(Id, ScriptName) VALUES (10060,'spell_power_infusion'), +(17,'spell_power_word_shield_priest'), +(592,'spell_power_word_shield_priest'), +(600,'spell_power_word_shield_priest'), +(3747,'spell_power_word_shield_priest'), +(6065,'spell_power_word_shield_priest'), +(6066,'spell_power_word_shield_priest'), +(10898,'spell_power_word_shield_priest'), +(10899,'spell_power_word_shield_priest'), +(10900,'spell_power_word_shield_priest'), +(10901,'spell_power_word_shield_priest'), +(25217,'spell_power_word_shield_priest'), +(25218,'spell_power_word_shield_priest'), +(48065,'spell_power_word_shield_priest'), +(48066,'spell_power_word_shield_priest'), (27827,'spell_spirit_of_redemption_heal'), (33076,'spell_prayer_of_mending'), (33206,'spell_pain_suppression'), @@ -1074,6 +1098,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (48085,'spell_lightwell_renew'), (55673,'spell_glyph_of_lightwell'), (60123,'spell_lightwell_relay'), +(47788,'spell_guardian_spirit_priest'), (34861,'spell_circle_of_healing'), (34863,'spell_circle_of_healing'), (34864,'spell_circle_of_healing'), @@ -1286,6 +1311,20 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (12824,'spell_polymorph'), (12825,'spell_polymorph'), (12826,'spell_polymorph'), +(543,'spell_frost_warding'), +(8457,'spell_frost_warding'), +(8458,'spell_frost_warding'), +(10223,'spell_frost_warding'), +(10225,'spell_frost_warding'), +(27128,'spell_frost_warding'), +(43010,'spell_frost_warding'), +(6143,'spell_frost_warding'), +(8461,'spell_frost_warding'), +(8462,'spell_frost_warding'), +(10177,'spell_frost_warding'), +(28609,'spell_frost_warding'), +(32796,'spell_frost_warding'), +(43012,'spell_frost_warding'), (58838,'spell_inherit_masters_threat_list'), (59638,'spell_mirror_image_frostbolt'); @@ -1324,6 +1363,10 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (27002,'spell_shred_druid'), (48571,'spell_shred_druid'), (48572,'spell_shred_druid'), +(33851,'spell_primal_tenacity'), +(33852,'spell_primal_tenacity'), +(33957,'spell_primal_tenacity'), +(69366,'spell_moonkin_form_passive'), (40121,'spell_swift_flight_form_passive'); -- Rogue @@ -1339,6 +1382,9 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (2070,'spell_sap'), -- check ranks before changing (11297,'spell_sap'), (51724,'spell_sap'), +(31228,'spell_cheat_death_rogue'), +(31229,'spell_cheat_death_rogue'), +(31230,'spell_cheat_death_rogue'), (14082,'spell_dirty_deeds'), (14083,'spell_dirty_deeds'), (13983,'spell_setup_rogue'), @@ -1350,7 +1396,9 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (51686,'spell_prey_on_the_weak'), (51687,'spell_prey_on_the_weak'), (51688,'spell_prey_on_the_weak'), -(51689,'spell_prey_on_the_weak'); +(51689,'spell_prey_on_the_weak'), +(31130,'spell_nerves_of_steel'), +(31131,'spell_nerves_of_steel'); -- Shaman INSERT INTO spell_scripts(Id, ScriptName) VALUES @@ -1396,6 +1444,9 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (58590,'spell_stoneclaw_totem_absorb'), (58591,'spell_stoneclaw_totem_absorb'), (70811,'spell_item_shaman_t10_elemental_2p_bonus'), +(51474,'spell_astral_shift_shaman'), +(51478,'spell_astral_shift_shaman'), +(51479,'spell_astral_shift_shaman'), (2825,'spell_heroism_bloodlust'), (32182,'spell_heroism_bloodlust'); diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp index d4647606b6a..3e566087839 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp @@ -1652,7 +1652,7 @@ UnitAI* GetAI_npc_keeper_thorim(Creature* pCreature) struct HodirsProtectiveGaze : AuraScript { - void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& dropCharge) const override + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& dropCharge, DamageEffectType /*damageType*/) const override { currentAbsorb = 0; dropCharge = false; diff --git a/src/game/AI/ScriptDevAI/scripts/outland/black_temple/boss_teron_gorefiend.cpp b/src/game/AI/ScriptDevAI/scripts/outland/black_temple/boss_teron_gorefiend.cpp index 19f0101ee07..fbc7c3bf7aa 100644 --- a/src/game/AI/ScriptDevAI/scripts/outland/black_temple/boss_teron_gorefiend.cpp +++ b/src/game/AI/ScriptDevAI/scripts/outland/black_temple/boss_teron_gorefiend.cpp @@ -375,7 +375,7 @@ bool AreaTrigger_at_teron_gorefiend(Player* player, AreaTriggerEntry const* /*at struct ShadowOfDeath : public AuraScript { - void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& /*dropCharge*/) const override + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override { preventedDeath = true; currentAbsorb = 0; diff --git a/src/game/AI/ScriptDevAI/scripts/outland/black_temple/illidari_council.cpp b/src/game/AI/ScriptDevAI/scripts/outland/black_temple/illidari_council.cpp index d2bc30a2385..11f6c818d0c 100644 --- a/src/game/AI/ScriptDevAI/scripts/outland/black_temple/illidari_council.cpp +++ b/src/game/AI/ScriptDevAI/scripts/outland/black_temple/illidari_council.cpp @@ -714,6 +714,31 @@ struct VerasDeadlyPoisonTick : public AuraScript } }; +// 41341 - Balance of Power +struct BalanceOfPower : public AuraScript +{ + void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& dropCharge, DamageEffectType /*damageType*/) const override + { + // unused atm + remainingDamage += currentAbsorb; + currentAbsorb = 0; + dropCharge = false; + } +}; + +// 41475 - Reflective Shield +struct ReflectiveShieldMalande : public AuraScript +{ + void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override + { + if (remainingDamage < currentAbsorb) + reflectDamage = remainingDamage / 2; + else + reflectDamage = currentAbsorb / 2; + reflectedSpellId = 33619; + } +}; + void AddSC_boss_illidari_council() { Script* pNewScript = new Script; @@ -749,4 +774,6 @@ void AddSC_boss_illidari_council() RegisterSpellScript("spell_veras_vanish"); RegisterSpellScript("spell_veras_deadly_poison"); RegisterSpellScript("spell_veras_deadly_poison_tick"); + RegisterSpellScript("spell_balance_of_power"); + RegisterSpellScript("spell_reflective_shield_malande"); } diff --git a/src/game/AI/ScriptDevAI/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp b/src/game/AI/ScriptDevAI/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp index 7804cb30712..db93b8b1167 100644 --- a/src/game/AI/ScriptDevAI/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp +++ b/src/game/AI/ScriptDevAI/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp @@ -1928,6 +1928,19 @@ struct GravityLapseKnockup : public AuraScript } }; +// 36815 - Shock Barrier +struct ShockBarrier : public AuraScript +{ + void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override + { + reflectedSpellId = 36822; + if (remainingDamage < currentAbsorb) + reflectDamage = remainingDamage / 100; + else + reflectDamage = currentAbsorb / 100; + } +}; + void AddSC_boss_kaelthas() { Script* pNewScript = new Script; @@ -1966,4 +1979,5 @@ void AddSC_boss_kaelthas() RegisterSpellScript("spell_nether_vapor_summon_parent"); RegisterSpellScript("spell_remove_weapons"); RegisterSpellScript("spell_gravity_lapse_knockup"); + RegisterSpellScript("spell_shock_barrier"); } diff --git a/src/game/AI/ScriptDevAI/scripts/world/item_scripts.cpp b/src/game/AI/ScriptDevAI/scripts/world/item_scripts.cpp index 210c796949b..ee98d424655 100644 --- a/src/game/AI/ScriptDevAI/scripts/world/item_scripts.cpp +++ b/src/game/AI/ScriptDevAI/scripts/world/item_scripts.cpp @@ -352,6 +352,18 @@ struct OrbOfDeception : public AuraScript } }; +// 39228 - Argussian Compass +struct ArgussianCompass : public AuraScript +{ + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override + { + // Max absorb stored in 1 dummy effect + int32 max_absorb = aura->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_1); + if (max_absorb < currentAbsorb) + currentAbsorb = max_absorb; + } +}; + void AddSC_item_scripts() { Script* pNewScript = new Script; @@ -389,4 +401,5 @@ void AddSC_item_scripts() RegisterSpellScript("spell_reduced_proc_chance_past60"); RegisterSpellScript("spell_banish_exile"); RegisterSpellScript("spell_orb_of_deception"); + RegisterSpellScript("spell_argussian_compass"); } diff --git a/src/game/Entities/Unit.cpp b/src/game/Entities/Unit.cpp index 8d98b64910e..62c74ddb383 100644 --- a/src/game/Entities/Unit.cpp +++ b/src/game/Entities/Unit.cpp @@ -2502,14 +2502,14 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* caster, SpellSchoolMask schoolMa if (!IsAlive() || !damage) return; - int32 RemainingDamage = int32(damage); + int32 remainingDamage = int32(damage); // Magic damage, check for resists if (canResist && (schoolMask & SPELL_SCHOOL_MASK_MAGIC) && (!binary || damagetype == DOT)) { const float multiplier = Unit::RollMagicResistanceMultiplierOutcomeAgainst(caster, this, schoolMask, damagetype, binary); *resist = int32(int64(damage) * multiplier); - RemainingDamage -= *resist; + remainingDamage -= *resist; } else *resist = 0; @@ -2523,44 +2523,6 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* caster, SpellSchoolMask schoolMa // Death Prevention Aura Aura* preventDeathAura = nullptr; - // full absorb cases (by chance) - AuraList const& vAbsorb = GetAurasByType(SPELL_AURA_SCHOOL_ABSORB); - for (AuraList::const_iterator i = vAbsorb.begin(); i != vAbsorb.end() && RemainingDamage > 0; ++i) - { - // only work with proper school mask damage - Modifier* i_mod = (*i)->GetModifier(); - if (!(i_mod->m_miscvalue & schoolMask)) - continue; - - SpellEntry const* i_spellProto = (*i)->GetSpellProto(); - // Fire Ward or Frost Ward - if (i_spellProto->SpellFamilyName == SPELLFAMILY_MAGE && i_spellProto->SpellFamilyFlags & uint64(0x0000000000000108)) - { - int chance = 0; - Unit::AuraList const& auras = GetAurasByType(SPELL_AURA_ADD_PCT_MODIFIER); - for (auto aura : auras) - { - SpellEntry const* itr_spellProto = aura->GetSpellProto(); - // Frost Warding (chance full absorb) - if (itr_spellProto->SpellFamilyName == SPELLFAMILY_MAGE && itr_spellProto->SpellIconID == 501) - { - // chance stored in next dummy effect - chance = itr_spellProto->CalculateSimpleValue(EFFECT_INDEX_1); - break; - } - } - if (roll_chance_i(chance)) - { - int32 amount = RemainingDamage; - RemainingDamage = 0; - - // Frost Warding (mana regen) - CastCustomSpell(this, 57776, &amount, nullptr, nullptr, TRIGGERED_OLD_TRIGGERED, nullptr, *i); - break; - } - } - } - // Need remove expired auras after bool existExpired = false; @@ -2569,7 +2531,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* caster, SpellSchoolMask schoolMa // absorb without mana cost AuraList const& vSchoolAbsorb = GetAurasByType(SPELL_AURA_SCHOOL_ABSORB); - for (AuraList::const_iterator i = vSchoolAbsorb.begin(); i != vSchoolAbsorb.end() && RemainingDamage > 0; ++i) + for (AuraList::const_iterator i = vSchoolAbsorb.begin(); i != vSchoolAbsorb.end() && remainingDamage > 0; ++i) { Modifier* mod = (*i)->GetModifier(); if (!(mod->m_miscvalue & schoolMask)) @@ -2578,7 +2540,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* caster, SpellSchoolMask schoolMa SpellEntry const* spellProto = (*i)->GetSpellProto(); // Max Amount can be absorbed by this aura - int32 currentAbsorb = mod->m_amount; + int32 currentAbsorb = mod->m_amount; // Found empty aura (impossible but..) if (currentAbsorb <= 0) @@ -2587,232 +2549,18 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* caster, SpellSchoolMask schoolMa continue; } - // Handle custom absorb auras - // TODO: try find better way - - switch (spellProto->SpellFamilyName) - { - case SPELLFAMILY_GENERIC: - { - switch (spellProto->Id) - { - case 31130: // Nerves of Steel - case 31131: - { - // while affected by Stun and Fear - if (unitflag & (UNIT_FLAG_STUNNED | UNIT_FLAG_FLEEING)) - RemainingDamage -= RemainingDamage * currentAbsorb / 100; - continue; - } - case 36815: // Shock Barrier - Kael'Thas - { - reflectSpell = 36822; - if (RemainingDamage < currentAbsorb) - reflectDamage = RemainingDamage / 100; - else - reflectDamage = currentAbsorb / 100; - break; - } - case 39228: // Argussian Compass - case 60218: // Essence of Gossamer - { - // Max absorb stored in 1 dummy effect - int32 max_absorb = spellProto->CalculateSimpleValue(EFFECT_INDEX_1); - if (max_absorb < currentAbsorb) - currentAbsorb = max_absorb; - break; - } - case 41341: // Balance of Power - { - continue; // unused atm - } - case 41475: // Reflective Shield (Lady Malande boss) - { - if (RemainingDamage < currentAbsorb) - reflectDamage = RemainingDamage / 2; - else - reflectDamage = currentAbsorb / 2; - reflectSpell = 33619; - reflectTriggeredBy = *i; - break; - } - case 49145: // Spell Deflection - case 49495: - case 49497: - { - // You have a chance equal to your Parry chance - if (damagetype == SPELL_DIRECT_DAMAGE && roll_chance_f(GetParryChance())) - RemainingDamage -= RemainingDamage * currentAbsorb / 100; - continue; - } - case 51474: // Astral Shift - case 51478: - case 51479: - { - // reduces all damage taken while stun, fear or silence - if (unitflag & (UNIT_FLAG_STUNNED | UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED)) - RemainingDamage -= RemainingDamage * currentAbsorb / 100; - continue; - } - default: - break; - } - break; - } - case SPELLFAMILY_DRUID: - { - // Primal Tenacity - if (spellProto->SpellIconID == 2253) - { - // reduces all damage taken while Stunned and in Cat Form - if (GetShapeshiftForm() == FORM_CAT && (unitflag & UNIT_FLAG_STUNNED)) - RemainingDamage -= RemainingDamage * currentAbsorb / 100; - continue; - } - // Moonkin Form passive - if (spellProto->Id == 69366) - { - // reduces all damage taken while Stunned - if (unitflag & UNIT_FLAG_STUNNED) - RemainingDamage -= RemainingDamage * currentAbsorb / 100; - continue; - } - break; - } - case SPELLFAMILY_ROGUE: - { - switch (spellProto->Id) - { - case 31228: // Cheat Death - case 31229: - case 31230: - { - if (!preventDeathAura && - GetTypeId() == TYPEID_PLAYER && // Only players - IsSpellReady(31231) && - // Only if no cooldown - roll_chance_i((*i)->GetModifier()->m_amount)) - // Only if roll - { - preventDeathAura = (*i); - } - // always skip this spell in charge dropping, absorb amount calculation since it has chance as m_amount and doesn't need to absorb any damage - continue; - } - } - break; - } - case SPELLFAMILY_PRIEST: - { - // Guardian Spirit - if (spellProto->SpellIconID == 2873) - { - preventDeathAura = (*i); - continue; - } - // Reflective Shield - if (spellProto->IsFitToFamilyMask(uint64(0x0000000000000001)) && canReflect && caster) - { - if (caster == this) - break; - Unit* caster = (*i)->GetCaster(); - if (!caster) - break; - AuraList const& vOverRideCS = caster->GetAurasByType(SPELL_AURA_DUMMY); - for (auto k : vOverRideCS) - { - switch (k->GetModifier()->m_miscvalue) - { - case 5065: // Rank 1 - case 5064: // Rank 2 - { - if (RemainingDamage >= currentAbsorb) - reflectDamage = k->GetModifier()->m_amount * currentAbsorb / 100; - else - reflectDamage = k->GetModifier()->m_amount * RemainingDamage / 100; - reflectSpell = 33619; - reflectTriggeredBy = *i; - } break; - default: break; - } - } - break; - } - break; - } - case SPELLFAMILY_SHAMAN: - { - // Astral Shift - if (spellProto->SpellIconID == 3066) - { - // reduces all damage taken while stun, fear or silence - if (unitflag & (UNIT_FLAG_STUNNED | UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED)) - RemainingDamage -= RemainingDamage * currentAbsorb / 100; - continue; - } - break; - } - case SPELLFAMILY_DEATHKNIGHT: - { - // Shadow of Death - if (spellProto->SpellIconID == 1958) - { - // TODO: absorb only while transform - continue; - } - // Anti-Magic Shell (on self) - if (spellProto->Id == 48707) - { - // damage absorbed by Anti-Magic Shell energizes the DK with additional runic power. - // This, if I'm not mistaken, shows that we get back ~2% of the absorbed damage as runic power. - int32 absorbed = RemainingDamage * currentAbsorb / 100; - int32 regen = absorbed * 2 / 10; - CastCustomSpell(this, 49088, ®en, nullptr, nullptr, TRIGGERED_OLD_TRIGGERED, nullptr, *i); - RemainingDamage -= absorbed; - continue; - } - // Anti-Magic Shell (on single party/raid member) - if (spellProto->Id == 50462) - { - RemainingDamage -= RemainingDamage * currentAbsorb / 100; - continue; - } - // Anti-Magic Zone - if (spellProto->Id == 50461) - { - Unit* auraCaster = (*i)->GetCaster(); - if (!caster) - continue; - int32 absorbed = RemainingDamage * currentAbsorb / 100; - int32 canabsorb = caster->GetHealth(); - if (canabsorb < absorbed) - absorbed = canabsorb; - - RemainingDamage -= absorbed; - - uint32 ab_damage = absorbed; - Unit::DealDamageMods(caster, auraCaster, ab_damage, nullptr, damagetype); - Unit::DealDamage(caster, auraCaster, ab_damage, nullptr, damagetype, schoolMask, nullptr, false); - continue; - } - break; - } - default: - break; - } - // currentAbsorb - damage can be absorbed by shield // If need absorb less damage - if (RemainingDamage < currentAbsorb) - currentAbsorb = RemainingDamage; + if (remainingDamage < currentAbsorb) + currentAbsorb = remainingDamage; - bool preventedDeath = false; + bool preventedDeath = preventDeathAura != nullptr; bool dropCharge = true; - (*i)->OnAbsorb(currentAbsorb, RemainingDamage, reflectSpell, reflectDamage, preventedDeath, dropCharge); + (*i)->OnAbsorb(currentAbsorb, remainingDamage, reflectSpell, reflectDamage, preventedDeath, dropCharge, damagetype); if (preventedDeath) preventDeathAura = (*i); - RemainingDamage -= currentAbsorb; + remainingDamage -= currentAbsorb; // Fire Ward or Frost Ward or Ice Barrier (or Mana Shield) // for Incanter's Absorption converting to spell power @@ -2855,7 +2603,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* caster, SpellSchoolMask schoolMa // absorb by mana cost AuraList const& vManaShield = GetAurasByType(SPELL_AURA_MANA_SHIELD); - for (AuraList::const_iterator i = vManaShield.begin(), next; i != vManaShield.end() && RemainingDamage > 0; i = next) + for (AuraList::const_iterator i = vManaShield.begin(), next; i != vManaShield.end() && remainingDamage > 0; i = next) { next = i; ++next; @@ -2864,10 +2612,10 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* caster, SpellSchoolMask schoolMa continue; int32 currentAbsorb; - if (RemainingDamage >= (*i)->GetModifier()->m_amount) + if (remainingDamage >= (*i)->GetModifier()->m_amount) currentAbsorb = (*i)->GetModifier()->m_amount; else - currentAbsorb = RemainingDamage; + currentAbsorb = remainingDamage; if (float manaMultiplier = (*i)->GetSpellProto()->EffectMultipleValue[(*i)->GetEffIndex()]) { @@ -2896,7 +2644,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* caster, SpellSchoolMask schoolMa next = vManaShield.begin(); } - RemainingDamage -= currentAbsorb; + remainingDamage -= currentAbsorb; } // effects dependent from full absorb amount @@ -2929,7 +2677,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* caster, SpellSchoolMask schoolMa if (caster && caster != this) { AuraList const& vSplitDamageFlat = GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_FLAT); - for (AuraList::const_iterator i = vSplitDamageFlat.begin(), next; i != vSplitDamageFlat.end() && RemainingDamage >= 0; i = next) + for (AuraList::const_iterator i = vSplitDamageFlat.begin(), next; i != vSplitDamageFlat.end() && remainingDamage >= 0; i = next) { next = i; ++next; @@ -2943,12 +2691,12 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* caster, SpellSchoolMask schoolMa continue; int32 currentAbsorb; - if (RemainingDamage >= (*i)->GetModifier()->m_amount) + if (remainingDamage >= (*i)->GetModifier()->m_amount) currentAbsorb = (*i)->GetModifier()->m_amount; else - currentAbsorb = RemainingDamage; + currentAbsorb = remainingDamage; - RemainingDamage -= currentAbsorb; + remainingDamage -= currentAbsorb; if (caster->IsImmuneToDamage(schoolMask)) { @@ -2967,7 +2715,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* caster, SpellSchoolMask schoolMa } AuraList const& vSplitDamagePct = GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_PCT); - for (AuraList::const_iterator i = vSplitDamagePct.begin(), next; i != vSplitDamagePct.end() && RemainingDamage >= 0; i = next) + for (AuraList::const_iterator i = vSplitDamagePct.begin(), next; i != vSplitDamagePct.end() && remainingDamage >= 0; i = next) { next = i; ++next; @@ -2980,9 +2728,9 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* caster, SpellSchoolMask schoolMa if (!caster || caster == this || !caster->IsInWorld() || !caster->IsAlive()) continue; - uint32 splitted = uint32(RemainingDamage * (*i)->GetModifier()->m_amount / 100.0f); + uint32 splitted = uint32(remainingDamage * (*i)->GetModifier()->m_amount / 100.0f); - RemainingDamage -= int32(splitted); + remainingDamage -= int32(splitted); if (caster->IsImmuneToDamage(schoolMask)) { @@ -3001,48 +2749,10 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* caster, SpellSchoolMask schoolMa } // Apply death prevention spells effects - if (preventDeathAura && RemainingDamage >= (int32)GetHealth()) - { - SpellEntry const* spellInfo = preventDeathAura->GetSpellProto(); - switch (spellInfo->SpellFamilyName) - { - case SPELLFAMILY_ROGUE: - { - switch (spellInfo->Id) - { - case 31228: // Cheat Death - case 31229: - case 31230: - { - SpellEntry const* cheatDeath = sSpellTemplate.LookupEntry(31231); - CastSpell(this, cheatDeath, TRIGGERED_OLD_TRIGGERED); - AddCooldown(*cheatDeath, nullptr, false, 60 * IN_MILLISECONDS); // TODO this may be removed by fixing cooldown value in spell template - // with health > 10% lost health until health==10%, in other case no losses - uint32 health10 = GetMaxHealth() / 10; - RemainingDamage = GetHealth() > health10 ? GetHealth() - health10 : 0; - break; - } - default: break; - } - } - // Guardian Spirit - case SPELLFAMILY_PRIEST: - { - // Guardian Spirit - if (preventDeathAura->GetSpellProto()->SpellIconID == 2873) - { - int32 healAmount = GetMaxHealth() * preventDeathAura->GetModifier()->m_amount / 100; - CastCustomSpell(this, 48153, &healAmount, nullptr, nullptr, TRIGGERED_OLD_TRIGGERED); - RemoveAurasDueToSpell(preventDeathAura->GetSpellProto()->Id); - RemainingDamage = 0; - } - break; - } - } - preventDeathAura->OnAuraDeathPrevention(RemainingDamage); - } + if (preventDeathAura && remainingDamage >= (int32)GetHealth()) + preventDeathAura->OnAuraDeathPrevention(remainingDamage); - *absorb = damage - RemainingDamage - *resist; + *absorb = damage - remainingDamage - *resist; } void Unit::CalculateAbsorbResistBlock(Unit* caster, SpellNonMeleeDamage* spellDamageInfo, SpellEntry const* spellInfo, WeaponAttackType attType) diff --git a/src/game/Spells/Scripts/Scripting/ClassScripts/DeathKnight.cpp b/src/game/Spells/Scripts/Scripting/ClassScripts/DeathKnight.cpp index b802c409c45..850aa163fb5 100644 --- a/src/game/Spells/Scripts/Scripting/ClassScripts/DeathKnight.cpp +++ b/src/game/Spells/Scripts/Scripting/ClassScripts/DeathKnight.cpp @@ -376,7 +376,7 @@ struct SuddenDoom : public AuraScript struct WillOfTheNecropolis : public AuraScript { - void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/) const override + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override { currentAbsorb = 0; if (aura->GetTarget()->GetHealth() - remainingDamage < aura->GetTarget()->GetMaxHealth() * 35 / 100) @@ -384,6 +384,59 @@ struct WillOfTheNecropolis : public AuraScript } }; +// 49145 - Spell Deflection +struct SpellDeflection : public AuraScript +{ + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType damageType) const override + { + // You have a chance equal to your Parry chance + if (damageType == SPELL_DIRECT_DAMAGE && roll_chance_f(aura->GetTarget()->GetParryChance())) + remainingDamage -= remainingDamage * currentAbsorb / 100; + } +}; + +// 48707 Anti-Magic Shell +struct AntiMagicShellAbsorbSelf : public AuraScript +{ + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override + { + // damage absorbed by Anti-Magic Shell energizes the DK with additional runic power. + // This, if I'm not mistaken, shows that we get back ~2% of the absorbed damage as runic power. + int32 absorbed = remainingDamage * currentAbsorb / 100; + int32 regen = absorbed * 2 / 10; + aura->GetTarget()->CastCustomSpell(nullptr, 49088, ®en, nullptr, nullptr, TRIGGERED_OLD_TRIGGERED, nullptr, aura); + remainingDamage -= absorbed; + } +}; + +// 50462 - Anti-Magic Zone +struct AntiMagicShellZone : public AuraScript +{ + void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override + { + remainingDamage -= remainingDamage * currentAbsorb / 100; + } +}; + +// 50461 - Anti-Magic Zone +struct AntiMagicZoneAbsorb : public AuraScript +{ + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType damageType) const override + { + Unit* auraCaster = aura->GetCaster(); + int32 absorbed = remainingDamage * currentAbsorb / 100; + int32 canabsorb = auraCaster->GetHealth(); + if (canabsorb < absorbed) + absorbed = canabsorb; + + remainingDamage -= absorbed; + + uint32 ab_damage = absorbed; + Unit::DealDamageMods(auraCaster, auraCaster, ab_damage, nullptr, damageType); + Unit::DealDamage(auraCaster, auraCaster, ab_damage, nullptr, damageType, SPELL_SCHOOL_MASK_SHADOW, nullptr, false); + } +}; + enum DancingRuneWeaponData { SPELL_COPY_WEAPON = 63416, @@ -574,6 +627,10 @@ void LoadDeathKnightScripts() RegisterSpellScript("spell_fake_aggro_radius_8yd"); RegisterSpellScript("spell_aggro_radius_8yd"); RegisterSpellScript("spell_summon_gargoyle"); + RegisterSpellScript("spell_spell_deflection"); + RegisterSpellScript("spell_anti_magic_shell_absorb_self"); + RegisterSpellScript("spell_anti_magic_shell_zone"); + RegisterSpellScript("spell_anti_zone_absorb"); Script* pNewScript = new Script; pNewScript->Name = "npc_gargoyle_dk"; diff --git a/src/game/Spells/Scripts/Scripting/ClassScripts/Druid.cpp b/src/game/Spells/Scripts/Scripting/ClassScripts/Druid.cpp index 9e60b4c8078..5b449420e55 100644 --- a/src/game/Spells/Scripts/Scripting/ClassScripts/Druid.cpp +++ b/src/game/Spells/Scripts/Scripting/ClassScripts/Druid.cpp @@ -171,6 +171,28 @@ struct SwiftFlightFormPassive : public AuraScript } }; +// 33851 - Primal Tenacity +struct PrimalTenacity : public AuraScript +{ + void OnAbsorb(Aura * aura, int32 & currentAbsorb, int32 & remainingDamage, uint32 & reflectedSpellId, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override + { + // while affected by Stun and Fear + if (aura->GetTarget()->GetShapeshiftForm() == FORM_CAT && aura->GetTarget()->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) + remainingDamage -= remainingDamage * currentAbsorb / 100; + } +}; + +// 69366 - Moonkin Form (Passive) +struct MoonkinFormPassive : public AuraScript +{ + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override + { + // while affected by Stun and Fear + if (aura->GetTarget()->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) + remainingDamage -= remainingDamage * currentAbsorb / 100; + } +}; + void LoadDruidScripts() { RegisterSpellScript("spell_regrowth"); @@ -181,4 +203,6 @@ void LoadDruidScripts() RegisterSpellScript("spell_brambles"); RegisterSpellScript("spell_shred_druid"); RegisterSpellScript("spell_swift_flight_form_passive"); + RegisterSpellScript("spell_primal_tenacity"); + RegisterSpellScript("spell_moonkin_form_passive"); } \ No newline at end of file diff --git a/src/game/Spells/Scripts/Scripting/ClassScripts/Mage.cpp b/src/game/Spells/Scripts/Scripting/ClassScripts/Mage.cpp index f9416b56e04..fe4feb5bdc6 100644 --- a/src/game/Spells/Scripts/Scripting/ClassScripts/Mage.cpp +++ b/src/game/Spells/Scripts/Scripting/ClassScripts/Mage.cpp @@ -146,6 +146,28 @@ struct Polymorph : public AuraScript } }; +// 6143 - Frost Ward, 543 - Fire Ward +struct FrostWarding : public AuraScript +{ + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override + { + int chance = 0; + if (Aura* frostWarding = aura->GetTarget()->GetAura(11189, EFFECT_INDEX_0)) + chance = frostWarding->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_1); + if (Aura* frostWarding = aura->GetTarget()->GetAura(28332, EFFECT_INDEX_0)) + chance = frostWarding->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_1); + if (roll_chance_i(chance)) + { + int32 amount = remainingDamage; + remainingDamage = 0; + currentAbsorb = 0; + + // Frost Warding (mana regen) + aura->GetTarget()->CastCustomSpell(nullptr, 57776, &amount, nullptr, nullptr, TRIGGERED_OLD_TRIGGERED, nullptr, aura); + } + } +}; + void LoadMageScripts() { RegisterSpellScript("spell_arcane_concentration"); @@ -156,4 +178,5 @@ void LoadMageScripts() RegisterSpellScript("spell_fingers_of_frost_dummy"); RegisterSpellScript("spell_deep_freeze_immunity_state"); RegisterSpellScript("spell_polymorph"); + RegisterSpellScript("spell_frost_warding"); } \ No newline at end of file diff --git a/src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp b/src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp index 8d9ffa75abf..8b23fc65dd4 100644 --- a/src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp +++ b/src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp @@ -241,7 +241,7 @@ struct JudgementsOfTheWiseEnergize : public SpellScript struct ArdentDefender : public AuraScript { - void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& /*dropCharge*/) const override + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override { currentAbsorb = 0; Player* player = dynamic_cast(aura->GetCaster()); diff --git a/src/game/Spells/Scripts/Scripting/ClassScripts/Priest.cpp b/src/game/Spells/Scripts/Scripting/ClassScripts/Priest.cpp index d5da733d3df..03fbcda02c5 100644 --- a/src/game/Spells/Scripts/Scripting/ClassScripts/Priest.cpp +++ b/src/game/Spells/Scripts/Scripting/ClassScripts/Priest.cpp @@ -113,6 +113,32 @@ struct PainSuppression : public AuraScript } }; +// 17 - Power Word: Shield +struct PowerWordShieldPriest : public AuraScript +{ + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override + { + Unit* caster = aura->GetTarget(); + Unit::AuraList const& vOverRideCS = caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); + for (auto k : vOverRideCS) // 33201 - Reflective Shield + { + switch (k->GetModifier()->m_miscvalue) + { + case 5065: // Rank 1 + case 5064: // Rank 2 + { + if (remainingDamage >= currentAbsorb) + reflectDamage = k->GetModifier()->m_amount * currentAbsorb / 100; + else + reflectDamage = k->GetModifier()->m_amount * remainingDamage / 100; + reflectedSpellId = 33619; + } break; + default: break; + } + } + } +}; + struct DivineHymn : public SpellScript { void OnInit(Spell* spell) const override @@ -312,6 +338,23 @@ struct ShadowAffinityDots : public AuraScript } }; +// 47788 - Guardian Spirit +struct GuardianSpiritPriest : public AuraScript +{ + void OnAbsorb(Aura* aura, int32& /*currentAbsorb*/, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override + { + preventedDeath = true; + } + + void OnAuraDeathPrevention(Aura* aura, int32& remainingDamage) const override + { + int32 healAmount = aura->GetTarget()->GetMaxHealth() * aura->GetModifier()->m_amount / 100; + aura->GetTarget()->CastCustomSpell(nullptr, 48153, &healAmount, nullptr, nullptr, TRIGGERED_OLD_TRIGGERED); + aura->GetTarget()->RemoveAurasDueToSpell(aura->GetSpellProto()->Id); + remainingDamage = 0; + } +}; + void LoadPriestScripts() { RegisterSpellScript("spell_power_infusion"); @@ -320,6 +363,7 @@ void LoadPriestScripts() RegisterSpellScript("spell_prayer_of_mending"); RegisterSpellScript("spell_pain_suppression"); RegisterSpellScript("spell_shadowfiend"); + RegisterSpellScript("spell_power_word_shield_priest"); RegisterSpellScript("spell_divine_hymn"); RegisterSpellScript("spell_hymn_of_hope"); RegisterSpellScript("spell_circle_of_healing"); @@ -329,4 +373,5 @@ void LoadPriestScripts() RegisterSpellScript("spell_glyph_of_lightwell"); RegisterSpellScript("spell_glyph_of_shadow_word_death"); RegisterSpellScript("spell_shadow_affinity_dots"); + RegisterSpellScript("spell_guardian_spirit_priest"); } diff --git a/src/game/Spells/Scripts/Scripting/ClassScripts/Rogue.cpp b/src/game/Spells/Scripts/Scripting/ClassScripts/Rogue.cpp index 4ffdc0854c9..8a619eb93b0 100644 --- a/src/game/Spells/Scripts/Scripting/ClassScripts/Rogue.cpp +++ b/src/game/Spells/Scripts/Scripting/ClassScripts/Rogue.cpp @@ -145,6 +145,34 @@ struct DirtyDeeds : public AuraScript } }; +// 31228 - Cheat Death +struct CheatDeathRogue : public AuraScript +{ + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& dropCharge, DamageEffectType /*damageType*/) const override + { + if (!preventedDeath && aura->GetTarget()->IsPlayer() && + aura->GetTarget()->IsSpellReady(31231) && + // Only if no cooldown + roll_chance_i(aura->GetModifier()->m_amount)) + // Only if roll + { + preventedDeath = true; + } + // always skip this spell in charge dropping, absorb amount calculation since it has chance as m_amount and doesn't need to absorb any damage + dropCharge = false; + } + + void OnAuraDeathPrevention(Aura* aura, int32& remainingDamage) const override + { + SpellEntry const* cheatDeath = sSpellTemplate.LookupEntry(31231); + aura->GetTarget()->CastSpell(nullptr, cheatDeath, TRIGGERED_OLD_TRIGGERED); + aura->GetHolder()->SetProcCooldown(std::chrono::seconds(60), aura->GetTarget()->GetMap()->GetCurrentClockTime()); + // with health > 10% lost health until health==10%, in other case no losses + uint32 health10 = aura->GetTarget()->GetMaxHealth() / 10; + remainingDamage = aura->GetTarget()->GetHealth() > health10 ? aura->GetTarget()->GetHealth() - health10 : 0; + } +}; + struct KillingSpreeStorage : public ScriptStorage { GuidSet targets; @@ -223,6 +251,17 @@ struct PreyOnTheWeak : public AuraScript } }; +// 31130 - Nerves Of Steel +struct NervesOfSteel : public AuraScript +{ + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override + { + // while affected by Stun and Fear + if (aura->GetTarget()->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_FLEEING)) + remainingDamage -= remainingDamage * currentAbsorb / 100; + } +}; + void LoadRogueScripts() { RegisterSpellScript("spell_preparation"); @@ -231,6 +270,8 @@ void LoadRogueScripts() RegisterSpellScript("spell_sap"); RegisterSpellScript("spell_setup_rogue"); RegisterSpellScript("spell_dirty_deeds"); + RegisterSpellScript("spell_cheat_death_rogue"); RegisterSpellScript("spell_killing_spree"); RegisterSpellScript("spell_prey_on_the_weak"); + RegisterSpellScript("spell_nerves_of_steel"); } \ No newline at end of file diff --git a/src/game/Spells/Scripts/Scripting/ClassScripts/Shaman.cpp b/src/game/Spells/Scripts/Scripting/ClassScripts/Shaman.cpp index 599283a4914..093a6bda167 100644 --- a/src/game/Spells/Scripts/Scripting/ClassScripts/Shaman.cpp +++ b/src/game/Spells/Scripts/Scripting/ClassScripts/Shaman.cpp @@ -299,6 +299,17 @@ struct FireNovaShaman : public SpellScript } }; +// 51474 - Astral Shift +struct AstralShiftShaman : public AuraScript +{ + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override + { + // while affected by Stun and Fear + if (aura->GetTarget()->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED)) + remainingDamage -= remainingDamage * currentAbsorb / 100; + } +}; + void LoadShamanScripts() { Script* pNewScript = new Script; @@ -317,4 +328,5 @@ void LoadShamanScripts() RegisterSpellScript("spell_stoneclaw_totem_absorb"); RegisterSpellScript("spell_heroism_bloodlust"); RegisterSpellScript("spell_fire_nova_shaman"); + RegisterSpellScript("spell_astral_shift_shaman"); } \ No newline at end of file diff --git a/src/game/Spells/Scripts/SpellScript.h b/src/game/Spells/Scripts/SpellScript.h index 07d733f5b8d..9d1e90f55f6 100644 --- a/src/game/Spells/Scripts/SpellScript.h +++ b/src/game/Spells/Scripts/SpellScript.h @@ -108,7 +108,7 @@ struct AuraScript // called before proc handler virtual SpellAuraProcResult OnProc(Aura* /*aura*/, ProcExecutionData& /*procData*/) const { return SPELL_AURA_PROC_OK; } // called on absorb of this aura - virtual void OnAbsorb(Aura* /*aura*/, int32& /*currentAbsorb*/, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/) const {} + virtual void OnAbsorb(Aura* /*aura*/, int32& /*currentAbsorb*/, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const {} // called on mana shield absorb of this aura virtual void OnManaAbsorb(Aura* /*aura*/, int32& /*currentAbsorb*/) const {} // called on death prevention diff --git a/src/game/Spells/SpellAuras.cpp b/src/game/Spells/SpellAuras.cpp index 8bd51dd59a4..a3ccc603d52 100755 --- a/src/game/Spells/SpellAuras.cpp +++ b/src/game/Spells/SpellAuras.cpp @@ -11520,10 +11520,10 @@ SpellAuraProcResult Aura::OnProc(ProcExecutionData& data) return SPELL_AURA_PROC_OK; } -void Aura::OnAbsorb(int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& preventedDeath, bool& dropCharge) +void Aura::OnAbsorb(int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& preventedDeath, bool& dropCharge, DamageEffectType damageType) { if (AuraScript* script = GetAuraScript()) - script->OnAbsorb(this, currentAbsorb, remainingDamage, reflectedSpellId, reflectDamage, preventedDeath, dropCharge); + script->OnAbsorb(this, currentAbsorb, remainingDamage, reflectedSpellId, reflectDamage, preventedDeath, dropCharge, damageType); } void Aura::OnManaAbsorb(int32& currentAbsorb) diff --git a/src/game/Spells/SpellAuras.h b/src/game/Spells/SpellAuras.h index d16b935bf56..03748daaf78 100644 --- a/src/game/Spells/SpellAuras.h +++ b/src/game/Spells/SpellAuras.h @@ -554,7 +554,7 @@ class Aura void OnAfterApply(bool apply); bool OnCheckProc(ProcExecutionData& data); SpellAuraProcResult OnProc(ProcExecutionData& data); - void OnAbsorb(int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& preventedDeath, bool& dropCharge); + void OnAbsorb(int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& preventedDeath, bool& dropCharge, DamageEffectType damageType); void OnManaAbsorb(int32& currentAbsorb); void OnAuraDeathPrevention(int32& remainingDamage); void OnPeriodicTrigger(PeriodicTriggerData& data);