public virtual byte[] Serialize() { Packets.PacketWriter writer = new Packets.PacketWriter(); writer.WriteUShort(this.GraphicID); writer.WriteUShort(this.LocationX); writer.WriteUShort(this.LocationY); writer.WriteUShort(this.LocationZ); return(writer.ToArray()); }
public void MoveTo(short x, short y, short facing = 2) { Packets.PacketWriter w = new Packets.PacketWriter(0x2A); w.WriteUInt32(0x00); // accountid to send to replaced in roommove w.WriteUInt32(0x00); w.WriteUInt32(this.Body.GameID); w.WriteUInt32(this.Body.Location.CurrentRoom.RoomID); w.WriteByte(0x00); w.WriteShort(x); w.WriteShort(y); w.WriteByte(0x00); w.WriteShort(x); w.WriteShort(y); // stop packet no facing //w.WriteShort(0x02); w.WriteByte(0xFF); byte[] move = w.ToArray(); if (this.Body.Location.CurrentRoom.PlayerCount != 0) // no need to send to a room noone is in. { this.Body.Location.CurrentRoom.SendMovePacket(move); } }