From 600b8ba18c3520202c9e4d2e35369ca844f3266a Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Wed, 4 Jun 2025 09:20:03 -0400 Subject: [PATCH] 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) --- Source/Game/Spells/SpellEffects.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index 03df46d8f..942c6cba9 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -1101,6 +1101,10 @@ namespace Game.Spells if (unitCaster == null) return; + // Caster not in world, might be spell triggered from aura removal + if (!unitCaster.IsInWorld) + return; + // only handle at last effect for (uint i = effectInfo.EffectIndex + 1; i < m_spellInfo.GetEffects().Count; ++i) if (m_spellInfo.GetEffect(i).IsEffect(SpellEffectName.PersistentAreaAura)) @@ -1108,11 +1112,13 @@ namespace Game.Spells Cypher.Assert(dynObjAura == null); - float radius = effectInfo.CalcRadius(unitCaster); - - // Caster not in world, might be spell triggered from aura removal - if (!unitCaster.IsInWorld) - return; + float radius = 0.0f; + for (uint i = 0; i <= effectInfo.EffectIndex; ++i) + { + SpellEffectInfo spellEffectInfo = m_spellInfo.GetEffect(i); + if (spellEffectInfo.IsEffect(SpellEffectName.PersistentAreaAura)) + radius = Math.Max(radius, spellEffectInfo.CalcRadius(unitCaster)); + } DynamicObject dynObj = new(false); if (!dynObj.CreateDynamicObject(unitCaster.GetMap().GenerateLowGuid(HighGuid.DynamicObject), unitCaster, m_spellInfo, destTarget, radius, DynamicObjectType.AreaSpell, m_SpellVisual))