Exemplo n.º 1
0
 public GameMessageMotion(WorldObject animationTarget, Session session, MotionAutonomous activity,
                          MovementTypes type, MotionFlags flags, MotionStance stance, MovementData movement, List <MotionItem> animations = null)
     : this()
 {
     WriteBase(animationTarget, session, activity, type, flags, stance);
     movement?.Serialize(this.Writer);
     if (animations == null)
     {
         this.Writer.Write((ushort)0);
     }
     else
     {
         this.WriteAnimations(animationTarget, animations);
     }
 }
Exemplo n.º 2
0
 private void WriteBase(WorldObject animationTarget, Session session, MotionAutonomous autonomous,
                        MovementTypes type, MotionFlags flags, MotionStance stance)
 {
     Writer.WriteGuid(animationTarget.Guid);                                                  // Object_Id (uint)
     Writer.Write(animationTarget.Sequences.GetCurrentSequence(SequenceType.ObjectInstance)); // Instance_Timestamp
     Writer.Write(animationTarget.Sequences.GetNextSequence(SequenceType.ObjectPosition));    // Movement_Timestamp
     if (autonomous == MotionAutonomous.False)
     {
         Writer.Write(animationTarget.Sequences.GetNextSequence(SequenceType.ObjectServerControl)); // Server_Control_Timestamp
     }
     else
     {
         Writer.Write(animationTarget.Sequences.GetCurrentSequence(SequenceType.ObjectServerControl)); // Server_Control_Timestamp
     }
     Writer.Write((ushort)type);                                                                       // movement_type
     Writer.Write((byte)autonomous);                                                                   // autonomous flag - 1 or 0.   I think this is set if you have are holding the run key or some other autonomous movement
     Writer.Write((byte)flags);                                                                        // these can be or and has sticky object | is long jump mode |
     Writer.Write((ushort)stance);                                                                     // called command in the client
 }