Core/Spells: DynamicObject auras will now use the largest radius found in SPELL_EFFECT_PERSISTENT_AREA_AURA effects of the spell creating them
Port From (https://github.com/TrinityCore/TrinityCore/commit/497cb7df49550c2420ce8729254cc120d3290d2e)
This commit is contained in:
@@ -1101,6 +1101,10 @@ namespace Game.Spells
|
|||||||
if (unitCaster == null)
|
if (unitCaster == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Caster not in world, might be spell triggered from aura removal
|
||||||
|
if (!unitCaster.IsInWorld)
|
||||||
|
return;
|
||||||
|
|
||||||
// only handle at last effect
|
// only handle at last effect
|
||||||
for (uint i = effectInfo.EffectIndex + 1; i < m_spellInfo.GetEffects().Count; ++i)
|
for (uint i = effectInfo.EffectIndex + 1; i < m_spellInfo.GetEffects().Count; ++i)
|
||||||
if (m_spellInfo.GetEffect(i).IsEffect(SpellEffectName.PersistentAreaAura))
|
if (m_spellInfo.GetEffect(i).IsEffect(SpellEffectName.PersistentAreaAura))
|
||||||
@@ -1108,11 +1112,13 @@ namespace Game.Spells
|
|||||||
|
|
||||||
Cypher.Assert(dynObjAura == null);
|
Cypher.Assert(dynObjAura == null);
|
||||||
|
|
||||||
float radius = effectInfo.CalcRadius(unitCaster);
|
float radius = 0.0f;
|
||||||
|
for (uint i = 0; i <= effectInfo.EffectIndex; ++i)
|
||||||
// Caster not in world, might be spell triggered from aura removal
|
{
|
||||||
if (!unitCaster.IsInWorld)
|
SpellEffectInfo spellEffectInfo = m_spellInfo.GetEffect(i);
|
||||||
return;
|
if (spellEffectInfo.IsEffect(SpellEffectName.PersistentAreaAura))
|
||||||
|
radius = Math.Max(radius, spellEffectInfo.CalcRadius(unitCaster));
|
||||||
|
}
|
||||||
|
|
||||||
DynamicObject dynObj = new(false);
|
DynamicObject dynObj = new(false);
|
||||||
if (!dynObj.CreateDynamicObject(unitCaster.GetMap().GenerateLowGuid(HighGuid.DynamicObject), unitCaster, m_spellInfo, destTarget, radius, DynamicObjectType.AreaSpell, m_SpellVisual))
|
if (!dynObj.CreateDynamicObject(unitCaster.GetMap().GenerateLowGuid(HighGuid.DynamicObject), unitCaster, m_spellInfo, destTarget, radius, DynamicObjectType.AreaSpell, m_SpellVisual))
|
||||||
|
|||||||
Reference in New Issue
Block a user