Core/Movement: Defined and implemented new spline flag - JumpOrientationFixed
Port From (https://github.com/TrinityCore/TrinityCore/commit/bd9fb4a56303e2bd8046e77d425250b9757aa74c)
This commit is contained in:
@@ -771,12 +771,12 @@ namespace Game.Movement
|
||||
MoveJump(x, y, z, speedXY, speedZ);
|
||||
}
|
||||
|
||||
public void MoveJump(Position pos, float speedXY, float speedZ, uint id = EventId.Jump, object facing = null, JumpArrivalCastArgs arrivalCast = null, SpellEffectExtraData spellEffectExtraData = null, ActionResultSetter<MovementStopReason> scriptResult = null)
|
||||
public void MoveJump(Position pos, float speedXY, float speedZ, uint id = EventId.Jump, object facing = null, bool orientationFixed = false, JumpArrivalCastArgs arrivalCast = null, SpellEffectExtraData spellEffectExtraData = null, ActionResultSetter<MovementStopReason> scriptResult = null)
|
||||
{
|
||||
MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), speedXY, speedZ, id, facing, arrivalCast, spellEffectExtraData, scriptResult);
|
||||
MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), speedXY, speedZ, id, facing, orientationFixed, arrivalCast, spellEffectExtraData, scriptResult);
|
||||
}
|
||||
|
||||
public void MoveJump(float x, float y, float z, float speedXY, float speedZ, uint id = EventId.Jump, object facing = null, JumpArrivalCastArgs arrivalCast = null, SpellEffectExtraData spellEffectExtraData = null, ActionResultSetter<MovementStopReason> scriptResult = null)
|
||||
public void MoveJump(float x, float y, float z, float speedXY, float speedZ, uint id = EventId.Jump, object facing = null, bool orientationFixed = false, JumpArrivalCastArgs arrivalCast = null, SpellEffectExtraData spellEffectExtraData = null, ActionResultSetter<MovementStopReason> scriptResult = null)
|
||||
{
|
||||
Log.outDebug(LogFilter.Server, "Unit ({0}) jump to point (X: {1} Y: {2} Z: {3})", _owner.GetGUID().ToString(), x, y, z);
|
||||
if (speedXY < 0.01f)
|
||||
@@ -795,6 +795,7 @@ namespace Game.Movement
|
||||
init.SetParabolic(max_height, 0);
|
||||
init.SetVelocity(speedXY);
|
||||
MoveSplineInitFacingVisitor(init, facing);
|
||||
init.SetJumpOrientationFixed(orientationFixed);
|
||||
if (spellEffectExtraData != null)
|
||||
init.SetSpellEffectExtraData(spellEffectExtraData);
|
||||
};
|
||||
@@ -813,7 +814,7 @@ namespace Game.Movement
|
||||
Add(movement);
|
||||
}
|
||||
|
||||
public void MoveJumpWithGravity(Position pos, float speedXY, float gravity, uint id = EventId.Jump, object facing = null, JumpArrivalCastArgs arrivalCast = null, SpellEffectExtraData spellEffectExtraData = null, ActionResultSetter<MovementStopReason> scriptResult = null)
|
||||
public void MoveJumpWithGravity(Position pos, float speedXY, float gravity, uint id = EventId.Jump, object facing = null, bool orientationFixed = false, JumpArrivalCastArgs arrivalCast = null, SpellEffectExtraData spellEffectExtraData = null, ActionResultSetter<MovementStopReason> scriptResult = null)
|
||||
{
|
||||
Log.outDebug(LogFilter.Movement, $"MotionMaster.MoveJumpWithGravity: '{_owner.GetGUID()}', jumps to point Id: {id} ({pos})");
|
||||
if (speedXY < 0.01f)
|
||||
@@ -831,6 +832,7 @@ namespace Game.Movement
|
||||
init.SetVelocity(speedXY);
|
||||
init.SetUnlimitedSpeed();
|
||||
MoveSplineInitFacingVisitor(init, facing);
|
||||
init.SetJumpOrientationFixed(orientationFixed);
|
||||
if (spellEffectExtraData != null)
|
||||
init.SetSpellEffectExtraData(spellEffectExtraData);
|
||||
};
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace Game.Movement
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!splineflags.HasFlag(MoveSplineFlagEnum.OrientationFixed | MoveSplineFlagEnum.Falling | MoveSplineFlagEnum.Unknown_0x8))
|
||||
if (!splineflags.HasFlag(MoveSplineFlagEnum.OrientationFixed | MoveSplineFlagEnum.Falling | MoveSplineFlagEnum.JumpOrientationFixed))
|
||||
{
|
||||
Vector3 hermite;
|
||||
spline.Evaluate_Derivative(point_Idx, u, out hermite);
|
||||
|
||||
@@ -274,7 +274,7 @@ namespace Game.Movement
|
||||
|
||||
public void SetVelocity(float vel) { args.velocity = vel; args.HasVelocity = true; }
|
||||
|
||||
void SetBackward() { args.flags.SetUnsetFlag(MoveSplineFlagEnum.Backward); }
|
||||
public void SetBackward() { args.flags.SetUnsetFlag(MoveSplineFlagEnum.Backward); }
|
||||
|
||||
public void SetTransportEnter() { args.flags.EnableTransportEnter(); }
|
||||
|
||||
@@ -282,6 +282,8 @@ namespace Game.Movement
|
||||
|
||||
public void SetOrientationFixed(bool enable) { args.flags.SetUnsetFlag(MoveSplineFlagEnum.OrientationFixed, enable); }
|
||||
|
||||
public void SetJumpOrientationFixed(bool enable) { args.flags.SetUnsetFlag(MoveSplineFlagEnum.JumpOrientationFixed, enable); }
|
||||
|
||||
public void SetSteering() { args.flags.EnableSteering(); }
|
||||
|
||||
public void SetUnlimitedSpeed() { args.flags.SetUnsetFlag(MoveSplineFlagEnum.UnlimitedSpeed, true); }
|
||||
|
||||
Reference in New Issue
Block a user