Skip to content

Commit

Permalink
Merge pull request #7212 from Pesthuf/master
Browse files Browse the repository at this point in the history
NPC knockback visual
  • Loading branch information
kaelima committed Jul 28, 2012
2 parents bf22bc1 + 5acae32 commit 41da3fe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/server/game/Movement/MotionMaster.cpp
Expand Up @@ -335,9 +335,17 @@ void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, floa
float x, y, z;
float moveTimeHalf = speedZ / Movement::gravity;
float dist = 2 * moveTimeHalf * speedXY;
float max_height = -Movement::computeFallElevation(moveTimeHalf,false,-speedZ);

_owner->GetNearPoint(_owner, x, y, z, _owner->GetObjectSize(), dist, _owner->GetAngle(srcX, srcY) + M_PI);
MoveJump(x, y, z, speedXY, speedZ);

Movement::MoveSplineInit init(*_owner);
init.MoveTo(x,y,z);
init.SetParabolic(max_height,0);
init.SetOrientationFixed(true);
init.SetVelocity(speedXY);
init.Launch();
Mutate(new EffectMovementGenerator(0), MOTION_SLOT_CONTROLLED);
}

void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ)
Expand Down

0 comments on commit 41da3fe

Please sign in to comment.