diff options
author | ModoX <moardox@gmail.com> | 2024-06-15 00:48:07 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-06-20 01:20:20 +0200 |
commit | c2987853edb487ea153177e79a1712ba6dc5a4ab (patch) | |
tree | f673cd66c7d74597e2375b2a9def962665fc8cff | |
parent | 2cfccad14fa9eef4fc8f64da4e8ec0616a6f7453 (diff) |
Core/Object: Added possibility to override sourceLocation for SendPlayOrphanSpellVisual
(cherry picked from commit 53204130c62aadca3b961844a1c9d2dfe967518d)
-rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 18 | ||||
-rw-r--r-- | src/server/game/Entities/Object/Object.h | 2 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 6d6452014b6..8a230d1c989 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2982,10 +2982,10 @@ SpellCastResult WorldObject::CastSpell(CastSpellTargetArg const& targets, uint32 return spell->prepare(*targets.Targets, args.TriggeringAura); } -void WorldObject::SendPlayOrphanSpellVisual(ObjectGuid const& target, uint32 spellVisualId, float travelSpeed, bool speedAsTime /*= false*/, bool withSourceOrientation /*= false*/) +void WorldObject::SendPlayOrphanSpellVisual(Position const& sourceLocation, ObjectGuid const& target, uint32 spellVisualId, float travelSpeed, bool speedAsTime /*= false*/, bool withSourceOrientation /*= false*/) { WorldPackets::Spells::PlayOrphanSpellVisual playOrphanSpellVisual; - playOrphanSpellVisual.SourceLocation = GetPosition(); + playOrphanSpellVisual.SourceLocation = sourceLocation; if (withSourceOrientation) { if (IsGameObject()) @@ -3007,10 +3007,10 @@ void WorldObject::SendPlayOrphanSpellVisual(ObjectGuid const& target, uint32 spe SendMessageToSet(playOrphanSpellVisual.Write(), true); } -void WorldObject::SendPlayOrphanSpellVisual(Position const& targetLocation, uint32 spellVisualId, float travelSpeed, bool speedAsTime /*= false*/, bool withSourceOrientation /*= false*/) +void WorldObject::SendPlayOrphanSpellVisual(Position const& sourceLocation, Position const& targetLocation, uint32 spellVisualId, float travelSpeed, bool speedAsTime /*= false*/, bool withSourceOrientation /*= false*/) { WorldPackets::Spells::PlayOrphanSpellVisual playOrphanSpellVisual; - playOrphanSpellVisual.SourceLocation = GetPosition(); + playOrphanSpellVisual.SourceLocation = sourceLocation; if (withSourceOrientation) { if (IsGameObject()) @@ -3032,6 +3032,16 @@ void WorldObject::SendPlayOrphanSpellVisual(Position const& targetLocation, uint SendMessageToSet(playOrphanSpellVisual.Write(), true); } +void WorldObject::SendPlayOrphanSpellVisual(ObjectGuid const& target, uint32 spellVisualId, float travelSpeed, bool speedAsTime /*= false*/, bool withSourceOrientation /*= false*/) +{ + SendPlayOrphanSpellVisual(GetPosition(), target, spellVisualId, travelSpeed, speedAsTime, withSourceOrientation); +} + +void WorldObject::SendPlayOrphanSpellVisual(Position const& targetLocation, uint32 spellVisualId, float travelSpeed, bool speedAsTime /*= false*/, bool withSourceOrientation /*= false*/) +{ + SendPlayOrphanSpellVisual(GetPosition(), targetLocation, spellVisualId, travelSpeed, speedAsTime, withSourceOrientation); +} + void WorldObject::SendCancelOrphanSpellVisual(uint32 id) { WorldPackets::Spells::CancelOrphanSpellVisual cancelOrphanSpellVisual; diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 577eff25495..b102dccac7d 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -693,6 +693,8 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation // CastSpell's third arg can be a variety of things - check out CastSpellExtraArgs' constructors! SpellCastResult CastSpell(CastSpellTargetArg const& targets, uint32 spellId, CastSpellExtraArgs const& args = { }); + void SendPlayOrphanSpellVisual(Position const& sourceLocation, ObjectGuid const& target, uint32 spellVisualId, float travelSpeed, bool speedAsTime = false, bool withSourceOrientation = false); + void SendPlayOrphanSpellVisual(Position const& sourceLocation, Position const& targetLocation, uint32 spellVisualId, float travelSpeed, bool speedAsTime = false, bool withSourceOrientation = false); void SendPlayOrphanSpellVisual(ObjectGuid const& target, uint32 spellVisualId, float travelSpeed, bool speedAsTime = false, bool withSourceOrientation = false); void SendPlayOrphanSpellVisual(Position const& targetLocation, uint32 spellVisualId, float travelSpeed, bool speedAsTime = false, bool withSourceOrientation = false); void SendCancelOrphanSpellVisual(uint32 id); |