[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; 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 // Check EffectClassMask
uint32 const *ptr = getAuraSpellClassMask(); uint32 const *ptr = getAuraSpellClassMask();
// if no class mask defined - allow proc // if no class mask defined, or spell_proc_event has SpellFamilyName=0 - allow proc
if (!((uint64*)ptr)[0] && !ptr[2]) if (!useClassMask || (!((uint64*)ptr)[0] && !ptr[2]))
{ {
if (!(EventProcEx & PROC_EX_EX_TRIGGER_ALWAYS)) if (!(EventProcEx & PROC_EX_EX_TRIGGER_ALWAYS))
{ {

View file

@ -372,7 +372,7 @@ class MANGOS_DLL_SPEC Aura
Modifier const* GetModifier() const { return &m_modifier; } Modifier const* GetModifier() const { return &m_modifier; }
int32 GetMiscValue() const { return m_spellAuraHolder->GetSpellProto()->EffectMiscValue[m_effIndex]; } int32 GetMiscValue() const { return m_spellAuraHolder->GetSpellProto()->EffectMiscValue[m_effIndex]; }
int32 GetMiscBValue() const { return m_spellAuraHolder->GetSpellProto()->EffectMiscValueB[m_effIndex]; } int32 GetMiscBValue() const { return m_spellAuraHolder->GetSpellProto()->EffectMiscValueB[m_effIndex]; }
SpellEntry const* GetSpellProto() const { return GetHolder()->GetSpellProto(); } SpellEntry const* GetSpellProto() const { return GetHolder()->GetSpellProto(); }
uint32 GetId() const{ return GetHolder()->GetSpellProto()->Id; } uint32 GetId() const{ return GetHolder()->GetSpellProto()->Id; }
ObjectGuid const& GetCastItemGuid() const { return GetHolder()->GetCastItemGuid(); } ObjectGuid const& GetCastItemGuid() const { return GetHolder()->GetCastItemGuid(); }
@ -434,7 +434,7 @@ class MANGOS_DLL_SPEC Aura
uint32 const *getAuraSpellClassMask() const { return m_spellAuraHolder->GetSpellProto()->GetEffectSpellClassMask(m_effIndex); } uint32 const *getAuraSpellClassMask() const { return m_spellAuraHolder->GetSpellProto()->GetEffectSpellClassMask(m_effIndex); }
bool isAffectedOnSpell(SpellEntry const *spell) const; 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 const* GetHolder() const { return m_spellHolder; }
SpellAuraHolder* GetHolder() { return m_spellAuraHolder; } SpellAuraHolder* GetHolder() { return m_spellAuraHolder; }
@ -469,7 +469,7 @@ class MANGOS_DLL_SPEC Aura
AuraRemoveMode m_removeMode:8; // Store info for know remove aura reason AuraRemoveMode m_removeMode:8; // Store info for know remove aura reason
SpellEffectIndex m_effIndex :8; // Aura effect index in spell SpellEffectIndex m_effIndex :8; // Aura effect index in spell
bool m_positive:1; bool m_positive:1;
bool m_isPeriodic:1; bool m_isPeriodic:1;
bool m_isAreaAura:1; bool m_isAreaAura:1;

View file

@ -2864,7 +2864,7 @@ bool Unit::IsSpellBlocked(Unit *pCaster, SpellEntry const *spellEntry, WeaponAtt
float blockChance = GetUnitBlockChance(); float blockChance = GetUnitBlockChance();
blockChance += (int32(pCaster->GetWeaponSkillValue(attackType)) - int32(GetMaxSkillValueForLevel()))*0.04f; blockChance += (int32(pCaster->GetWeaponSkillValue(attackType)) - int32(GetMaxSkillValueForLevel()))*0.04f;
return roll_chance_f(blockChance); return roll_chance_f(blockChance);
} }
@ -9762,11 +9762,11 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
(spellProcEvent->spellFamilyMask2[i] & procSpell->SpellFamilyFlags2) == 0) (spellProcEvent->spellFamilyMask2[i] & procSpell->SpellFamilyFlags2) == 0)
continue; continue;
} }
// don't check FamilyFlags if schoolMask exists // don't check dbc FamilyFlags unless spellFamilyName != 0
else if (!spellProcEvent->schoolMask && !triggeredByAura->CanProcFrom(procSpell, spellProcEvent->procEx, procExtra, damage != 0)) else if (!triggeredByAura->CanProcFrom(procSpell, spellProcEvent->procEx, procExtra, damage != 0, spellProcEvent->spellFamilyName != 0))
continue; 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; continue;
} }
@ -10797,4 +10797,4 @@ bool Unit::IsAllowedDamageInArea(Unit* pVictim) const
return false; return false;
return true; return true;
} }

View file

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