diff options
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 769489d51d2..5712f1f92c1 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -476,7 +476,7 @@ void Spell::EffectSchoolDMG() ((*i)->GetSpellInfo()->SpellIconID == 95)) { // Mind Trauma - int32 const chance = (*i)->GetSpellInfo()->Effects[EFFECT_1].CalcValue(unitCaster); + int32 const chance = (*i)->GetSpellInfo()->GetEffect(EFFECT_1).CalcValue(unitCaster); if (roll_chance_i(chance)) unitCaster->CastSpell(unitTarget, 48301, true); break; @@ -540,7 +540,7 @@ void Spell::EffectSchoolDMG() { if ((*iter)->GetSpellInfo()->SpellFamilyName == SPELLFAMILY_ROGUE && (*iter)->GetSpellInfo()->SpellIconID == 1960) { - uint32 chance = (*iter)->GetSpellInfo()->Effects[EFFECT_2].CalcValue(unitCaster); + uint32 chance = (*iter)->GetSpellInfo()->GetEffect(EFFECT_2).CalcValue(unitCaster); if (chance && roll_chance_i(chance)) needConsume = false; @@ -609,7 +609,7 @@ void Spell::EffectSchoolDMG() /// @todo should this be put on taken but not done? if (found) - damage += m_spellInfo->Effects[EFFECT_1].CalcValue(); + damage += m_spellInfo->GetEffect(EFFECT_1).CalcValue(); if (Player* caster = unitCaster->ToPlayer()) { @@ -661,7 +661,7 @@ void Spell::EffectSchoolDMG() { uint8 level = unitCaster->GetLevel(); uint32 block_value = unitCaster->GetShieldBlockValue(uint32(float(level) * 29.5f), uint32(float(level) * 39.5f)); - damage += CalculatePct(block_value, m_spellInfo->Effects[EFFECT_1].CalcValue()); + damage += CalculatePct(block_value, m_spellInfo->GetEffect(EFFECT_1).CalcValue()); break; } break; @@ -1570,7 +1570,7 @@ void Spell::EffectPersistentAA() // only handle at last effect for (size_t i = effectInfo->EffectIndex + 1; i < m_spellInfo->GetEffects().size(); ++i) - if (m_spellInfo->GetEffect(SpellEffIndex(i)).Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA) + if (m_spellInfo->GetEffect(SpellEffIndex(i)).IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA)) return; ASSERT(!_dynObjAura); @@ -2349,7 +2349,7 @@ void Spell::EffectDispel() if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->GetCategory() == SPELLCATEGORY_DEVOUR_MAGIC) { CastSpellExtraArgs args(TRIGGERED_FULL_MASK); - args.AddSpellMod(SPELLVALUE_BASE_POINT0, m_spellInfo->Effects[EFFECT_1].CalcValue()); + args.AddSpellMod(SPELLVALUE_BASE_POINT0, m_spellInfo->GetEffect(EFFECT_1).CalcValue()); m_caster->CastSpell(m_caster, 19658, args); // Glyph of Felhunter if (Unit* owner = m_caster->GetOwner()) @@ -3145,7 +3145,7 @@ void Spell::EffectWeaponDmg() // Blood Strike if (m_spellInfo->SpellFamilyFlags[0] & 0x400000) { - float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(unitCaster->GetGUID()) / 2.0f; + float bonusPct = m_spellInfo->GetEffect(EFFECT_2).CalcValue() * unitTarget->GetDiseasesByCaster(unitCaster->GetGUID()) / 2.0f; // Death Knight T8 Melee 4P Bonus if (AuraEffect const* aurEff = unitCaster->GetAuraEffect(64736, EFFECT_0)) AddPct(bonusPct, aurEff->GetAmount()); @@ -3162,7 +3162,7 @@ void Spell::EffectWeaponDmg() { // Glyph of Death Strike if (AuraEffect const* aurEff = unitCaster->GetAuraEffect(59336, EFFECT_0)) - if (uint32 runic = std::min<uint32>(unitCaster->GetPower(POWER_RUNIC_POWER), aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue())) + if (uint32 runic = std::min<uint32>(unitCaster->GetPower(POWER_RUNIC_POWER), aurEff->GetSpellInfo()->GetEffect(EFFECT_1).CalcValue())) AddPct(totalDamagePercentMod, runic); break; } @@ -3176,7 +3176,7 @@ void Spell::EffectWeaponDmg() if (roll_chance_i(aurEff->GetAmount())) consumeDiseases = false; - float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(unitCaster->GetGUID(), consumeDiseases) / 2.0f; + float bonusPct = m_spellInfo->GetEffect(EFFECT_2).CalcValue() * unitTarget->GetDiseasesByCaster(unitCaster->GetGUID(), consumeDiseases) / 2.0f; // Death Knight T8 Melee 4P Bonus if (AuraEffect const* aurEff = unitCaster->GetAuraEffect(64736, EFFECT_0)) AddPct(bonusPct, aurEff->GetAmount()); @@ -3192,7 +3192,7 @@ void Spell::EffectWeaponDmg() // Heart Strike if (m_spellInfo->SpellFamilyFlags[0] & 0x1000000) { - float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(unitCaster->GetGUID()); + float bonusPct = m_spellInfo->GetEffect(EFFECT_2).CalcValue() * unitTarget->GetDiseasesByCaster(unitCaster->GetGUID()); // Death Knight T8 Melee 4P Bonus if (AuraEffect const* aurEff = unitCaster->GetAuraEffect(64736, EFFECT_0)) AddPct(bonusPct, aurEff->GetAmount()); @@ -3250,11 +3250,11 @@ void Spell::EffectWeaponDmg() int32 weaponDamage = unitCaster->CalculateDamage(m_attackType, normalized, addPctMods); // Sequence is important - for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) + for (SpellEffectInfo const& spellEffectInfo : m_spellInfo->GetEffects()) { // We assume that a spell have at most one fixed_bonus // and at most one weaponDamagePercentMod - switch (m_spellInfo->Effects[j].Effect) + switch (spellEffectInfo.Effect) { case SPELL_EFFECT_WEAPON_DAMAGE: case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL: @@ -3555,7 +3555,7 @@ void Spell::EffectScriptEffect() { /// @todo a hack, range = 11, should after some time cast, otherwise too far unitCaster->CastSpell(parent, 62496, true); - unitTarget->CastSpell(parent, m_spellInfo->Effects[EFFECT_0].CalcValue()); + unitTarget->CastSpell(parent, m_spellInfo->GetEffect(EFFECT_0).CalcValue()); } } } @@ -5335,7 +5335,7 @@ void Spell::SummonGuardian(SpellEffectInfo const& spellEffectInfo, uint32 entry, summon->SetDisplayId(1126); // modelid1 } - ExecuteLogEffectSummonObject(effectInfo->EffectIndex, summon); + ExecuteLogEffectSummonObject(spellEffectInfo.EffectIndex, summon); } } |
