[10218] Restore trinket procs when no specific spell is defined for proc

This commit is contained in:
Laise 2010-07-18 18:53:09 +03:00
parent 7bb8b2bedb
commit c384650af8
4 changed files with 27 additions and 3 deletions

View file

@ -910,6 +910,29 @@ bool Aura::isAffectedOnSpell(SpellEntry const *spell) const
return false;
}
bool Aura::CanProcFrom(SpellEntry const *spell) const
{
// Check EffectClassMask
uint32 const *ptr = getAuraSpellClassMask();
// if no class mask defined - allow proc
if (!((uint64*)ptr)[0] && !ptr[2])
return true;
else
{
// Check family name
if (spell->SpellFamilyName != GetSpellProto()->SpellFamilyName)
return false;
if (((uint64*)ptr)[0] & spell->SpellFamilyFlags)
return true;
if (ptr[2] & spell->SpellFamilyFlags2)
return true;
}
return false;
}
void Aura::ReapplyAffectedPassiveAuras( Unit* target, bool owner_mode )
{
std::set<uint32> affectedSelf;

View file

@ -436,6 +436,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) const;
//SpellAuraHolder const* GetHolder() const { return m_spellHolder; }
SpellAuraHolder* GetHolder() { return m_spellAuraHolder; }

View file

@ -9519,10 +9519,10 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
(spellProcEvent->spellFamilyMask2[i] & procSpell->SpellFamilyFlags2) == 0)
continue;
}
else if (!spellProcEvent->schoolMask && !triggeredByAura->isAffectedOnSpell(procSpell))
else if (!spellProcEvent->schoolMask && !triggeredByAura->CanProcFrom(procSpell))
continue;
}
else if (!triggeredByAura->isAffectedOnSpell(procSpell))
else if (!triggeredByAura->CanProcFrom(procSpell))
continue;
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10217"
#define REVISION_NR "10218"
#endif // __REVISION_NR_H__