Ejemplo n.º 1
0
void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ)
{
    //this function may make players fall below map
    if (_owner->GetTypeId() == TYPEID_PLAYER)
        return;

    float x, y, z;

    //npcbot
    if (_owner->GetTypeId() == TYPEID_UNIT && _owner->ToCreature()->IsNPCBot())
    {
        Movement::MoveSplineInit init(_owner);
        init.MoveTo(x, y, z);
        init.SetParabolic(speedZ/*max_height*/, 0);
        init.SetOrientationFixed(true);
        init.SetVelocity(speedXY);
        init.Launch();
        Mutate(new EffectMovementGenerator(0), MOTION_SLOT_CONTROLLED);
        return;
    }
    //end npcbot

    float moveTimeHalf = speedZ / Movement::gravity;
    float dist = 2 * moveTimeHalf * speedXY;
    _owner->GetClosePoint(x, y, z, _owner->GetObjectSize(), dist, angle);
    MoveJump(x, y, z, speedXY, speedZ);
}
Ejemplo n.º 2
0
void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ) {
	//this function may make players fall below map
	if (i_owner->GetTypeId() == TYPEID_PLAYER)
		return;

	float x, y, z;
	float dist = speedXY * speedZ * 0.1f;
	i_owner->GetClosePoint(x, y, z, i_owner->GetObjectSize(), dist, angle);
	MoveJump(x, y, z, speedXY, speedZ);
}
Ejemplo n.º 3
0
void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ)
{
    //this function may make players fall below map
    if (i_owner->GetTypeId() == TYPEID_PLAYER)
        return;

    float x, y, z;
    float dist = speedXY * speedZ * 0.1f;
    i_owner->GetNearPoint(i_owner, x, y, z, i_owner->GetObjectSize(), dist, i_owner->GetAngle(srcX, srcY) + M_PI);
    MoveJump(x, y, z, speedXY, speedZ);
}
Ejemplo n.º 4
0
void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ)
{
    //this function may make players fall below map
    if (_owner->GetTypeId() == TYPEID_PLAYER)
        return;

    float x, y, z;

    float moveTimeHalf = speedZ / Movement::gravity;
    float dist = 2 * moveTimeHalf * speedXY;
    _owner->GetClosePoint(x, y, z, _owner->GetObjectSize(), dist, angle);
    MoveJump(x, y, z, speedXY, speedZ);
}
Ejemplo n.º 5
0
void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ)
{
    //this function may make players fall below map
    if (_owner->GetTypeId() == TYPEID_PLAYER)
        return;

    float x, y, z;
    float moveTimeHalf = speedZ / Movement::gravity;
    float dist = 2 * moveTimeHalf * speedXY;

    _owner->GetNearPoint(_owner, x, y, z, _owner->GetObjectSize(), dist, _owner->GetAngle(srcX, srcY) + M_PI);
    MoveJump(x, y, z, speedXY, speedZ);
}
Ejemplo n.º 6
0
void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ)
{
    // this function may make players fall below map
    if (_owner->GetTypeId() == TYPEID_PLAYER)
        return;

    float x, y, z = _owner->GetPositionZ();

    float moveTimeHalf = speedZ / Movement::gravity;
    float dist = 2 * moveTimeHalf * speedXY;

    _owner->GetNearPoint2D(nullptr, x, y, dist, _owner->GetOrientation() + angle);
    _owner->UpdateAllowedPositionZ(x, y, z);

    MoveJump(x, y, z, 0.0f, speedXY, speedZ);
}
Ejemplo n.º 7
0
void MotionMaster::MoveJump(Position const& pos, float speedXY, float speedZ, uint32 id/* = EVENT_JUMP*/, bool hasOrientation/* = false*/)
{
    MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), speedXY, speedZ, id, hasOrientation);
}