aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 69c42a2c13c..84f695cf670 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -905,10 +905,17 @@ void Spell::EffectJump()
float speedXY, speedZ;
CalculateJumpSpeeds(effectInfo, unitCaster->GetExactDist2d(unitTarget), speedXY, speedZ);
+ MovementFacingTarget facing;
+ if (Unit const* target = m_targets.GetUnitTarget())
+ {
+ if (m_spellInfo->HasAttribute(SPELL_ATTR9_FACE_UNIT_TARGET_UPON_COMPLETION_OF_JUMP_CHARGE))
+ facing = target;
+ }
+
JumpArrivalCastArgs arrivalCast;
arrivalCast.SpellId = effectInfo->TriggerSpell;
arrivalCast.Target = unitTarget->GetGUID();
- unitCaster->GetMotionMaster()->MoveJump(*unitTarget, speedXY, speedZ, EVENT_JUMP, {}, &arrivalCast);
+ unitCaster->GetMotionMaster()->MoveJump(*unitTarget, speedXY, speedZ, EVENT_JUMP, facing, &arrivalCast);
}
void Spell::EffectJumpDest()
@@ -929,8 +936,14 @@ void Spell::EffectJumpDest()
float speedXY, speedZ;
CalculateJumpSpeeds(effectInfo, unitCaster->GetExactDist2d(destTarget), speedXY, speedZ);
MovementFacingTarget facing;
- if (!m_targets.GetUnitTargetGUID().IsEmpty())
+ if (Unit const* target = m_targets.GetUnitTarget())
+ {
+ if (m_spellInfo->HasAttribute(SPELL_ATTR9_FACE_UNIT_TARGET_UPON_COMPLETION_OF_JUMP_CHARGE))
+ facing = target;
+ }
+ else
facing = destTarget->GetOrientation();
+
JumpArrivalCastArgs arrivalCast;
arrivalCast.SpellId = effectInfo->TriggerSpell;
unitCaster->GetMotionMaster()->MoveJump(*destTarget, speedXY, speedZ, EVENT_JUMP, facing, &arrivalCast);
@@ -5733,6 +5746,13 @@ void Spell::EffectJumpCharge()
if (params->TreatSpeedAsMoveTimeSeconds)
speed = unitCaster->GetExactDist(destTarget) / params->MoveTimeInSec;
+ MovementFacingTarget facing;
+ if (Unit const* target = m_targets.GetUnitTarget())
+ {
+ if (m_spellInfo->HasAttribute(SPELL_ATTR9_FACE_UNIT_TARGET_UPON_COMPLETION_OF_JUMP_CHARGE))
+ facing = target;
+ }
+
Optional<JumpArrivalCastArgs> arrivalCast;
if (effectInfo->TriggerSpell)
{
@@ -5754,7 +5774,7 @@ void Spell::EffectJumpCharge()
effectExtra->ParabolicCurveId = *params->ParabolicCurveId;
}
- unitCaster->GetMotionMaster()->MoveJumpWithGravity(*destTarget, speed, params->JumpGravity, EVENT_JUMP, {},
+ unitCaster->GetMotionMaster()->MoveJumpWithGravity(*destTarget, speed, params->JumpGravity, EVENT_JUMP, facing,
arrivalCast ? &*arrivalCast : nullptr,
effectExtra ? &*effectExtra : nullptr);
}