Core/Spells: Check a few aura effects for determining if should be negative (#25004)

(cherry picked from commit 5e1571062a)
This commit is contained in:
Gildor
2020-07-14 09:43:41 +02:00
committed by Shauren
parent b6a3774a38
commit 81154a7455

View File

@@ -4626,29 +4626,26 @@ bool _isPositiveEffectImpl(SpellInfo const* spellInfo, SpellEffectInfo const& ef
return true;
case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE:
case SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT:
case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
if (!_isPositiveTarget(effect))
if (SpellInfo const* spellTriggeredProto = sSpellMgr->GetSpellInfo(effect.TriggerSpell, spellInfo->Difficulty))
{
if (SpellInfo const* spellTriggeredProto = sSpellMgr->GetSpellInfo(effect.TriggerSpell, spellInfo->Difficulty))
// negative targets of main spell return early
for (SpellEffectInfo const& spellTriggeredEffect : spellTriggeredProto->GetEffects())
{
// negative targets of main spell return early
for (SpellEffectInfo const& spellTriggeredEffect : spellTriggeredProto->GetEffects())
{
// already seen this
if (visited.count({ spellTriggeredProto, spellTriggeredEffect.EffectIndex }) > 0)
continue;
// already seen this
if (visited.count({ spellTriggeredProto, spellTriggeredEffect.EffectIndex }) > 0)
continue;
if (!spellTriggeredEffect.IsEffect())
continue;
if (!spellTriggeredEffect.IsEffect())
continue;
// if non-positive trigger cast targeted to positive target this main cast is non-positive
// this will place this spell auras as debuffs
if (_isPositiveTarget(spellTriggeredEffect) && !_isPositiveEffectImpl(spellTriggeredProto, spellTriggeredEffect, visited))
return false;
}
// if non-positive trigger cast targeted to positive target this main cast is non-positive
// this will place this spell auras as debuffs
if (_isPositiveTarget(spellTriggeredEffect) && !_isPositiveEffectImpl(spellTriggeredProto, spellTriggeredEffect, visited))
return false;
}
}
break;
case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
case SPELL_AURA_MOD_STUN:
case SPELL_AURA_TRANSFORM:
case SPELL_AURA_MOD_DECREASE_SPEED: