diff options
Diffstat (limited to 'src/server/game/Movement/MotionMaster.cpp')
-rw-r--r-- | src/server/game/Movement/MotionMaster.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 6756463283f..22f06801640 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -345,7 +345,7 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos) Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE); } -void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ) +void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ, Movement::SpellEffectExtraData const* spellEffectExtraData /*= nullptr*/) { //this function may make players fall below map if (_owner->GetTypeId() == TYPEID_PLAYER) @@ -366,6 +366,9 @@ void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, floa init.SetParabolic(max_height, 0); init.SetOrientationFixed(true); init.SetVelocity(speedXY); + if (spellEffectExtraData) + init.SetSpellEffectExtraData(*spellEffectExtraData); + init.Launch(); Mutate(new EffectMovementGenerator(0), MOTION_SLOT_CONTROLLED); } @@ -384,7 +387,8 @@ void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ) MoveJump(x, y, z, 0.0f, speedXY, speedZ); } -void MotionMaster::MoveJump(float x, float y, float z, float o, float speedXY, float speedZ, uint32 id /*= EVENT_JUMP*/, bool hasOrientation /* = false*/, uint32 arrivalSpellId /*= 0*/, ObjectGuid const& arrivalSpellTargetGuid /*= ObjectGuid::Empty*/) +void MotionMaster::MoveJump(float x, float y, float z, float o, float speedXY, float speedZ, uint32 id /*= EVENT_JUMP*/, bool hasOrientation /* = false*/, + JumpArrivalCastArgs const* arrivalCast /*= nullptr*/, Movement::SpellEffectExtraData const* spellEffectExtraData /*= nullptr*/) { TC_LOG_DEBUG("misc", "Unit (%s) jumps to point (X: %f Y: %f Z: %f).", _owner->GetGUID().ToString().c_str(), x, y, z); if (speedXY <= 0.1f) @@ -399,7 +403,18 @@ void MotionMaster::MoveJump(float x, float y, float z, float o, float speedXY, f init.SetVelocity(speedXY); if (hasOrientation) init.SetFacing(o); + if (spellEffectExtraData) + init.SetSpellEffectExtraData(*spellEffectExtraData); init.Launch(); + + uint32 arrivalSpellId = 0; + ObjectGuid arrivalSpellTargetGuid; + if (arrivalCast) + { + arrivalSpellId = arrivalCast->SpellId; + arrivalSpellTargetGuid = arrivalCast->Target; + } + Mutate(new EffectMovementGenerator(id, arrivalSpellId, arrivalSpellTargetGuid), MOTION_SLOT_CONTROLLED); } |