Core/Spells: Begin unifying spell effect access api with master branch

* Introduce SpellInfo::GetEffects and SpellInfo::GetEffect functoins
This commit is contained in:
Shauren
2021-08-28 23:42:25 +02:00
parent 203f175ec9
commit 4c59532865
9 changed files with 251 additions and 230 deletions
+5 -3
View File
@@ -2352,12 +2352,12 @@ int32 Unit::GetMechanicResistChance(SpellInfo const* spellInfo) const
return 0;
int32 resistMech = 0;
for (uint8 eff = 0; eff < MAX_SPELL_EFFECTS; ++eff)
for (SpellEffectInfo const& effect : spellInfo->GetEffects())
{
if (!spellInfo->Effects[eff].IsEffect())
if (!effect.IsEffect())
break;
int32 effectMech = spellInfo->GetEffectMechanic(eff);
int32 effectMech = spellInfo->GetEffectMechanic(effect.EffectIndex);
if (effectMech)
{
int32 temp = GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_MECHANIC_RESISTANCE, effectMech);
@@ -7431,6 +7431,8 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
case SPELL_AURA_PERIODIC_HEALTH_FUNNEL:
DoneTotal = 0;
break;
default:
break;
}
if (spellProto->Effects[i].Effect == SPELL_EFFECT_HEALTH_LEECH)
DoneTotal = 0;