[10240] Fix some spells proc from spells that don't deal damage/heal

This commit is contained in:
Laise 2010-07-21 08:14:58 +03:00
parent 4f0f701b63
commit 3e326311ad
4 changed files with 25 additions and 5 deletions

View file

@ -910,14 +910,34 @@ bool Aura::isAffectedOnSpell(SpellEntry const *spell) const
return false;
}
bool Aura::CanProcFrom(SpellEntry const *spell) const
bool Aura::CanProcFrom(SpellEntry const *spell, uint32 EventProcEx, uint32 procEx, bool active) const
{
// Check EffectClassMask
uint32 const *ptr = getAuraSpellClassMask();
// if no class mask defined - allow proc
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;
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
{
// Check family name