Skip to content

Commit

Permalink
Core/Spells: Rename AuraEffect::IsAffectedOnSpell to IsAffectingSpell
Browse files Browse the repository at this point in the history
  • Loading branch information
Shocker committed Nov 26, 2011
1 parent d1135f0 commit ef9101e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
38 changes: 19 additions & 19 deletions src/server/game/Entities/Unit/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo
for (AuraEffectList::const_iterator j = ResIgnoreAurasAb.begin(); j != ResIgnoreAurasAb.end(); ++j)
{
if ((*j)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL
&& (*j)->IsAffectedOnSpell(spellInfo))
&& (*j)->IsAffectingSpell(spellInfo))
armor = floor(AddPctN(armor, -(*j)->GetAmount()));
}

Expand Down Expand Up @@ -1639,7 +1639,7 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe

AuraEffectList const& ResIgnoreAurasAb = GetAuraEffectsByType(SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST);
for (AuraEffectList::const_iterator j = ResIgnoreAurasAb.begin(); j != ResIgnoreAurasAb.end(); ++j)
if (((*j)->GetMiscValue() & schoolMask) && (*j)->IsAffectedOnSpell(spellInfo))
if (((*j)->GetMiscValue() & schoolMask) && (*j)->IsAffectingSpell(spellInfo))
AddPctN(damageResisted, -(*j)->GetAmount());

AuraEffectList const& ResIgnoreAuras = GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST);
Expand Down Expand Up @@ -1668,7 +1668,7 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
if (!((*itr)->GetMiscValue() & schoolMask))
continue;

