diff options
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index c35d06f8a62..0c85c15bc51 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -893,10 +893,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() @@ -917,8 +924,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); @@ -5764,6 +5777,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) { @@ -5785,7 +5805,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); } |
