Core/AreaTriggers: Move SpellForVisuals override from AT spawn to properties
Port From (https://github.com/TrinityCore/TrinityCore/commit/2ad7c7829b17bb9e6e951632e8e0e68f68b9aa44)
This commit is contained in:
@@ -128,8 +128,17 @@ namespace Game.Entities
|
||||
|
||||
if (spellInfo != null && !IsStaticSpawn())
|
||||
SetUpdateFieldValue(areaTriggerData.ModifyValue(m_areaTriggerData.SpellID), spellInfo.Id);
|
||||
if (spellInfo != null)
|
||||
SetUpdateFieldValue(areaTriggerData.ModifyValue(m_areaTriggerData.SpellForVisuals), spellInfo.Id);
|
||||
|
||||
SpellInfo spellForVisuals = spellInfo;
|
||||
if (GetCreateProperties().SpellForVisuals.HasValue)
|
||||
{
|
||||
spellForVisuals = Global.SpellMgr.GetSpellInfo(GetCreateProperties().SpellForVisuals.Value, Difficulty.None);
|
||||
|
||||
if (spellForVisuals != null)
|
||||
spellVisual.SpellXSpellVisualID = spellForVisuals.GetSpellXSpellVisualId();
|
||||
}
|
||||
if (spellForVisuals != null)
|
||||
SetUpdateFieldValue(areaTriggerData.ModifyValue(m_areaTriggerData.SpellForVisuals), spellForVisuals.Id);
|
||||
|
||||
SpellCastVisualField spellCastVisual = areaTriggerData.ModifyValue(m_areaTriggerData.SpellVisual);
|
||||
SetUpdateFieldValue(ref spellCastVisual.SpellXSpellVisualID, spellVisual.SpellXSpellVisualID);
|
||||
@@ -268,15 +277,7 @@ namespace Game.Entities
|
||||
if (createProperties == null)
|
||||
return false;
|
||||
|
||||
SpellInfo spellInfo = null;
|
||||
SpellCastVisual spellVisual = default;
|
||||
if (spawnData.SpellForVisuals.HasValue)
|
||||
{
|
||||
spellInfo = Global.SpellMgr.GetSpellInfo(spawnData.SpellForVisuals.Value, Difficulty.None);
|
||||
if (spellInfo != null)
|
||||
spellVisual.SpellXSpellVisualID = spellInfo.GetSpellXSpellVisualId();
|
||||
}
|
||||
return Create(spawnData.Id, map, spawnData.SpawnPoint, -1, spawnData, null, null, spellVisual, spellInfo);
|
||||
return Create(spawnData.Id, map, spawnData.SpawnPoint, -1, spawnData);
|
||||
}
|
||||
|
||||
public override void Update(uint diff)
|
||||
|
||||
@@ -262,6 +262,8 @@ namespace Game.Entities
|
||||
|
||||
public uint DecalPropertiesId;
|
||||
|
||||
public uint? SpellForVisuals;
|
||||
|
||||
public uint TimeToTarget;
|
||||
public uint TimeToTargetScale;
|
||||
|
||||
@@ -286,7 +288,6 @@ namespace Game.Entities
|
||||
public class AreaTriggerSpawn : SpawnData
|
||||
{
|
||||
public new AreaTriggerId Id;
|
||||
public uint? SpellForVisuals;
|
||||
|
||||
public AreaTriggerSpawn() : base(SpawnObjectType.AreaTrigger) { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user