diff options
Diffstat (limited to 'src')
13 files changed, 69 insertions, 30 deletions
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index b00ee7ff6d6..62c649f97c8 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -405,7 +405,11 @@ class spell_devourer_of_souls_mirrored_soul_proc : public SpellScriptLoader void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 damage = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), 45)); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 damage = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), 45); GetTarget()->CastCustomSpell(SPELL_MIRRORED_SOUL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetCaster(), true); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 1b2212d9ddc..b5de16670bc 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -729,8 +729,12 @@ class spell_blood_queen_essence_of_the_blood_queen : public SpellScriptLoader void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 heal = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); - GetTarget()->CastCustomSpell(SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), TRIGGERED_FULL_MASK, NULL, aurEff); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 heal = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount()); + GetTarget()->CastCustomSpell(SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), TRIGGERED_FULL_MASK, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 75d4e8dda85..e6c56e9c38b 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -2968,8 +2968,12 @@ class spell_the_lich_king_dark_hunger : public SpellScriptLoader void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 heal = int32(eventInfo.GetDamageInfo()->GetDamage() / 2); - GetTarget()->CastCustomSpell(SPELL_DARK_HUNGER_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), true, NULL, aurEff); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 heal = static_cast<int32>(damageInfo->GetDamage()) / 2; + GetTarget()->CastCustomSpell(SPELL_DARK_HUNGER_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), true, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index ed6c7c459bf..70ed4a83556 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -600,8 +600,11 @@ class spell_oculus_temporal_rift : public SpellScriptLoader void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 amount = aurEff->GetAmount() + eventInfo.GetDamageInfo()->GetDamage(); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + int32 amount = aurEff->GetAmount() + damageInfo->GetDamage(); if (amount >= 15000) { if (Unit* caster = GetCaster()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp index 3846a69595b..fefec61a8de 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp @@ -2730,8 +2730,12 @@ class spell_yogg_saron_grim_reprisal : public SpellScriptLoader // 63305 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 damage = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), 60); - GetTarget()->CastCustomSpell(SPELL_GRIM_REPRISAL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetDamageInfo()->GetAttacker(), true, NULL, aurEff); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 damage = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), 60); + GetTarget()->CastCustomSpell(SPELL_GRIM_REPRISAL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, damageInfo->GetAttacker(), true, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 8e9035e5a40..4bee97da000 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -117,7 +117,7 @@ class spell_gen_adaptive_warding : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - if (eventInfo.GetDamageInfo()->GetSpellInfo()) // eventInfo.GetSpellInfo() + if (!eventInfo.GetSpellInfo()) return false; // find Mage Armor @@ -160,7 +160,7 @@ class spell_gen_adaptive_warding : public SpellScriptLoader default: return; } - GetTarget()->CastSpell(GetTarget(), spellId, true, NULL, aurEff); + GetTarget()->CastSpell(GetTarget(), spellId, true, nullptr, aurEff); } void Register() override @@ -2120,7 +2120,7 @@ class spell_gen_obsidian_armor : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - if (eventInfo.GetDamageInfo()->GetSpellInfo()) // eventInfo.GetSpellInfo() + if (!eventInfo.GetSpellInfo()) return false; if (GetFirstSchoolInMask(eventInfo.GetSchoolMask()) == SPELL_SCHOOL_NORMAL) diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index c7798b25c37..e29a2d40400 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -805,9 +805,16 @@ class spell_hun_roar_of_sacrifice : public SpellScriptLoader return ValidateSpellInfo({ SPELL_ROAR_OF_SACRIFICE_TRIGGERED }); } - bool CheckProc(ProcEventInfo& eventInfo) + bool CheckProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { - return GetCaster() && (eventInfo.GetDamageInfo()->GetSchoolMask() & GetEffect(EFFECT_1)->GetMiscValue()) != 0; + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !(damageInfo->GetSchoolMask() & aurEff->GetMiscValue())) + return false; + + if (!GetCaster()) + return false; + + return true; } void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) @@ -820,7 +827,7 @@ class spell_hun_roar_of_sacrifice : public SpellScriptLoader void Register() override { - DoCheckProc += AuraCheckProcFn(spell_hun_roar_of_sacrifice_AuraScript::CheckProc); + DoCheckEffectProc += AuraCheckEffectProcFn(spell_hun_roar_of_sacrifice_AuraScript::CheckProc, EFFECT_1, SPELL_AURA_DUMMY); OnEffectProc += AuraEffectProcFn(spell_hun_roar_of_sacrifice_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY); } }; diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 018e527dc90..0b9e79f046e 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1405,8 +1405,12 @@ class spell_item_necrotic_touch : public SpellScriptLoader void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 bp = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); - GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, NULL, aurEff); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 bp = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount()); + GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index af62ef1de7a..616b7cc2c0f 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -492,7 +492,11 @@ class spell_pal_eye_for_an_eye : public SpellScriptLoader void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 damage = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 damage = CalculatePct(damageInfo->GetDamage(), aurEff->GetAmount()); GetTarget()->CastCustomSpell(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetProcTarget(), true, NULL, aurEff); } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 4b40ba278c7..0edaaa6079c 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -467,7 +467,7 @@ class spell_pri_divine_aegis : public SpellScriptLoader absorb = std::min(absorb, eventInfo.GetProcTarget()->getLevel() * 125); - GetTarget()->CastCustomSpell(SPELL_PRIEST_DIVINE_AEGIS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), true, NULL, aurEff); + GetTarget()->CastCustomSpell(SPELL_PRIEST_DIVINE_AEGIS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), true, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 11a3cc0b282..32d99002211 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -94,10 +94,11 @@ class spell_rog_blade_flurry : public SpellScriptLoader { PreventDefaultAction(); - TC_LOG_ERROR("misc", "damage: %u procSpell: %u", - eventInfo.GetDamageInfo()->GetDamage(), eventInfo.GetDamageInfo()->GetSpellInfo() ? eventInfo.GetDamageInfo()->GetSpellInfo()->Id : 0); - - GetTarget()->CastCustomSpell(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK, SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage(), _procTarget, true, NULL, aurEff); + if (DamageInfo* damageInfo = eventInfo.GetDamageInfo()) + { + int32 damage = damageInfo->GetDamage(); + GetTarget()->CastCustomSpell(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK, SPELLVALUE_BASE_POINT0, damage, _procTarget, true, nullptr, aurEff); + } } void Register() override diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 4479fa38326..72712f9dc30 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -598,15 +598,19 @@ class spell_warl_fel_synergy : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - return GetTarget()->GetGuardianPet() && eventInfo.GetDamageInfo()->GetDamage(); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return false; + + return GetTarget()->GetGuardianPet(); } void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 heal = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); - GetTarget()->CastCustomSpell(SPELL_WARLOCK_FEL_SYNERGY_HEAL, SPELLVALUE_BASE_POINT0, heal, (Unit*)NULL, true, NULL, aurEff); // TARGET_UNIT_PET + int32 heal = CalculatePct(static_cast<int32>(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); + GetTarget()->CastCustomSpell(SPELL_WARLOCK_FEL_SYNERGY_HEAL, SPELLVALUE_BASE_POINT0, heal, (Unit*)nullptr, true, nullptr, aurEff); // TARGET_UNIT_PET } void Register() override @@ -969,7 +973,7 @@ class spell_warl_seed_of_corruption_dummy : public SpellScriptLoader { PreventDefaultAction(); DamageInfo* damageInfo = eventInfo.GetDamageInfo(); - if (!damageInfo) + if (!damageInfo || !damageInfo->GetDamage()) return; int32 amount = aurEff->GetAmount() - damageInfo->GetDamage(); @@ -1026,7 +1030,7 @@ class spell_warl_seed_of_corruption_generic : public SpellScriptLoader { PreventDefaultAction(); DamageInfo* damageInfo = eventInfo.GetDamageInfo(); - if (!damageInfo) + if (!damageInfo || !damageInfo->GetDamage()) return; int32 amount = aurEff->GetAmount() - damageInfo->GetDamage(); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index a18eadf075e..976434695de 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -1048,9 +1048,9 @@ class spell_warr_sweeping_strikes : public SpellScriptLoader void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - if (eventInfo.GetDamageInfo()) + if (DamageInfo* damageInfo = eventInfo.GetDamageInfo()) { - SpellInfo const* spellInfo = eventInfo.GetDamageInfo()->GetSpellInfo(); + SpellInfo const* spellInfo = damageInfo->GetSpellInfo(); if (spellInfo && (spellInfo->Id == SPELL_WARRIOR_BLADESTORM_PERIODIC_WHIRLWIND || (spellInfo->Id == SPELL_WARRIOR_EXECUTE && !_procTarget->HasAuraState(AURA_STATE_HEALTHLESS_20_PERCENT)))) { // If triggered by Execute (while target is not under 20% hp) or Bladestorm deals normalized weapon damage @@ -1058,7 +1058,7 @@ class spell_warr_sweeping_strikes : public SpellScriptLoader } else { - int32 damage = eventInfo.GetDamageInfo()->GetDamage(); + int32 damage = damageInfo->GetDamage(); GetTarget()->CastCustomSpell(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1, SPELLVALUE_BASE_POINT0, damage, _procTarget, true, nullptr, aurEff); } } |
