Core/Spell: added some helpers to SpellInfo to reduce code duplication

(cherry picked from commit 14c2b2d6cd)
This commit is contained in:
ariel-
2016-12-30 23:50:28 -03:00
committed by DoctorKraft
parent 15b22590be
commit be4670250d
4 changed files with 67 additions and 46 deletions
+2 -9
View File
@@ -706,17 +706,10 @@ void Player::UpdateExpertise(WeaponAttackType attack)
int32 expertise = int32(GetRatingBonusValue(CR_EXPERTISE));
Item* weapon = GetWeaponForAttack(attack, true);
Item const* weapon = GetWeaponForAttack(attack, true);
expertise += GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE, [weapon](AuraEffect const* aurEff) -> bool
{
// item neutral spell
if (aurEff->GetSpellInfo()->EquippedItemClass == -1)
return true;
// item dependent spell
else if (weapon && weapon->IsFitToSpellRequirements(aurEff->GetSpellInfo()))
return true;
return false;
return aurEff->GetSpellInfo()->IsItemFitToSpellRequirements(weapon);
});
if (expertise < 0)