mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()))
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user