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

Closes #18160

(cherry picked from commit 4f1ef6985e)

# Conflicts:
#	src/server/game/Spells/Auras/SpellAuraEffects.cpp
#	src/server/game/Spells/SpellMgr.cpp
This commit is contained in:
ariel-
2016-11-04 14:21:28 -03:00
committed by joschiwald
parent e2ad91ddbc
commit 02b4dc5512
4 changed files with 25 additions and 20 deletions

View File

@@ -1110,14 +1110,12 @@ bool AuraEffect::IsAffectingSpell(SpellInfo const* spell) const
{
if (!spell)
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;
return true;
}
void AuraEffect::SendTickImmune(Unit* target, Unit* caster) const

View File

@@ -1531,6 +1531,20 @@ bool SpellInfo::HasInitialAggro() const
return !(HasAttribute(SPELL_ATTR1_NO_THREAT) || HasAttribute(SPELL_ATTR3_NO_INITIAL_AGGRO));
}
bool SpellInfo::IsAffected(uint32 familyName, flag128 const& familyFlags) const
{
if (!familyName)
return true;
if (familyName != SpellFamilyName)
return false;
if (familyFlags && !(familyFlags & SpellFamilyFlags))
return false;
return true;
}
bool SpellInfo::IsAffectedBySpellMods() const
{
return !HasAttribute(SPELL_ATTR3_NO_DONE_BONUS);
@@ -1542,15 +1556,10 @@ bool SpellInfo::IsAffectedBySpellMod(SpellModifier const* mod) const
return false;
SpellInfo const* affectSpell = sSpellMgr->GetSpellInfo(mod->spellId);
// False if affect_spell == NULL or spellFamily not equal
if (!affectSpell || affectSpell->SpellFamilyName != SpellFamilyName)
if (!affectSpell)
return false;
// true
if (mod->mask & SpellFamilyFlags)
return true;
return false;
return IsAffected(affectSpell->SpellFamilyName, mod->mask);
}
bool SpellInfo::CanPierceImmuneAura(SpellInfo const* aura) const

View File

@@ -491,6 +491,8 @@ class TC_GAME_API SpellInfo
bool IsAutoRepeatRangedSpell() const;
bool HasInitialAggro() const;
bool IsAffected(uint32 familyName, flag128 const& familyFlags) const;
bool IsAffectedBySpellMods() const;
bool IsAffectedBySpellMod(SpellModifier const* mod) const;

View File

@@ -480,13 +480,9 @@ bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcE
// check spell family name/flags (if set) for spells
if (eventInfo.GetTypeMask() & (PERIODIC_PROC_FLAG_MASK | SPELL_PROC_FLAG_MASK))
{
SpellInfo const* eventSpellInfo = eventInfo.GetSpellInfo();
if (procEntry.SpellFamilyName && eventSpellInfo && (procEntry.SpellFamilyName != eventSpellInfo->SpellFamilyName))
return false;
if (procEntry.SpellFamilyMask && eventSpellInfo && !(procEntry.SpellFamilyMask & eventSpellInfo->SpellFamilyFlags))
return false;
if (SpellInfo const* eventSpellInfo = eventInfo.GetSpellInfo())
if (!eventSpellInfo->IsAffected(procEntry.SpellFamilyName, procEntry.SpellFamilyMask))
return false;
}
// check spell type mask (if set)