Core/Movement: add optional velocity argument for MoveLand and MoveTakeoff

Port From (https://github.com/TrinityCore/TrinityCore/commit/eeac4a12f244e7f730f772b4093cc5089dfc6a0c)
This commit is contained in:
hondacrx
2022-05-24 12:47:46 -04:00
parent ba71bd81b4
commit b29c191d99
+8 -3
View File
@@ -621,19 +621,24 @@ namespace Game.Movement
}
}
public void MoveLand(uint id, Position pos)
public void MoveLand(uint id, Position pos, float? velocity = null)
{
MoveSplineInit init = new(_owner);
init.MoveTo(pos, false);
init.SetAnimation(AnimTier.Ground);
if (velocity.HasValue)
init.SetVelocity(velocity.Value);
Add(new GenericMovementGenerator(init, MovementGeneratorType.Effect, id));
}
public void MoveTakeoff(uint id, Position pos)
public void MoveTakeoff(uint id, Position pos, float? velocity = null)
{
MoveSplineInit init = new(_owner);
init.MoveTo(pos);
init.MoveTo(pos, false);
init.SetAnimation(AnimTier.Hover);
if (velocity.HasValue)
init.SetVelocity(velocity.Value);
Add(new GenericMovementGenerator(init, MovementGeneratorType.Effect, id));
}