From e50102178b8d794991968649807156eac0ade5a0 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 31 Aug 2021 00:13:44 +0200 Subject: Core/Spells: Spell effect info access refactoring part 3 - removed direct SpellInfo::Effects field access from game --- src/server/scripts/Spells/spell_pet.cpp | 12 ++++++------ src/server/scripts/Spells/spell_priest.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 6e0c5eb1b27..068ee909857 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -917,7 +917,7 @@ public: if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt { SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value - AddPct(mod, spellInfo->Effects[EFFECT_0].CalcValue()); + AddPct(mod, spellInfo->GetEffect(EFFECT_0).CalcValue()); } ownerBonus = owner->GetStat(STAT_STAMINA)*mod; @@ -960,7 +960,7 @@ public: if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt { SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value - mod += CalculatePct(1.0f, spellInfo->Effects[EFFECT_1].CalcValue()); + mod += CalculatePct(1.0f, spellInfo->GetEffect(EFFECT_1).CalcValue()); } bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f * mod; @@ -990,7 +990,7 @@ public: if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt { SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value - mod += CalculatePct(1.0f, spellInfo->Effects[EFFECT_1].CalcValue()); + mod += CalculatePct(1.0f, spellInfo->GetEffect(EFFECT_1).CalcValue()); } bonusDamage = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.1287f * mod; @@ -1470,7 +1470,7 @@ public: amount = -90; // Night of the dead else if (Aura* aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD)) - amount = aur->GetSpellInfo()->Effects[EFFECT_2].CalcValue(); + amount = aur->GetSpellInfo()->GetEffect(EFFECT_2).CalcValue(); } } } @@ -1515,7 +1515,7 @@ public: // Ravenous Dead. Check just if owner has Ravenous Dead since it's effect is not an aura if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0)) - mod += aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()/100; // Ravenous Dead edits the original scale + mod += aurEff->GetSpellInfo()->GetEffect(EFFECT_1).CalcValue()/100; // Ravenous Dead edits the original scale // Glyph of the Ghoul if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_DEATH_KNIGHT_GLYPH_OF_GHOUL, 0)) @@ -1560,7 +1560,7 @@ public: aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0); if (aurEff) { - mod += CalculatePct(mod, aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()); // Ravenous Dead edits the original scale + mod += CalculatePct(mod, aurEff->GetSpellInfo()->GetEffect(EFFECT_1).CalcValue()); // Ravenous Dead edits the original scale } // Glyph of the Ghoul aurEff = owner->GetAuraEffect(58686, 0); diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 803ecee8c5c..e6e743c5d8f 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -432,7 +432,7 @@ class spell_pri_guardian_spirit : public AuraScript bool Load() override { - healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + healPct = GetEffectInfo(EFFECT_1).CalcValue(); return true; } -- cgit v1.2.3