Core/Movement: Migrate scripts using GetMotionMaster()->MoveSmoothPath to GetMotionMaster()->MovePath and kill it (they now have the same capabilities)
Port From (https://github.com/TrinityCore/TrinityCore/commit/dad976beb4f1a865e5df5d6f03da1d00d266e1fc)
This commit is contained in:
@@ -906,26 +906,6 @@ namespace Game.Movement
|
|||||||
Add(new GenericMovementGenerator(initializer, MovementGeneratorType.Effect, 0, new GenericMovementGeneratorArgs() { Duration = duration, ScriptResult = scriptResult }));
|
Add(new GenericMovementGenerator(initializer, MovementGeneratorType.Effect, 0, new GenericMovementGeneratorArgs() { Duration = duration, ScriptResult = scriptResult }));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MoveSmoothPath(uint pointId, Vector3[] pathPoints, int pathSize, bool walk = false, bool fly = false)
|
|
||||||
{
|
|
||||||
var initializer = (MoveSplineInit init) =>
|
|
||||||
{
|
|
||||||
init.MovebyPath(pathPoints);
|
|
||||||
init.SetWalk(walk);
|
|
||||||
if (fly)
|
|
||||||
{
|
|
||||||
init.SetFly();
|
|
||||||
init.SetUncompressed();
|
|
||||||
init.SetSmooth();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// This code is not correct
|
|
||||||
// GenericMovementGenerator does not affect UNIT_STATE_ROAMING_MOVE
|
|
||||||
// need to call PointMovementGenerator with various pointIds
|
|
||||||
Add(new GenericMovementGenerator(initializer, MovementGeneratorType.Effect, pointId));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void MoveAlongSplineChain(uint pointId, uint dbChainId, bool walk)
|
public void MoveAlongSplineChain(uint pointId, uint dbChainId, bool walk)
|
||||||
{
|
{
|
||||||
Creature owner = _owner.ToCreature();
|
Creature owner = _owner.ToCreature();
|
||||||
|
|||||||
@@ -90,9 +90,6 @@ namespace Game.Movement
|
|||||||
|
|
||||||
if (path.Count > 2)
|
if (path.Count > 2)
|
||||||
{
|
{
|
||||||
if ((path[2] - path[1]).Length() < 0.1f)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
Vector3 middle = (path.First() + path.Last()) / 2;
|
Vector3 middle = (path.First() + path.Last()) / 2;
|
||||||
for (int i = 1; i < path.Count - 1; ++i)
|
for (int i = 1; i < path.Count - 1; ++i)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -342,10 +342,12 @@ namespace Game
|
|||||||
public float? Velocity;
|
public float? Velocity;
|
||||||
|
|
||||||
public WaypointPath() { }
|
public WaypointPath() { }
|
||||||
public WaypointPath(uint id, List<WaypointNode> nodes)
|
public WaypointPath(uint id, List<WaypointNode> nodes, WaypointMoveType moveType = WaypointMoveType.Walk, WaypointPathFlags flags = WaypointPathFlags.None)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
Nodes = nodes;
|
Nodes = nodes;
|
||||||
|
Flags = flags;
|
||||||
|
MoveType = moveType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BuildSegments()
|
public void BuildSegments()
|
||||||
@@ -390,6 +392,8 @@ namespace Game
|
|||||||
{
|
{
|
||||||
None = 0x00,
|
None = 0x00,
|
||||||
FollowPathBackwardsFromEndToStart = 0x01,
|
FollowPathBackwardsFromEndToStart = 0x01,
|
||||||
ExactSplinePath = 0x02
|
ExactSplinePath = 0x02,
|
||||||
|
|
||||||
|
FlyingPath = ExactSplinePath // flying paths are always exact splines
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user