Exemplo n.º 1
0
        public void MoveFall(uint id = 0)
        {
            // use larger distance for vmap height search than in most other cases
            float tz = _owner.GetMap().GetHeight(_owner.GetPhaseShift(), _owner.GetPositionX(), _owner.GetPositionY(), _owner.GetPositionZ(), true, MapConst.MaxFallDistance);

            if (tz <= MapConst.InvalidHeight)
            {
                return;
            }

            // Abort too if the ground is very near
            if (Math.Abs(_owner.GetPositionZ() - tz) < 0.1f)
            {
                return;
            }

            _owner.SetFall(true);

            // don't run spline movement for players
            if (_owner.IsTypeId(TypeId.Player))
            {
                _owner.ToPlayer().SetFallInformation(0, _owner.GetPositionZ());
                return;
            }

            MoveSplineInit init = new MoveSplineInit(_owner);

            init.MoveTo(_owner.GetPositionX(), _owner.GetPositionY(), tz, false);
            init.SetFall();
            init.Launch();
            StartMovement(new EffectMovementGenerator(id), MovementSlot.Controlled);
        }
Exemplo n.º 2
0
        public void MoveJump(float x, float y, float z, float o, float speedXY, float speedZ, uint id = EventId.Jump, bool hasOrientation = false,
                             JumpArrivalCastArgs arrivalCast = null, SpellEffectExtraData spellEffectExtraData = null)
        {
            Log.outDebug(LogFilter.Server, "Unit ({0}) jump to point (X: {1} Y: {2} Z: {3})", _owner.GetGUID().ToString(), x, y, z);

            float moveTimeHalf = (float)(speedZ / gravity);
            float max_height   = -MoveSpline.computeFallElevation(moveTimeHalf, false, -speedZ);

            MoveSplineInit init = new MoveSplineInit(_owner);

            init.MoveTo(x, y, z, false);
            init.SetParabolic(max_height, 0);
            init.SetVelocity(speedXY);
            if (hasOrientation)
            {
                init.SetFacing(o);
            }
            if (spellEffectExtraData != null)
            {
                init.SetSpellEffectExtraData(spellEffectExtraData);
            }
            init.Launch();

            uint       arrivalSpellId         = 0;
            ObjectGuid arrivalSpellTargetGuid = ObjectGuid.Empty;

            if (arrivalCast != null)
            {
                arrivalSpellId         = arrivalCast.SpellId;
                arrivalSpellTargetGuid = arrivalCast.Target;
            }

            StartMovement(new EffectMovementGenerator(id, arrivalSpellId, arrivalSpellTargetGuid), MovementSlot.Controlled);
        }
Exemplo n.º 3
0
        public void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ, SpellEffectExtraData spellEffectExtraData = null)
        {
            //this function may make players fall below map
            if (_owner.IsTypeId(TypeId.Player))
            {
                return;
            }

            if (speedXY < 0.01f)
            {
                return;
            }

            float x, y, z;
            float moveTimeHalf = (float)(speedZ / gravity);
            float dist         = 2 * moveTimeHalf * speedXY;
            float max_height   = -MoveSpline.ComputeFallElevation(moveTimeHalf, false, -speedZ);

            _owner.GetNearPoint(_owner, out x, out y, out z, _owner.GetObjectSize(), dist, _owner.GetAngle(srcX, srcY) + MathFunctions.PI);

            MoveSplineInit init = new MoveSplineInit(_owner);

            init.MoveTo(x, y, z);
            init.SetParabolic(max_height, 0);
            init.SetOrientationFixed(true);
            init.SetVelocity(speedXY);
            if (spellEffectExtraData != null)
            {
                init.SetSpellEffectExtraData(spellEffectExtraData);
            }

            init.Launch();
            StartMovement(new EffectMovementGenerator(0), MovementSlot.Controlled);
        }
Exemplo n.º 4
0
        public override bool DoUpdate(Creature owner, uint diff)
        {
            if (!owner)
            {
                return(false);
            }

            if (owner.HasUnitState(UnitState.NotMove) || owner.IsMovementPreventedByCasting())
            {
                _interrupt = true;
                owner.StopMoving();
                return(true);
            }

            if ((_interrupt && owner.MoveSpline.Finalized()) || (_recalculateSpeed && !owner.MoveSpline.Finalized()))
            {
                _recalculateSpeed = false;
                _interrupt        = false;

                owner.AddUnitState(UnitState.RoamingMove);

                MoveSplineInit init = new MoveSplineInit(owner);
                init.MoveTo(_destination.GetPositionX(), _destination.GetPositionY(), _destination.GetPositionZ());
                if (_orientation)
                {
                    init.SetFacing(_destination.GetOrientation());
                }

                switch (_moveType)
                {
                case 2:     // WAYPOINT_MOVE_TYPE_LAND
                    init.SetAnimation(AnimType.ToGround);
                    break;

                case 3:     // WAYPOINT_MOVE_TYPE_TAKEOFF
                    init.SetAnimation(AnimType.ToFly);
                    break;

                case 1:     // WAYPOINT_MOVE_TYPE_RUN
                    init.SetWalk(false);
                    break;

                case 0:     // WAYPOINT_MOVE_TYPE_WALK
                    init.SetWalk(true);
                    break;
                }

                if (_run)
                {
                    init.SetWalk(false);
                }
                init.Launch();
            }

            return(!owner.MoveSpline.Finalized());
        }
Exemplo n.º 5
0
        void MoveTakeoff(uint id, Position pos)
        {
            float x, y, z;

            pos.GetPosition(out x, out y, out z);

            MoveSplineInit init = new MoveSplineInit(_owner);

            init.MoveTo(x, y, z);
            init.SetAnimation(AnimType.ToFly);
            init.Launch();
            StartMovement(new EffectMovementGenerator(id), MovementSlot.Active);
        }
Exemplo n.º 6
0
        public override void DoInitialize(T owner)
        {
            if (_movementId == EventId.ChargePrepath)
            {
                owner.AddUnitState(UnitState.Roaming | UnitState.RoamingMove);
                return;
            }

            owner.AddUnitState(UnitState.Roaming);

            if (owner.HasUnitState(UnitState.NotMove) || owner.IsMovementPreventedByCasting())
            {
                _interrupt = true;
                owner.StopMoving();
                return;
            }

            owner.AddUnitState(UnitState.RoamingMove);

            MoveSplineInit init = new MoveSplineInit(owner);

            init.MoveTo(_destination.GetPositionX(), _destination.GetPositionY(), _destination.GetPositionZ(), _generatePath);
            if (_speed > 0.0f)
            {
                init.SetVelocity(_speed);
            }

            if (_faceTarget)
            {
                init.SetFacing(_faceTarget);
            }

            if (_spellEffectExtra != null)
            {
                init.SetSpellEffectExtraData(_spellEffectExtra);
            }

            init.Launch();

            // Call for creature group update
            Creature creature = owner.ToCreature();

            if (creature != null)
            {
                if (creature.GetFormation() != null && creature.GetFormation().GetLeader() == creature)
                {
                    creature.GetFormation().LeaderMoveTo(_destination, _movementId);
                }
            }
        }
Exemplo n.º 7
0
        public override bool DoUpdate(T owner, uint diff)
        {
            if (owner == null)
            {
                return(false);
            }

            if (_movementId == EventId.ChargePrepath)
            {
                return(!owner.MoveSpline.Finalized());
            }

            if (owner.HasUnitState(UnitState.NotMove) || owner.IsMovementPreventedByCasting())
            {
                _interrupt = true;
                owner.StopMoving();
                return(true);
            }

            if ((_interrupt && owner.MoveSpline.Finalized()) || (_recalculateSpeed && !owner.MoveSpline.Finalized()))
            {
                _recalculateSpeed = false;
                _interrupt        = false;

                owner.AddUnitState(UnitState.RoamingMove);

                MoveSplineInit init = new MoveSplineInit(owner);
                init.MoveTo(_destination.GetPositionX(), _destination.GetPositionY(), _destination.GetPositionZ(), _generatePath);
                if (_speed > 0.0f) // Default value for point motion type is 0.0, if 0.0 spline will use GetSpeed on unit
                {
                    init.SetVelocity(_speed);
                }
                init.Launch();

                // Call for creature group update
                Creature creature = owner.ToCreature();
                if (creature != null)
                {
                    if (creature.GetFormation() != null && creature.GetFormation().GetLeader() == creature)
                    {
                        creature.GetFormation().LeaderMoveTo(_destination, _movementId);
                    }
                }
            }

            return(!owner.MoveSpline.Finalized());
        }
Exemplo n.º 8
0
        public override void DoInitialize(Creature owner)
        {
            owner.AddUnitState(UnitState.Roaming);

            if (owner.HasUnitState(UnitState.NotMove) || owner.IsMovementPreventedByCasting())
            {
                _interrupt = true;
                owner.StopMoving();
                return;
            }

            owner.AddUnitState(UnitState.RoamingMove);

            MoveSplineInit init = new MoveSplineInit(owner);

            init.MoveTo(_destination.GetPositionX(), _destination.GetPositionY(), _destination.GetPositionZ());
            if (_orientation)
            {
                init.SetFacing(_destination.GetOrientation());
            }

            switch (_moveType)
            {
            case 2:     // WAYPOINT_MOVE_TYPE_LAND
                init.SetAnimation(AnimType.ToGround);
                break;

            case 3:     // WAYPOINT_MOVE_TYPE_TAKEOFF
                init.SetAnimation(AnimType.ToFly);
                break;

            case 1:     // WAYPOINT_MOVE_TYPE_RUN
                init.SetWalk(false);
                break;

            case 0:     // WAYPOINT_MOVE_TYPE_WALK
                init.SetWalk(true);
                break;
            }

            if (_run)
            {
                init.SetWalk(false);
            }

            init.Launch();
        }
Exemplo n.º 9
0
        public override void DoInitialize(Creature owner)
        {
            owner.AddUnitState(UnitState.Roaming);

            if (owner.HasUnitState(UnitState.NotMove) || owner.IsMovementPreventedByCasting())
            {
                _interrupt = true;
                owner.StopMoving();
                return;
            }

            owner.AddUnitState(UnitState.RoamingMove);

            MoveSplineInit init = new MoveSplineInit(owner);

            init.MoveTo(_destination.GetPositionX(), _destination.GetPositionY(), _destination.GetPositionZ());
            if (_orientation)
            {
                init.SetFacing(_destination.GetOrientation());
            }

            switch (_moveType)
            {
            case WaypointMoveType.Land:
                init.SetAnimation(AnimType.ToGround);
                break;

            case WaypointMoveType.Takeoff:
                init.SetAnimation(AnimType.ToFly);
                break;

            case WaypointMoveType.Run:
                init.SetWalk(false);
                break;

            case WaypointMoveType.Walk:
                init.SetWalk(true);
                break;
            }

            if (_run)
            {
                init.SetWalk(false);
            }

            init.Launch();
        }
Exemplo n.º 10
0
        public override void DoInitialize(T owner)
        {
            if (!owner.IsStopped())
            {
                owner.StopMoving();
            }

            owner.AddUnitState(UnitState.Roaming | UnitState.RoamingMove);

            if (id == EventId.ChargePrepath)
            {
                return;
            }

            MoveSplineInit init = new MoveSplineInit(owner);

            init.MoveTo(i_x, i_y, i_z, m_generatePath);
            if (speed > 0.0f)
            {
                init.SetVelocity(speed);
            }

            if (i_faceTarget)
            {
                init.SetFacing(i_faceTarget);
            }

            if (i_spellEffectExtra != null)
            {
                init.SetSpellEffectExtraData(i_spellEffectExtra);
            }

            init.Launch();

            // Call for creature group update
            Creature creature = owner.ToCreature();

            if (creature != null)
            {
                if (creature.GetFormation() != null && creature.GetFormation().GetLeader() == creature)
                {
                    creature.GetFormation().LeaderMoveTo(i_x, i_y, i_z);
                }
            }
        }
        uint SendPathSpline(Unit me, Span <Vector3> wp)
        {
            int numWp = wp.Length;

            Cypher.Assert(numWp > 1, "Every path must have source & destination");
            MoveSplineInit init = new MoveSplineInit(me);

            if (numWp > 2)
            {
                init.MovebyPath(wp.ToArray());
            }
            else
            {
                init.MoveTo(wp[1], false, true);
            }
            init.SetWalk(_walk);
            return((uint)init.Launch());
        }
Exemplo n.º 12
0
        void MoveCloserAndStop(uint id, Unit target, float distance)
        {
            float distanceToTravel = _owner.GetExactDist2d(target) - distance;

            if (distanceToTravel > 0.0f)
            {
                float angle = _owner.GetAngle(target);
                float destx = _owner.GetPositionX() + distanceToTravel * (float)Math.Cos(angle);
                float desty = _owner.GetPositionY() + distanceToTravel * (float)Math.Sin(angle);
                MovePoint(id, destx, desty, target.GetPositionZ());
            }
            else
            {
                // we are already close enough. We just need to turn toward the target without changing position.
                MoveSplineInit init = new MoveSplineInit(_owner);
                init.MoveTo(_owner.GetPositionX(), _owner.GetPositionY(), _owner.GetPositionZMinusOffset());
                init.SetFacing(target);
                init.Launch();
                StartMovement(new EffectMovementGenerator(id), MovementSlot.Active);
            }
        }
Exemplo n.º 13
0
        public override bool DoUpdate(T owner, uint time_diff)
        {
            if (owner == null)
            {
                return(false);
            }

            if (owner.HasUnitState(UnitState.Root | UnitState.Stunned))
            {
                owner.ClearUnitState(UnitState.RoamingMove);
                return(true);
            }

            owner.AddUnitState(UnitState.RoamingMove);

            if (id != EventId.ChargePrepath && i_recalculateSpeed && !owner.MoveSpline.Finalized())
            {
                i_recalculateSpeed = false;
                MoveSplineInit init = new MoveSplineInit(owner);
                init.MoveTo(i_x, i_y, i_z, m_generatePath);
                if (speed > 0.0f) // Default value for point motion type is 0.0, if 0.0 spline will use GetSpeed on unit
                {
                    init.SetVelocity(speed);
                }
                init.Launch();

                // Call for creature group update
                Creature creature = owner.ToCreature();
                if (creature != null)
                {
                    if (creature.GetFormation() != null && creature.GetFormation().GetLeader() == creature)
                    {
                        creature.GetFormation().LeaderMoveTo(i_x, i_y, i_z);
                    }
                }
            }

            return(!owner.MoveSpline.Finalized());
        }
Exemplo n.º 14
0
        public void _setRandomLocation(Creature creature)
        {
            if (creature.IsMovementPreventedByCasting())
            {
                creature.CastStop();
                return;
            }

            float respX, respY, respZ, respO, destX, destY, destZ, travelDistZ;

            creature.GetHomePosition(out respX, out respY, out respZ, out respO);
            Map map = creature.GetMap();

            bool is_air_ok = creature.CanFly();

            float angle     = (float)(RandomHelper.NextDouble() * MathFunctions.TwoPi);
            float range     = (float)(RandomHelper.NextDouble() * wander_distance);
            float distanceX = (float)(range * Math.Cos(angle));
            float distanceY = (float)(range * Math.Sin(angle));

            destX = respX + distanceX;
            destY = respY + distanceY;

            // prevent invalid coordinates generation
            GridDefines.NormalizeMapCoord(ref destX);
            GridDefines.NormalizeMapCoord(ref destY);

            travelDistZ = range;   // sin^2+cos^2=1, so travelDistZ=range^2; no need for sqrt below

            if (is_air_ok)         // 3D system above ground and above water (flying mode)
            {
                // Limit height change
                float distanceZ = (float)(RandomHelper.NextDouble() * travelDistZ / 2.0f);
                destZ = respZ + distanceZ;
                float levelZ = map.GetWaterOrGroundLevel(creature.GetPhases(), destX, destY, destZ - 2.5f);

                // Problem here, we must fly above the ground and water, not under. Let's try on next tick
                if (levelZ >= destZ)
                {
                    return;
                }
            }
            else                                                    // 2D only
            {
                // 10.0 is the max that vmap high can check (MAX_CAN_FALL_DISTANCE)
                travelDistZ = travelDistZ >= 10.0f ? 10.0f : travelDistZ;

                // The fastest way to get an accurate result 90% of the time.
                // Better result can be obtained like 99% accuracy with a ray light, but the cost is too high and the code is too long.
                destZ = map.GetHeight(creature.GetPhases(), destX, destY, respZ + travelDistZ - 2.0f, false);

                if (Math.Abs(destZ - respZ) > travelDistZ)              // Map check
                {
                    // Vmap Horizontal or above
                    destZ = map.GetHeight(creature.GetPhases(), destX, destY, respZ - 2.0f, true);

                    if (Math.Abs(destZ - respZ) > travelDistZ)
                    {
                        // Vmap Higher
                        destZ = map.GetHeight(creature.GetPhases(), destX, destY, respZ + travelDistZ - 2.0f, true);

                        // let's forget this bad coords where a z cannot be find and retry at next tick
                        if (Math.Abs(destZ - respZ) > travelDistZ)
                        {
                            return;
                        }
                    }
                }
            }

            if (is_air_ok)
            {
                i_nextMoveTime.Reset(0);
            }
            else
            {
                if (RandomHelper.randChance(50))
                {
                    i_nextMoveTime.Reset(RandomHelper.IRand(5000, 10000));
                }
                else
                {
                    i_nextMoveTime.Reset(RandomHelper.IRand(50, 400));
                }
            }

            creature.AddUnitState(UnitState.RoamingMove);

            MoveSplineInit init = new MoveSplineInit(creature);

            init.MoveTo(destX, destY, destZ);
            init.SetWalk(true);
            init.Launch();

            //Call for creature group update
            if (creature.GetFormation() != null && creature.GetFormation().getLeader() == creature)
            {
                creature.GetFormation().LeaderMoveTo(destX, destY, destZ);
            }
        }
Exemplo n.º 15
0
        bool StartMove(Creature creature)
        {
            if (path == null || path.Empty())
            {
                return(false);
            }

            if (Stopped())
            {
                return(true);
            }

            bool transportPath = creature.GetTransport() != null;

            if (isArrivalDone)
            {
                if ((currentNode == path.Count - 1) && !repeating) // If that's our last waypoint
                {
                    WaypointData waypoint = path.LookupByIndex((int)currentNode);

                    float x = waypoint.x;
                    float y = waypoint.y;
                    float z = waypoint.z;
                    float o = creature.GetOrientation();

                    if (!transportPath)
                    {
                        creature.SetHomePosition(x, y, z, o);
                    }
                    else
                    {
                        Transport trans = creature.GetTransport();
                        if (trans)
                        {
                            o -= trans.GetOrientation();
                            creature.SetTransportHomePosition(x, y, z, o);
                            trans.CalculatePassengerPosition(ref x, ref y, ref z, ref o);
                            creature.SetHomePosition(x, y, z, o);
                        }
                        else
                        {
                            transportPath = false;
                        }
                        // else if (vehicle) - this should never happen, vehicle offsets are const
                    }

                    creature.GetMotionMaster().Initialize();
                    return(false);
                }

                currentNode = (uint)((currentNode + 1) % path.Count);
            }

            var node = path.LookupByIndex((int)currentNode);

            isArrivalDone = false;

            creature.AddUnitState(UnitState.RoamingMove);

            Position       formationDest = new Position(node.x, node.y, node.z, (node.orientation != 0 && node.delay != 0) ? node.orientation : 0.0f);
            MoveSplineInit init          = new MoveSplineInit(creature);

            //! If creature is on transport, we assume waypoints set in DB are already transport offsets
            if (transportPath)
            {
                init.DisableTransportPathTransformations();
                ITransport trans = creature.GetDirectTransport();
                if (trans != null)
                {
                    float orientation = formationDest.GetOrientation();
                    trans.CalculatePassengerPosition(ref formationDest.posX, ref formationDest.posY, ref formationDest.posZ, ref orientation);
                    formationDest.SetOrientation(orientation);
                }
            }

            //! Do not use formationDest here, MoveTo requires transport offsets due to DisableTransportPathTransformations() call
            //! but formationDest contains global coordinates
            init.MoveTo(node.x, node.y, node.z);

            //! Accepts angles such as 0.00001 and -0.00001, 0 must be ignored, default value in waypoint table
            if (node.orientation != 0 && node.delay != 0)
            {
                init.SetFacing(node.orientation);
            }

            switch (node.moveType)
            {
            case WaypointMoveType.Land:
                init.SetAnimation(AnimType.ToGround);
                break;

            case WaypointMoveType.Takeoff:
                init.SetAnimation(AnimType.ToFly);
                break;

            case WaypointMoveType.Run:
                init.SetWalk(false);
                break;

            case WaypointMoveType.Walk:
                init.SetWalk(true);
                break;
            }

            init.Launch();

            //Call for creature group update
            if (creature.GetFormation() != null && creature.GetFormation().GetLeader() == creature)
            {
                creature.GetFormation().LeaderMoveTo(formationDest, node.id, (uint)node.moveType, (node.orientation != 0 && node.delay != 0) ? true : false);
            }

            return(true);
        }
Exemplo n.º 16
0
        bool StartMove(Creature creature)
        {
            if (!creature || !creature.IsAlive())
            {
                return(true);
            }

            if (_done || _path == null || _path.nodes.Empty())
            {
                return(true);
            }

            // if the owner is the leader of its formation, check members status
            if (creature.IsFormationLeader() && !creature.IsFormationLeaderMoveAllowed())
            {
                _nextMoveTime.Reset(1000);
                return(true);
            }

            bool transportPath = creature.GetTransport() != null;

            if (_isArrivalDone)
            {
                if ((_currentNode == _path.nodes.Count - 1) && !_repeating) // If that's our last waypoint
                {
                    WaypointNode lastWaypoint = _path.nodes.ElementAt(_currentNode);

                    float x = lastWaypoint.x;
                    float y = lastWaypoint.y;
                    float z = lastWaypoint.z;
                    float o = creature.GetOrientation();

                    if (!transportPath)
                    {
                        creature.SetHomePosition(x, y, z, o);
                    }
                    else
                    {
                        Transport trans = creature.GetTransport();
                        if (trans)
                        {
                            o -= trans.GetOrientation();
                            creature.SetTransportHomePosition(x, y, z, o);
                            trans.CalculatePassengerPosition(ref x, ref y, ref z, ref o);
                            creature.SetHomePosition(x, y, z, o);
                        }
                        else
                        {
                            transportPath = false;
                        }
                        // else if (vehicle) - this should never happen, vehicle offsets are const
                    }
                    _done = true;
                    return(true);
                }

                _currentNode = (_currentNode + 1) % _path.nodes.Count;

                // inform AI
                if (creature.IsAIEnabled)
                {
                    Cypher.Assert(_currentNode < _path.nodes.Count, $"WaypointMovementGenerator.StartMove: tried to reference a node id ({_currentNode}) which is not included in path ({_path.id})");
                    creature.GetAI().WaypointStarted(_path.nodes[(int)_currentNode].id, _path.id);
                }
            }

            WaypointNode waypoint      = _path.nodes.ElementAt(_currentNode);
            Position     formationDest = new Position(waypoint.x, waypoint.y, waypoint.z, (waypoint.orientation != 0 && waypoint.delay != 0) ? waypoint.orientation : 0.0f);

            _isArrivalDone    = false;
            _recalculateSpeed = false;

            creature.AddUnitState(UnitState.RoamingMove);

            MoveSplineInit init = new MoveSplineInit(creature);

            //! If creature is on transport, we assume waypoints set in DB are already transport offsets
            if (transportPath)
            {
                init.DisableTransportPathTransformations();
                ITransport trans = creature.GetDirectTransport();
                if (trans != null)
                {
                    float orientation = formationDest.GetOrientation();
                    trans.CalculatePassengerPosition(ref formationDest.posX, ref formationDest.posY, ref formationDest.posZ, ref orientation);
                    formationDest.SetOrientation(orientation);
                }
            }

            //! Do not use formationDest here, MoveTo requires transport offsets due to DisableTransportPathTransformations() call
            //! but formationDest contains global coordinates
            init.MoveTo(waypoint.x, waypoint.y, waypoint.z);

            //! Accepts angles such as 0.00001 and -0.00001, 0 must be ignored, default value in waypoint table
            if (waypoint.orientation != 0 && waypoint.delay != 0)
            {
                init.SetFacing(waypoint.orientation);
            }

            switch (waypoint.moveType)
            {
            case WaypointMoveType.Land:
                init.SetAnimation(AnimType.ToGround);
                break;

            case WaypointMoveType.Takeoff:
                init.SetAnimation(AnimType.ToFly);
                break;

            case WaypointMoveType.Run:
                init.SetWalk(false);
                break;

            case WaypointMoveType.Walk:
                init.SetWalk(true);
                break;
            }

            init.Launch();

            // inform formation
            creature.SignalFormationMovement(formationDest, waypoint.id, waypoint.moveType, (waypoint.orientation != 0 && waypoint.delay != 0) ? true : false);
            return(true);
        }