Core/Spells: Remove hardcoded value for dual wield talent removal and handle them for all classes
Also fix IsAffectingSpell compile errors after recent merge
This commit is contained in:
@@ -4170,8 +4170,19 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
|
||||
if (spell_id == 46917 && m_canTitanGrip)
|
||||
SetCanTitanGrip(false);
|
||||
if (spell_id == 674 && m_canDualWield)
|
||||
if (m_canDualWield)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id);
|
||||
if (spellInfo->IsPassive())
|
||||
{
|
||||
for (int i = 0; i < MAX_SPELL_EFFECTS; i++)
|
||||
if (spellInfo->Effects[i].Effect == SPELL_EFFECT_DUAL_WIELD)
|
||||
{
|
||||
SetCanDualWield(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN))
|
||||
AutoUnequipOffhandIfNeed();
|
||||
|
||||
@@ -1529,7 +1529,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo
|
||||
{
|
||||
if ((*itr)->GetSpellInfo()->EquippedItemClass == -1)
|
||||
{
|
||||
if (!spellInfo || (*itr)->IsAffectedOnSpell(spellInfo) || (*itr)->GetMiscValue() & spellInfo->GetSchoolMask())
|
||||
if (!spellInfo || (*itr)->IsAffectingSpell(spellInfo) || (*itr)->GetMiscValue() & spellInfo->GetSchoolMask())
|
||||
bonusPct += (*itr)->GetAmount();
|
||||
else if (!(*itr)->GetMiscValue() && !(*itr)->HasSpellClassMask())
|
||||
bonusPct += (*itr)->GetAmount();
|
||||
|
||||
@@ -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;
|
||||
bool HasSpellClassMask() const { return m_spellInfo->Effects[m_effIndex].SpellClassMask; }
|
||||
|
||||
void SendTickImmune(Unit* target, Unit* caster) const;
|
||||
|
||||
Reference in New Issue
Block a user