[9955] Prevent negetive proc events from possitive effects of negative spells.

Some negative spells have positive effects with targets not affected by negative effects of spell.
For example spell 45524 cast negative effecst to target and possitive effect to caster self.
For like possitive only target of negetive spell will not triggered negative proc events.
In last cases will avoid triggering glyph 43537 at caster at spell 43537 cast.
This commit is contained in:
VladimirMangos 2010-05-22 16:12:53 +04:00
parent 182fda8f3e
commit de454d6ff8
4 changed files with 32 additions and 9 deletions

View file

@ -760,6 +760,14 @@ void Spell::prepareDataForTriggerSystem()
}
break;
}
// some negative spells have positive effects to another or same targets
// avoid triggering negative hit for only positive targets
m_negativeEffectMask = 0x0;
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
if (!IsPositiveEffect(m_spellInfo->Id, SpellEffectIndex(i)))
m_negativeEffectMask |= (1<<i);
// Hunter traps spells (for Entrapment trigger)
// Gives your Immolation Trap, Frost Trap, Explosive Trap, and Snake Trap ....
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x000020000000001C)))
@ -950,6 +958,14 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
uint32 procVictim = m_procVictim;
uint32 procEx = PROC_EX_NONE;
// drop proc flags in case target not affected negative effects in negative spell
// for example caster bonus or animation
if (((procAttacker | procVictim) & NEGATIVE_TRIGGER_MASK) && !(target->effectMask & m_negativeEffectMask))
{
procAttacker = PROC_FLAG_NONE;
procVictim = PROC_FLAG_NONE;
}
if (m_spellInfo->speed > 0)
{
// mark effects that were already handled in Spell::HandleDelayedSpellLaunch on spell launch as processed
@ -1053,8 +1069,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
}
}
}
// Passive spell hits/misses or active spells only misses (only triggers)
else
// Passive spell hits/misses or active spells only misses (only triggers if proc flags set)
else if (procAttacker || procVictim)
{
// Fill base damage struct (unitTarget - is real spell target)
SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask);