Core/Scripts: Added SpellEffectInfo argument to CalcDamage and CalcHealing spell script hooks

(cherry picked from commit 884662a75a)

# Conflicts:
#	src/server/scripts/Shadowlands/Torghast/spell_torghast.cpp
#	src/server/scripts/Spells/spell_azerite.cpp
#	src/server/scripts/Spells/spell_evoker.cpp
#	src/server/scripts/Spells/spell_priest.cpp
#	src/server/scripts/Spells/spell_rogue.cpp
#	src/server/scripts/Spells/spell_warlock.cpp
This commit is contained in:
Shauren
2024-12-21 00:40:08 +01:00
committed by Ovahlord
parent 4011a0df2b
commit cb29e42e3a
16 changed files with 37 additions and 37 deletions

View File

@@ -124,7 +124,7 @@ class boss_rajaxx : public CreatureScript
// 25599 - Thundercrash
class spell_rajaxx_thundercrash : public SpellScript
{
static void HandleDamageCalc(Unit const* victim, int32& damage, int32& /*flatMod*/, float& /*pctMod*/)
static void HandleDamageCalc(SpellEffectInfo const& /*spellEffectInfo*/, Unit const* victim, int32& damage, int32& /*flatMod*/, float& /*pctMod*/)
{
damage = victim->CountPctFromCurHealth(50);
}

View File

@@ -240,7 +240,7 @@ private:
// 68793, 69050 - Magic's Bane
class spell_bronjahm_magic_bane : public SpellScript
{
void CalculateDamage(Unit const* victim, int32& damage, int32& /*flatMod*/, float& /*pctMod*/) const
void CalculateDamage(SpellEffectInfo const& /*spellEffectInfo*/, Unit const* victim, int32& damage, int32& /*flatMod*/, float& /*pctMod*/) const
{
if (victim->GetPowerType() != POWER_MANA)
return;

View File

@@ -1282,7 +1282,7 @@ class spell_blood_council_shadow_prison : public AuraScript
// 72999 - Shadow Prison
class spell_blood_council_shadow_prison_damage : public SpellScript
{
void CalculateDamage(Unit const* victim, int32& /*damage*/, int32& flatMod, float& /*pctMod*/) const
void CalculateDamage(SpellEffectInfo const& /*spellEffectInfo*/, Unit const* victim, int32& /*damage*/, int32& flatMod, float& /*pctMod*/) const
{
if (Aura const* aur = victim->GetAura(GetSpellInfo()->Id))
if (AuraEffect const* eff = aur->GetEffect(EFFECT_1))

View File

@@ -1888,7 +1888,7 @@ class spell_igb_incinerating_blast : public SpellScript
GetCaster()->SetPower(POWER_ENERGY, 0);
}
void CalculateDamage(Unit const* /*victim*/, int32& /*damage*/, int32& flatMod, float& /*pctMod*/) const
void CalculateDamage(SpellEffectInfo const& /*spellEffectInfo*/, Unit const* /*victim*/, int32& /*damage*/, int32& flatMod, float& /*pctMod*/) const
{
flatMod += _energyLeft * _energyLeft * 8;
}

View File

@@ -438,7 +438,7 @@ class spell_oculus_shock_lance : public SpellScript
return ValidateSpellInfo({ SPELL_AMBER_SHOCK_CHARGE });
}
void CalculateDamage(Unit const* victim, int32& /*damage*/, int32& flatMod, float& /*pctMod*/) const
void CalculateDamage(SpellEffectInfo const& /*spellEffectInfo*/, Unit const* victim, int32& /*damage*/, int32& flatMod, float& /*pctMod*/) const
{
if (AuraEffect const* shockCharges = victim->GetAuraEffect(SPELL_AMBER_SHOCK_CHARGE, EFFECT_0, GetCaster()->GetGUID()))
{

View File

@@ -239,7 +239,7 @@ private:
// 45477 - Icy Touch
class spell_dk_icy_touch : public SpellScript
{
void CalculateDamage(Unit* /*victim*/, int32& damage, int32& /*flatMod*/, float& /*pctMod*/)
void CalculateDamage(SpellEffectInfo const& /*spellEffectInfo*/, Unit* /*victim*/, int32& damage, int32& /*flatMod*/, float& /*pctMod*/)
{
damage += GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK) * 0.2f;
}

View File

@@ -1029,7 +1029,7 @@ private:
// 64208 - Consumption
class spell_gen_consumption : public SpellScript
{
void CalculateDamage(Unit const* /*victim*/, int32& damage, int32& /*flatMod*/, float& /*pctMod*/) const
void CalculateDamage(SpellEffectInfo const& /*spellEffectInfo*/, Unit const* /*victim*/, int32& damage, int32& /*flatMod*/, float& /*pctMod*/) const
{
if (SpellInfo const* createdBySpell = sSpellMgr->GetSpellInfo(GetCaster()->m_unitData->CreatedBySpell, GetCastDifficulty()))
damage = createdBySpell->GetEffect(EFFECT_1).CalcValue();
@@ -5302,7 +5302,7 @@ class spell_gen_major_healing_cooldown_modifier : public SpellScript
});
}
void CalculateHealingBonus(Unit* /*victim*/, int32& /*healing*/, int32& /*flatMod*/, float& pctMod) const
void CalculateHealingBonus(SpellEffectInfo const& /*spellEffectInfo*/, Unit* /*victim*/, int32& /*healing*/, int32& /*flatMod*/, float& pctMod) const
{
AddPct(pctMod, MajorPlayerHealingCooldownHelpers::GetBonusMultiplier(GetCaster(), GetSpellInfo()->Id));
}

View File

@@ -36,7 +36,7 @@ class spell_rog_eviscerate : public SpellScript
}
// Damage: effectValue + (basePoints * Combo) + (AP * 0.091 * Combo)
void CalculateDamage(Unit* /*victim*/, int32& /*damage*/, int32& flatMod, float& /*pctMod*/) const
void CalculateDamage(SpellEffectInfo const& /*spellEffectInfo*/, Unit* /*victim*/, int32& /*damage*/, int32& flatMod, float& /*pctMod*/) const
{
int32 combo = GetSpell()->m_spentComboPoints;
flatMod += (GetSpellInfo()->GetEffect(EFFECT_0).BasePoints * combo) + (GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK) * 0.091f * combo);

View File

@@ -29,7 +29,7 @@
class spell_warr_heroic_strike : public SpellScript
{
// Damage = {8+$ap*60/100}
void CalculateDamage(Unit* /*victim*/, int32& damage, int32& /*flatMod*/, float& /*pctMod*/)
void CalculateDamage(SpellEffectInfo const& /*spellEffectInfo*/, Unit* /*victim*/, int32& damage, int32& /*flatMod*/, float& /*pctMod*/)
{
damage = static_cast<int32>(8 + GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK) * 0.6f);
}