mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-21 15:27:47 -04:00
Core/Entities: Replace existing GetAuraEffectsByType + iteration uses with proper helper functions
This commit is contained in:
@@ -837,17 +837,17 @@ void Player::UpdateExpertise(WeaponAttackType attack)
|
||||
int32 expertise = int32(GetRatingBonusValue(CR_EXPERTISE));
|
||||
|
||||
Item* weapon = GetWeaponForAttack(attack, true);
|
||||
|
||||
AuraEffectList const& expAuras = GetAuraEffectsByType(SPELL_AURA_MOD_EXPERTISE);
|
||||
for (AuraEffectList::const_iterator itr = expAuras.begin(); itr != expAuras.end(); ++itr)
|
||||
expertise += GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE, [weapon](AuraEffect const* aurEff) -> bool
|
||||
{
|
||||
// item neutral spell
|
||||
if ((*itr)->GetSpellInfo()->EquippedItemClass == -1)
|
||||
expertise += (*itr)->GetAmount();
|
||||
if (aurEff->GetSpellInfo()->EquippedItemClass == -1)
|
||||
return true;
|
||||
// item dependent spell
|
||||
else if (weapon && weapon->IsFitToSpellRequirements((*itr)->GetSpellInfo()))
|
||||
expertise += (*itr)->GetAmount();
|
||||
}
|
||||
else if (weapon && weapon->IsFitToSpellRequirements(aurEff->GetSpellInfo()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
if (expertise < 0)
|
||||
expertise = 0;
|
||||
@@ -890,9 +890,7 @@ void Player::UpdateManaRegen()
|
||||
// Get bonus from SPELL_AURA_MOD_MANA_REGEN_FROM_STAT aura
|
||||
AuraEffectList const& regenAura = GetAuraEffectsByType(SPELL_AURA_MOD_MANA_REGEN_FROM_STAT);
|
||||
for (AuraEffectList::const_iterator i = regenAura.begin(); i != regenAura.end(); ++i)
|
||||
{
|
||||
power_regen_mp5 += GetStat(Stats((*i)->GetMiscValue())) * (*i)->GetAmount() / 500.0f;
|
||||
}
|
||||
|
||||
// Set regen rate in cast state apply only on spirit based regen
|
||||
int32 modManaRegenInterrupt = GetTotalAuraModifier(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT);
|
||||
|
||||
Reference in New Issue
Block a user