if (((*itr)->GetAmount() > auraAbsorbMod) && (*itr)->IsAffectedOnSpell(spellInfo))
if (((*itr)->GetAmount() > auraAbsorbMod) && (*itr)->IsAffectingSpell(spellInfo))
auraAbsorbMod = float((*itr)->GetAmount());
}
RoundToInterval(auraAbsorbMod, 0.0f, 100.0f);
Expand Down Expand Up @@ -2406,7 +2406,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell)
AuraEffectList const& ignore = GetAuraEffectsByType(SPELL_AURA_IGNORE_COMBAT_RESULT);
for (AuraEffectList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
{
if (!(*i)->IsAffectedOnSpell(spell))
if (!(*i)->IsAffectingSpell(spell))
continue;
switch ((*i)->GetMiscValue())
{
Expand Down Expand Up @@ -4250,7 +4250,7 @@ bool Unit::HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const* affecte
{
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
if ((*i)->IsAffectedOnSpell(affectedSpell))
if ((*i)->IsAffectingSpell(affectedSpell))
return true;
return false;
}
Expand Down Expand Up @@ -4310,7 +4310,7 @@ AuraEffect* Unit::IsScriptOverriden(SpellInfo const* spell, int32 script) const
for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
{
if ((*i)->GetMiscValue() == script)
if ((*i)->IsAffectedOnSpell(spell))
if ((*i)->IsAffectingSpell(spell))
return (*i);
}
return NULL;
Expand Down Expand Up @@ -4547,7 +4547,7 @@ int32 Unit::GetTotalAuraModifierByAffectMask(AuraType auratype, SpellInfo const*
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
{
if ((*i)->IsAffectedOnSpell(affectedSpell))
if ((*i)->IsAffectingSpell(affectedSpell))
modifier += (*i)->GetAmount();
}
return modifier;
Expand All @@ -4560,7 +4560,7 @@ float Unit::GetTotalAuraMultiplierByAffectMask(AuraType auratype, SpellInfo cons
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
{
if ((*i)->IsAffectedOnSpell(affectedSpell))
if ((*i)->IsAffectingSpell(affectedSpell))
AddPctN(multiplier, (*i)->GetAmount());
}
return multiplier;
Expand All @@ -4573,7 +4573,7 @@ int32 Unit::GetMaxPositiveAuraModifierByAffectMask(AuraType auratype, SpellInfo
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
{
if ((*i)->IsAffectedOnSpell(affectedSpell) && (*i)->GetAmount() > modifier)
if ((*i)->IsAffectingSpell(affectedSpell) && (*i)->GetAmount() > modifier)
modifier = (*i)->GetAmount();
}

Expand All @@ -4587,7 +4587,7 @@ int32 Unit::GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellInfo
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
{
if ((*i)->IsAffectedOnSpell(affectedSpell) && (*i)->GetAmount() < modifier)
if ((*i)->IsAffectingSpell(affectedSpell) && (*i)->GetAmount() < modifier)
modifier = (*i)->GetAmount();
}

Expand Down Expand Up @@ -9639,7 +9639,7 @@ bool Unit::HasAuraState(AuraStateType flag, SpellInfo const* spellProto, Unit co
{
AuraEffectList const& stateAuras = Caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
for (AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j)
if ((*j)->IsAffectedOnSpell(spellProto))
if ((*j)->IsAffectingSpell(spellProto))
return true;
}
// Check per caster aura state
Expand Down Expand Up @@ -10310,7 +10310,7 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32
AuraEffectList const& mOverrideClassScript= owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
{
if (!(*i)->IsAffectedOnSpell(spellProto))
if (!(*i)->IsAffectingSpell(spellProto))
continue;

switch ((*i)->GetMiscValue())
Expand Down Expand Up @@ -10629,7 +10629,7 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32
// From caster spells
AuraEffectList const& mOwnerTaken = victim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER);
for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i)
if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto))
if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectingSpell(spellProto))
AddPctN(TakenTotalMod, (*i)->GetAmount());

// Mod damage from spell mechanic
Expand Down Expand Up @@ -10883,7 +10883,7 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas
AuraEffectList const& mOverrideClassScript = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
{
if (!((*i)->IsAffectedOnSpell(spellProto)))
if (!((*i)->IsAffectingSpell(spellProto)))
continue;
int32 modChance = 0;
switch ((*i)->GetMiscValue())
Expand Down Expand Up @@ -11027,7 +11027,7 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas

AuraEffectList const& critAuras = victim->GetAuraEffectsByType(SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER);
for (AuraEffectList::const_iterator i = critAuras.begin(); i != critAuras.end(); ++i)
if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto))
if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectingSpell(spellProto))
crit_chance += (*i)->GetAmount();

crit_chance = crit_chance > 0.0f ? crit_chance : 0.0f;
Expand Down Expand Up @@ -11131,7 +11131,7 @@ uint32 Unit::SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32
AuraEffectList const& mOverrideClassScript= owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
{
if (!(*i)->IsAffectedOnSpell(spellProto))
if (!(*i)->IsAffectingSpell(spellProto))
continue;
switch ((*i)->GetMiscValue())
{
Expand Down Expand Up @@ -11362,7 +11362,7 @@ uint32 Unit::SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32

AuraEffectList const& mHealingGet= victim->GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_RECEIVED);
for (AuraEffectList::const_iterator i = mHealingGet.begin(); i != mHealingGet.end(); ++i)
if (GetGUID() == (*i)->GetCasterGUID() && (*i)->IsAffectedOnSpell(spellProto))
if (GetGUID() == (*i)->GetCasterGUID() && (*i)->IsAffectingSpell(spellProto))
AddPctN(TakenTotalMod, (*i)->GetAmount());

heal = (int32(heal) + TakenTotal) * TakenTotalMod;
Expand Down Expand Up @@ -11671,7 +11671,7 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT
AuraEffectList const& mOverrideClassScript = owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
{
if (!(*i)->IsAffectedOnSpell(spellProto))
if (!(*i)->IsAffectingSpell(spellProto))
continue;

switch ((*i)->GetMiscValue())
Expand Down Expand Up @@ -11747,7 +11747,7 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT
// From caster spells
AuraEffectList const& mOwnerTaken = victim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER);
for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i)
if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto))
if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectingSpell(spellProto))
AddPctN(TakenTotalMod, (*i)->GetAmount());

// .. taken pct (special attacks)
Expand Down
6 changes: 3 additions & 3 deletions src/server/game/Spells/Auras/SpellAuraEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
Unit::AuraEffectList const& overrideClassScripts = caster->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for (Unit::AuraEffectList::const_iterator itr = overrideClassScripts.begin(); itr != overrideClassScripts.end(); ++itr)
{
if ((*itr)->IsAffectedOnSpell(m_spellInfo))
if ((*itr)->IsAffectingSpell(m_spellInfo))
{
// Glyph of Fear, Glyph of Frost nova and similar auras
if ((*itr)->GetMiscValue() == 7801)
Expand Down Expand Up @@ -1228,7 +1228,7 @@ bool AuraEffect::IsPeriodicTickCrit(Unit* target, Unit const* caster) const
Unit::AuraEffectList const& mPeriodicCritAuras= caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_PERIODIC_CRIT);
for (Unit::AuraEffectList::const_iterator itr = mPeriodicCritAuras.begin(); itr != mPeriodicCritAuras.end(); ++itr)
{
if ((*itr)->IsAffectedOnSpell(m_spellInfo) && caster->isSpellCrit(target, m_spellInfo, m_spellInfo->GetSchoolMask()))
if ((*itr)->IsAffectingSpell(m_spellInfo) && caster->isSpellCrit(target, m_spellInfo, m_spellInfo->GetSchoolMask()))
return true;
}
// Rupture - since 3.3.3 can crit
Expand All @@ -1240,7 +1240,7 @@ bool AuraEffect::IsPeriodicTickCrit(Unit* target, Unit const* caster) const
return false;
}

