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
+3 -6
View File
@@ -587,15 +587,12 @@ namespace Game.Spells
{
if (spell == null)
return false;
// Check family name
if (spell.SpellFamilyName != m_spellInfo.SpellFamilyName)
// Check family name and EffectClassMask
if (!spell.IsAffected(m_spellInfo.SpellFamilyName, GetSpellEffectInfo().SpellClassMask))
return false;
// Check EffectClassMask
if (GetSpellEffectInfo().SpellClassMask & spell.SpellFamilyFlags)
return true;
return false;
}
void SendTickImmune(Unit target, Unit caster)
+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)
+2 -5
View File
@@ -505,11 +505,8 @@ namespace Game.Entities
if (eventInfo.GetTypeMask().HasAnyFlag(ProcFlags.PeriodicMask | ProcFlags.SpellMask))
{
SpellInfo eventSpellInfo = eventInfo.GetSpellInfo();
if (procEntry.SpellFamilyName != 0 && eventSpellInfo != null && (procEntry.SpellFamilyName != eventSpellInfo.SpellFamilyName))
return false;
if (eventSpellInfo != null && !(procEntry.SpellFamilyMask & eventSpellInfo.SpellFamilyFlags))
if (eventSpellInfo != null)
if (!eventSpellInfo.IsAffected(procEntry.SpellFamilyName, procEntry.SpellFamilyMask))
return false;
}