Core/Spells: Relaxed aura exclusivity check to allow casting spells that have other, non-aura effects even if aura will not be applied
Port From (https://github.com/TrinityCore/TrinityCore/commit/6413466693e424ee42744a4cdb8b24502631fa49)
This commit is contained in:
@@ -3941,13 +3941,6 @@ namespace Game.Entities
|
|||||||
|
|
||||||
if (!IsHighestExclusiveAura(aura))
|
if (!IsHighestExclusiveAura(aura))
|
||||||
{
|
{
|
||||||
if (!aura.GetSpellInfo().IsAffectingArea())
|
|
||||||
{
|
|
||||||
Unit caster = aura.GetCaster();
|
|
||||||
if (caster && caster.IsTypeId(TypeId.Player))
|
|
||||||
Spell.SendCastResult(caster.ToPlayer(), aura.GetSpellInfo(), aura.GetSpellVisual(), aura.GetCastId(), SpellCastResult.AuraBounced);
|
|
||||||
}
|
|
||||||
|
|
||||||
aura.Remove();
|
aura.Remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4812,6 +4812,7 @@ namespace Game.Spells
|
|||||||
return castResult;
|
return castResult;
|
||||||
|
|
||||||
uint approximateAuraEffectMask = 0;
|
uint approximateAuraEffectMask = 0;
|
||||||
|
uint nonAuraEffectMask = 0;
|
||||||
foreach (var spellEffectInfo in m_spellInfo.GetEffects())
|
foreach (var spellEffectInfo in m_spellInfo.GetEffects())
|
||||||
{
|
{
|
||||||
// for effects of spells that have only one target
|
// for effects of spells that have only one target
|
||||||
@@ -5393,6 +5394,8 @@ namespace Game.Spells
|
|||||||
|
|
||||||
if (spellEffectInfo.IsAura())
|
if (spellEffectInfo.IsAura())
|
||||||
approximateAuraEffectMask |= 1u << (int)spellEffectInfo.EffectIndex;
|
approximateAuraEffectMask |= 1u << (int)spellEffectInfo.EffectIndex;
|
||||||
|
else if (spellEffectInfo.IsEffect())
|
||||||
|
nonAuraEffectMask |= 1u << (int)spellEffectInfo.EffectIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var spellEffectInfo in m_spellInfo.GetEffects())
|
foreach (var spellEffectInfo in m_spellInfo.GetEffects())
|
||||||
@@ -5517,7 +5520,7 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if target already has the same type, but more powerful aura
|
// check if target already has the same type, but more powerful aura
|
||||||
if (!m_spellInfo.IsTargetingArea())
|
if (nonAuraEffectMask == 0 && (approximateAuraEffectMask & (1 << (int)spellEffectInfo.EffectIndex)) != 0 && !m_spellInfo.IsTargetingArea())
|
||||||
{
|
{
|
||||||
Unit target = m_targets.GetUnitTarget();
|
Unit target = m_targets.GetUnitTarget();
|
||||||
if (target != null)
|
if (target != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user