From b3ffd700ddd3ceeb3d7d297f96a66a7a6709efc0 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Sun, 25 Aug 2024 23:51:42 -0400 Subject: [PATCH] Core/Object: Added possibility to override sourceLocation for SendPlayOrphanSpellVisual Port From (https://github.com/TrinityCore/TrinityCore/commit/53204130c62aadca3b961844a1c9d2dfe967518d) --- Source/Game/Entities/Object/WorldObject.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Source/Game/Entities/Object/WorldObject.cs b/Source/Game/Entities/Object/WorldObject.cs index a71b541a3..d45a70c03 100644 --- a/Source/Game/Entities/Object/WorldObject.cs +++ b/Source/Game/Entities/Object/WorldObject.cs @@ -2518,10 +2518,10 @@ namespace Game.Entities return spell.Prepare(targets.Targets, args.TriggeringAura); } - void SendPlayOrphanSpellVisual(ObjectGuid target, uint spellVisualId, float travelSpeed, bool speedAsTime = false, bool withSourceOrientation = false) + void SendPlayOrphanSpellVisual(Position sourceLocation, ObjectGuid target, uint spellVisualId, float travelSpeed, bool speedAsTime = false, bool withSourceOrientation = false) { PlayOrphanSpellVisual playOrphanSpellVisual = new(); - playOrphanSpellVisual.SourceLocation = GetPosition(); + playOrphanSpellVisual.SourceLocation = sourceLocation; if (withSourceOrientation) { if (IsGameObject()) @@ -2543,10 +2543,10 @@ namespace Game.Entities SendMessageToSet(playOrphanSpellVisual, true); } - void SendPlayOrphanSpellVisual(Position targetLocation, uint spellVisualId, float travelSpeed, bool speedAsTime = false, bool withSourceOrientation = false) + void SendPlayOrphanSpellVisual(Position sourceLocation, Position targetLocation, uint spellVisualId, float travelSpeed, bool speedAsTime = false, bool withSourceOrientation = false) { PlayOrphanSpellVisual playOrphanSpellVisual = new(); - playOrphanSpellVisual.SourceLocation = GetPosition(); + playOrphanSpellVisual.SourceLocation = sourceLocation; if (withSourceOrientation) { if (IsGameObject()) @@ -2568,6 +2568,16 @@ namespace Game.Entities SendMessageToSet(playOrphanSpellVisual, true); } + void SendPlayOrphanSpellVisual(ObjectGuid target, uint spellVisualId, float travelSpeed, bool speedAsTime = false, bool withSourceOrientation = false) + { + SendPlayOrphanSpellVisual(GetPosition(), target, spellVisualId, travelSpeed, speedAsTime, withSourceOrientation); + } + + void SendPlayOrphanSpellVisual(Position targetLocation, uint spellVisualId, float travelSpeed, bool speedAsTime = false, bool withSourceOrientation = false) + { + SendPlayOrphanSpellVisual(GetPosition(), targetLocation, spellVisualId, travelSpeed, speedAsTime, withSourceOrientation); + } + void SendCancelOrphanSpellVisual(uint id) { CancelOrphanSpellVisual cancelOrphanSpellVisual = new();