[10830] Prevent spell_proc_event entries to proc on any spell cast when SpellFamilyName is zero.

Now only spells that actually deal damage or heal will trigger
when neither SpellFamilyName nor ProcEx & PROC_EX_EX_TRIGGER_ALWAYS are set.
Before, setting a SchoolMask would override this check, causing many bogus procs.
This commit is contained in:
Lynx3d 2010-12-06 21:18:25 +01:00
parent b6ea36192e
commit 81b6cb2751
4 changed files with 12 additions and 12 deletions

View file

@ -909,13 +909,13 @@ bool Aura::isAffectedOnSpell(SpellEntry const *spell) const
return false;
}
bool Aura::CanProcFrom(SpellEntry const *spell, uint32 EventProcEx, uint32 procEx, bool active) const
bool Aura::CanProcFrom(SpellEntry const *spell, uint32 EventProcEx, uint32 procEx, bool active, bool useClassMask) const
{
// Check EffectClassMask
uint32 const *ptr = getAuraSpellClassMask();
// if no class mask defined - allow proc
if (!((uint64*)ptr)[0] && !ptr[2])
// if no class mask defined, or spell_proc_event has SpellFamilyName=0 - allow proc
if (!useClassMask || (!((uint64*)ptr)[0] && !ptr[2]))
{
if (!(EventProcEx & PROC_EX_EX_TRIGGER_ALWAYS))
{

View file

@ -434,7 +434,7 @@ class MANGOS_DLL_SPEC Aura
uint32 const *getAuraSpellClassMask() const { return m_spellAuraHolder->GetSpellProto()->GetEffectSpellClassMask(m_effIndex); }
bool isAffectedOnSpell(SpellEntry const *spell) const;
bool CanProcFrom(SpellEntry const *spell, uint32 EventProcEx, uint32 procEx, bool active) const;
bool CanProcFrom(SpellEntry const *spell, uint32 EventProcEx, uint32 procEx, bool active, bool useClassMask) const;
//SpellAuraHolder const* GetHolder() const { return m_spellHolder; }
SpellAuraHolder* GetHolder() { return m_spellAuraHolder; }

View file

@ -9762,11 +9762,11 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
(spellProcEvent->spellFamilyMask2[i] & procSpell->SpellFamilyFlags2) == 0)
continue;
}
// don't check FamilyFlags if schoolMask exists
else if (!spellProcEvent->schoolMask && !triggeredByAura->CanProcFrom(procSpell, spellProcEvent->procEx, procExtra, damage != 0))
// don't check dbc FamilyFlags unless spellFamilyName != 0
else if (!triggeredByAura->CanProcFrom(procSpell, spellProcEvent->procEx, procExtra, damage != 0, spellProcEvent->spellFamilyName != 0))
continue;
}
else if (!triggeredByAura->CanProcFrom(procSpell, PROC_EX_NONE, procExtra, damage != 0))
else if (!triggeredByAura->CanProcFrom(procSpell, PROC_EX_NONE, procExtra, damage != 0, true))
continue;
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10829"
#define REVISION_NR "10830"
#endif // __REVISION_NR_H__