bool AuraEffect::IsAffectedOnSpell(SpellInfo const* spell) const
bool AuraEffect::IsAffectingSpell(SpellInfo const* spell) const
{
if (!spell)
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Spells/Auras/SpellAuraEffects.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class AuraEffect

bool IsPeriodic() const { return m_isPeriodic; }
void SetPeriodic(bool isPeriodic) { m_isPeriodic = isPeriodic; }
bool IsAffectedOnSpell(SpellInfo const* spell) const;
bool IsAffectingSpell(SpellInfo const* spell) const;

void SendTickImmune(Unit* target, Unit* caster) const;
void PeriodicTick(AuraApplication * aurApp, Unit* caster) const;
Expand Down
14 changes: 7 additions & 7 deletions src/server/game/Spells/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2814,7 +2814,7 @@ uint32 Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur)
{
Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS);
for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j)
if ((*j)->IsAffectedOnSpell(m_spellInfo))
if ((*j)->IsAffectingSpell(m_spellInfo))
maxTargets += (*j)->GetAmount();

if (m_spellInfo->Id == 5246) //Intimidating Shout
Expand All @@ -2834,7 +2834,7 @@ uint32 Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur)
{
Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS);
for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j)
if ((*j)->IsAffectedOnSpell(m_spellInfo))
if ((*j)->IsAffectingSpell(m_spellInfo))
maxTargets += (*j)->GetAmount();

Trinity::RandomResizeList(gobjectList, maxTargets);
Expand Down Expand Up @@ -3605,7 +3605,7 @@ void Spell::finish(bool ok)
Unit::AuraEffectList const& vIgnoreReset = m_caster->GetAuraEffectsByType(SPELL_AURA_IGNORE_MELEE_RESET);
for (Unit::AuraEffectList::const_iterator i = vIgnoreReset.begin(); i != vIgnoreReset.end(); ++i)
{
if ((*i)->IsAffectedOnSpell(m_spellInfo))
if ((*i)->IsAffectingSpell(m_spellInfo))
{
found = true;
break;
Expand Down Expand Up @@ -4533,7 +4533,7 @@ SpellCastResult Spell::CheckCast(bool strict)
Unit::AuraEffectList const& ignore = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_SHAPESHIFT);
for (Unit::AuraEffectList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
{
if (!(*i)->IsAffectedOnSpell(m_spellInfo))
if (!(*i)->IsAffectingSpell(m_spellInfo))
continue;
checkForm = false;
break;
Expand All @@ -4559,7 +4559,7 @@ SpellCastResult Spell::CheckCast(bool strict)
Unit::AuraEffectList const& stateAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
for (Unit::AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j)
{
if ((*j)->IsAffectedOnSpell(m_spellInfo))
if ((*j)->IsAffectingSpell(m_spellInfo))
{
m_needComboPoints = false;
if ((*j)->GetMiscValue() == 1)
Expand Down Expand Up @@ -6475,7 +6475,7 @@ void Spell::HandleLaunchPhase()
Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_CONSUME_NO_AMMO);
for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j)
{
if ((*j)->IsAffectedOnSpell(m_spellInfo))
if ((*j)->IsAffectingSpell(m_spellInfo))
usesAmmo=false;
}

Expand Down Expand Up @@ -7030,7 +7030,7 @@ void Spell::PrepareTriggersExecutedOnHit()
Unit::AuraEffectList const& targetTriggers = m_caster->GetAuraEffectsByType(SPELL_AURA_ADD_TARGET_TRIGGER);
for (Unit::AuraEffectList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i)
{
if (!(*i)->IsAffectedOnSpell(m_spellInfo))
if (!(*i)->IsAffectingSpell(m_spellInfo))
continue;
SpellInfo const* auraSpellInfo = (*i)->GetSpellInfo();
uint32 auraSpellIdx = (*i)->GetEffIndex();
Expand Down

0 comments on commit ef9101e

Please sign in to comment.