Core/Spell: apply SPELLFAMILY_GENERIC mods to all spells by default

This commit is contained in:
hondacrx
2017-12-11 11:05:01 -05:00
parent 74950e0d66
commit 3760bfcdbb
3 changed files with 23 additions and 20 deletions
+16 -7
View File
@@ -597,6 +597,20 @@ namespace Game.Spells
return !(HasAttribute(SpellAttr1.NoThreat) || HasAttribute(SpellAttr3.NoInitialAggro));
}
public bool IsAffected(SpellFamilyNames familyName, FlagArray128 familyFlags)
{
if (familyName == 0)
return true;
if (familyName != SpellFamilyName)
return false;
if (familyFlags && !(familyFlags & SpellFamilyFlags))
return false;
return true;
}
bool IsAffectedBySpellMods()
{
return !HasAttribute(SpellAttr3.NoDoneBonus);
@@ -608,15 +622,10 @@ namespace Game.Spells
return false;
SpellInfo affectSpell = Global.SpellMgr.GetSpellInfo(mod.spellId);
// False if affect_spell == NULL or spellFamily not equal
if (affectSpell == null || affectSpell.SpellFamilyName != SpellFamilyName)
if (affectSpell == null)
return false;
// true
if (mod.mask & SpellFamilyFlags)
return true;
return false;
return IsAffected(affectSpell.SpellFamilyName, mod.mask);
}
public bool CanPierceImmuneAura(SpellInfo aura)