mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[10240] Fix some spells proc from spells that don't deal damage/heal
This commit is contained in:
parent
4f0f701b63
commit
3e326311ad
4 changed files with 25 additions and 5 deletions
|
|
@ -910,14 +910,34 @@ bool Aura::isAffectedOnSpell(SpellEntry const *spell) const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Aura::CanProcFrom(SpellEntry const *spell) const
|
bool Aura::CanProcFrom(SpellEntry const *spell, uint32 EventProcEx, uint32 procEx, bool active) 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 - allow proc
|
||||||
if (!((uint64*)ptr)[0] && !ptr[2])
|
if (!((uint64*)ptr)[0] && !ptr[2])
|
||||||
|
{
|
||||||
|
if (IsPassiveSpell(GetSpellProto()) && !(EventProcEx & PROC_EX_EX_TRIGGER_ALWAYS))
|
||||||
|
{
|
||||||
|
// Check for extra req (if none) and hit/crit
|
||||||
|
if (EventProcEx == PROC_EX_NONE)
|
||||||
|
{
|
||||||
|
// No extra req, so can trigger only for active (damage/healing present) and hit/crit
|
||||||
|
if((procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) && active)
|
||||||
return true;
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else // Passive spells hits here only if resist/reflect/immune/evade
|
||||||
|
{
|
||||||
|
// Passive spells can`t trigger if need hit (exclude cases when procExtra include non-active flags)
|
||||||
|
if ((EventProcEx & PROC_EX_NORMAL_HIT & procEx) && !active)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Check family name
|
// Check family name
|
||||||
|
|
|
||||||
|
|
@ -437,7 +437,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) const;
|
bool CanProcFrom(SpellEntry const *spell, uint32 EventProcEx, uint32 procEx, bool active) 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; }
|
||||||
|
|
|
||||||
|
|
@ -9519,10 +9519,10 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
|
||||||
(spellProcEvent->spellFamilyMask2[i] & procSpell->SpellFamilyFlags2) == 0)
|
(spellProcEvent->spellFamilyMask2[i] & procSpell->SpellFamilyFlags2) == 0)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (!spellProcEvent->schoolMask && !triggeredByAura->CanProcFrom(procSpell))
|
else if (!triggeredByAura->CanProcFrom(procSpell, spellProcEvent->procEx, procExtra, damage != 0))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (!triggeredByAura->CanProcFrom(procSpell))
|
else if (!triggeredByAura->CanProcFrom(procSpell, PROC_EX_NONE, procExtra, damage != 0))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10239"
|
#define REVISION_NR "10240"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue