//TODO: Validate
 /// <inheritdoc />
 public MovementBlockData(ObjectUpdateFlags updateFlags, MovementInfo moveInfo,
                          float[] movementSpeeds, SplineInfo splineInformation, CorpseInfo deadMovementInformation,
                          StationaryMovementInfo stationaryObjectMovementInformation, int unk1,
                          uint lowGuid, PackedGuid target, uint unknownTransportTimer, VehicleMovementInfo vehicleMovementInformation, long packedRotationQuat)
 {
     UpdateFlags                         = updateFlags;
     MoveInfo                            = moveInfo;
     MovementSpeeds                      = movementSpeeds;
     SplineInformation                   = splineInformation;
     DeadMovementInformation             = deadMovementInformation;
     StationaryObjectMovementInformation = stationaryObjectMovementInformation;
     Unk1    = unk1;
     LowGuid = lowGuid;
     Target  = target;
     UnknownTransportTimer      = unknownTransportTimer;
     VehicleMovementInformation = vehicleMovementInformation;
     UpdatePackedQuaternion     = packedRotationQuat;
 }
Beispiel #2
0
        /// <inheritdoc />
        public MovementBlockData Convert(MovementBlockData_Vanilla fromObj)
        {
            if (fromObj == null)
            {
                return(null);
            }

            ObjectUpdateFlags flags = ObjectUpdateFlagsConverter.Convert(fromObj.UpdateFlags);

            //Should be null if the object isn't living.
            MovementInfo info = MoveInfoConverter.Convert(fromObj.MoveInfo);

            SplineInfo spline     = SplineInfoConverter.Convert(fromObj.SplineInformation);
            CorpseInfo corpseInfo = CorpseInfoConverter.Convert(fromObj.DeadMovementInformation);

            MovementBlockData data = new MovementBlockData(flags, info, fromObj.MovementSpeeds?.Concat(Enumerable.Repeat(1.0f, 3))?.ToArray(), spline, corpseInfo, null,
                                                           /*TC always sends 0 but we can try this*/ (int)fromObj.HighGuid, /*Mangos always sends for UPDATE_ALL 0x10 AKA LOW_GUID. We can try TC hack if this doesn't work*/ 0x1,
                                                           /*This is target*/ flags.HasFlag(ObjectUpdateFlags.UPDATEFLAG_HAS_TARGET) ? fromObj.FullGuid : PackedGuid.Empty, fromObj.TransportTime, null, /*This is a packed QUATERRION but Vanilla doesn't send anything. TODO compute this*/ 0);

            return(data);
        }