예제 #1
0
        public GameMessageMotion(Entity.WorldObject animationTarget, Session session, MotionCommand command, float speed = 1.0f)
            : this()
        {
            WriteBase(animationTarget, session, MotionAutonomous.False, MovementTypes.Invalid, MotionFlags.None, MotionStance.Standing);
            List <MotionItem> animations = new List <MotionItem>()
            {
                new MotionItem(command, speed)
            };

            WriteAnimations(animationTarget, animations);
        }
예제 #2
0
        public GameMessageMotion(Entity.WorldObject animationTarget, Session session, MotionCommand command, float speed = 1.0f)
            : this()
        {
            WriteBase(animationTarget, session, MotionActivity.Idle, MotionType.General, MotionFlags.None, MotionStance.Standing);
            List <MotionItem> animations = new List <MotionItem>()
            {
                new MotionItem(command, speed)
            };

            WriteAnimations(animationTarget, animations);
        }
예제 #3
0
        private void WriteAnimations(Entity.WorldObject animationTarget, List <MotionItem> items)
        {
            uint generalFlags = (uint)items.Count << 7;

            Writer.Write((uint)generalFlags);
            foreach (var item in items)
            {
                Writer.Write((ushort)item.Motion);
                Writer.Write(animationTarget.Sequences.GetNextSequence(Sequence.SequenceType.Motion));
                Writer.Write(item.Speed);
            }
        }
예제 #4
0
 private void WriteBase(Entity.WorldObject animationTarget, Session session, MotionActivity activity,
                        MotionType type, MotionFlags flags, MotionStance stance)
 {
     Writer.WriteGuid(animationTarget.Guid);
     Writer.Write((ushort)session.Player.TotalLogins);
     Writer.Write(animationTarget.Sequences.GetNextSequence(Sequence.SequenceType.MotionMessage));
     Writer.Write((ushort)1); // Index, needs more research, it changes sometimes, but not every packet
     Writer.Write((ushort)activity);
     Writer.Write((byte)type);
     Writer.Write((byte)flags);
     Writer.Write((ushort)stance);
 }
예제 #5
0
        public GameMessageMotion(Entity.WorldObject animationTarget, Session session, MotionActivity activity,
                                 MotionType type, MotionFlags flags, MotionStance stance, MotionCommand command, float speed)
            : this()
        {
            WriteBase(animationTarget, session, activity, type, flags, stance);
            List <MotionItem> animations = new List <MotionItem>()
            {
                new MotionItem(command, speed)
            };

            WriteAnimations(animationTarget, animations);
        }