From 17b7e6837f66179adf34bc0efd3cf1a473759edf Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 13 Mar 2023 02:39:10 -0400 Subject: [PATCH] Core/Misc: Add launchDelay argument to Unit::SendPlaySpellVisual overload accepting Unit* argument Port From (https://github.com/TrinityCore/TrinityCore/commit/982b60f39c526e217de3a3f24b740af41c4ede50) --- Source/Game/Entities/Unit/Unit.cs | 7 ++++--- Source/Scripts/Spells/Warrior.cs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/Game/Entities/Unit/Unit.cs b/Source/Game/Entities/Unit/Unit.cs index 91f6d2e3d..dca260e12 100644 --- a/Source/Game/Entities/Unit/Unit.cs +++ b/Source/Game/Entities/Unit/Unit.cs @@ -1129,7 +1129,7 @@ namespace Game.Entities } } - public void SendPlaySpellVisual(Unit target, uint spellVisualId, ushort missReason, ushort reflectStatus, float travelSpeed, bool speedAsTime = false) + public void SendPlaySpellVisual(Unit target, uint spellVisualId, ushort missReason, ushort reflectStatus, float travelSpeed, bool speedAsTime = false, float launchDelay = 0f) { PlaySpellVisual playSpellVisual = new(); playSpellVisual.Source = GetGUID(); @@ -1140,20 +1140,21 @@ namespace Game.Entities playSpellVisual.MissReason = missReason; playSpellVisual.ReflectStatus = reflectStatus; playSpellVisual.SpeedAsTime = speedAsTime; + playSpellVisual.LaunchDelay = launchDelay; SendMessageToSet(playSpellVisual, true); } - public void SendPlaySpellVisual(Position targetPosition, float launchDelay, uint spellVisualId, ushort missReason, ushort reflectStatus, float travelSpeed, bool speedAsTime = false) + public void SendPlaySpellVisual(Position targetPosition, uint spellVisualId, ushort missReason, ushort reflectStatus, float travelSpeed, bool speedAsTime = false, float launchDelay = 0f) { PlaySpellVisual playSpellVisual = new(); playSpellVisual.Source = GetGUID(); playSpellVisual.TargetPosition = targetPosition; - playSpellVisual.LaunchDelay = launchDelay; playSpellVisual.SpellVisualID = spellVisualId; playSpellVisual.TravelSpeed = travelSpeed; playSpellVisual.MissReason = missReason; playSpellVisual.ReflectStatus = reflectStatus; playSpellVisual.SpeedAsTime = speedAsTime; + playSpellVisual.LaunchDelay = launchDelay; SendMessageToSet(playSpellVisual, true); } diff --git a/Source/Scripts/Spells/Warrior.cs b/Source/Scripts/Spells/Warrior.cs index 1b1be748f..da9169d8c 100644 --- a/Source/Scripts/Spells/Warrior.cs +++ b/Source/Scripts/Spells/Warrior.cs @@ -106,7 +106,7 @@ namespace Scripts.Spells.Warrior { int timeOffset = (int)(6 * i * aurEff.GetPeriod() / 25); Vector4 loc = GetTarget().MoveSpline.ComputePosition(timeOffset); - GetTarget().SendPlaySpellVisual(new Position(loc.X, loc.Y, loc.Z), 0.0f, Misc.SpellVisualBlazingCharge, 0, 0, 1.0f, true); + GetTarget().SendPlaySpellVisual(new Position(loc.X, loc.Y, loc.Z), Misc.SpellVisualBlazingCharge, 0, 0, 1.0f, true); } } }