public ObjectInfoPacket(PacketReader reader) : base(0x1A, "ObjectInfoPacket") { Serial = reader.ReadInt32(); ItemID = reader.ReadUInt16(); Amount = (ushort)(((Serial & 0x80000000) == 0x80000000) ? reader.ReadUInt16() : 0); X = reader.ReadInt16(); Y = reader.ReadInt16(); Direction = (byte)(((X & 0x8000) == 0x8000) ? reader.ReadByte() : 0); Z = reader.ReadSByte(); Hue = (ushort)(((Y & 0x8000) == 0x8000) ? reader.ReadUInt16() : 0); Flags = (byte)(((Y & 0x4000) == 0x4000) ? reader.ReadByte() : 0); // sanitize values Serial = (int)(Serial & 0x7FFFFFFF); ItemID = (ushort)(ItemID & 0x7FFF); X = (short)(X & 0x7FFF); Y = (short)(Y & 0x3FFF); }
public MovementRejectPacket(PacketReader reader) : base(0x21, "Move Request Rejected") { m_sequence = reader.ReadByte(); // (matches sent sequence) m_x = reader.ReadInt16(); m_y = reader.ReadInt16(); m_direction = reader.ReadByte(); m_z = reader.ReadSByte(); }
public MobileMovingPacket(PacketReader reader) : base(0x77, "Mobile Moving") { this.serial = reader.ReadInt32(); this.bodyid = reader.ReadUInt16(); this.x = reader.ReadInt16(); this.y = reader.ReadInt16(); this.z = reader.ReadSByte(); this.direction = reader.ReadByte(); this.hue = reader.ReadUInt16(); this.Flags = new MobileFlags(reader.ReadByte()); this.notoriety = reader.ReadByte(); }
public MobileMovingPacket(PacketReader reader) : base(0x77, "Mobile Moving") { serial = reader.ReadInt32(); bodyid = reader.ReadUInt16(); x = reader.ReadInt16(); y = reader.ReadInt16(); z = reader.ReadSByte(); direction = reader.ReadByte(); hue = reader.ReadUInt16(); Flags = new MobileFlags((MobileFlag)reader.ReadByte()); notoriety = reader.ReadByte(); }
public MobileUpdatePacket(PacketReader reader) : base(0x20, "Mobile Update") { m_serial = reader.ReadInt32(); m_body = reader.ReadInt16(); reader.ReadByte(); // Always 0 m_hue = reader.ReadUInt16(); // Skin hue m_flags = new MobileFlags((MobileFlag)reader.ReadByte()); m_x = reader.ReadInt16(); m_y = reader.ReadInt16(); reader.ReadInt16(); // Always 0 m_direction = reader.ReadByte(); m_z = reader.ReadSByte(); }
public WorldItemPacket(PacketReader reader) : base(0x1A, "ObjectInfo") { Serial serial = reader.ReadInt32(); ushort itemId = reader.ReadUInt16(); m_amount = 0; if ((serial & 0x80000000) == 0x80000000) { m_amount = reader.ReadInt16(); } // Doesn't exist this thing in the packet /*byte iIncrement = 0; if ((iItemID & 0x8000) == 0x8000) { iIncrement = reader.ReadByte(); iObjectSerial += iIncrement; }*/ ushort x = reader.ReadUInt16(); ushort y = reader.ReadUInt16(); m_direction = 0; if ((x & 0x8000) == 0x8000) m_direction = reader.ReadByte(); m_z = reader.ReadSByte(); m_hue = 0; if ((y & 0x8000) == 0x8000) m_hue = reader.ReadUInt16(); m_flags = 0; if ((y & 0x4000) == 0x4000) m_flags = reader.ReadByte(); m_serial = (int)(serial &= 0x7FFFFFFF); m_itemid = (short)(itemId &= 0x7FFF); m_x = (short)(x &= 0x7FFF); m_y = (short)(y &= 0x3FFF); }
public MobileIncomingPacket(PacketReader reader) : base(0x78, "Mobile Incoming") { // Mobile m_serial = reader.ReadInt32(); m_body = reader.ReadInt16(); m_x = reader.ReadInt16(); m_y = reader.ReadInt16(); m_z = reader.ReadSByte(); m_direction = reader.ReadByte(); m_hue = reader.ReadUInt16(); Flags = new MobileFlags((MobileFlag)reader.ReadByte()); m_notoriety = reader.ReadByte(); // Read equipment - nine bytes ea. List<EquipmentEntry> items = new List<EquipmentEntry>(); Serial serial = reader.ReadInt32(); if (!serial.IsValid) { reader.ReadByte(); //zero terminated m_equipment = new EquipmentEntry[0]; } else { while (serial.IsValid) { ushort gumpId = reader.ReadUInt16(); byte layer = reader.ReadByte(); ushort hue = 0; if ((gumpId & 0x8000) == 0x8000) { gumpId = (ushort)((int)gumpId - 0x8000); hue = reader.ReadUInt16(); } items.Add(new EquipmentEntry(serial, gumpId, layer, hue)); // read the next serial and begin the loop again. break at 0x00000000 serial = reader.ReadInt32(); } m_equipment = items.ToArray(); } }
public ObjectInfoPacketNew(PacketReader reader) : base(0xF3, "ObjectInfoPacketNew") { reader.ReadInt16(); Type = reader.ReadByte(); Serial = reader.ReadInt32(); ItemID = reader.ReadUInt16(); Direction = (byte)reader.ReadByte(); Amount = reader.ReadUInt16(); Amount = reader.ReadUInt16(); X = reader.ReadInt16(); Y = reader.ReadInt16(); Z = reader.ReadSByte(); Layer = reader.ReadByte(); Hue = reader.ReadUInt16(); Flags = reader.ReadByte(); reader.ReadUInt16(); }
public WorldItemPacket(PacketReader reader) : base(0x1A, "ObjectInfo") { Serial serial = reader.ReadInt32(); ushort itemId = reader.ReadUInt16(); m_amount = 0; if ((serial & 0x80000000) == 0x80000000) { m_amount = reader.ReadInt16(); } ushort x = reader.ReadUInt16(); ushort y = reader.ReadUInt16(); m_direction = 0; if ((x & 0x8000) == 0x8000) m_direction = reader.ReadByte(); m_z = reader.ReadSByte(); m_hue = 0; if ((y & 0x8000) == 0x8000) m_hue = reader.ReadUInt16(); m_flags = 0; if ((y & 0x4000) == 0x4000) m_flags = reader.ReadByte(); m_serial = (int)(serial &= 0x7FFFFFFF); m_itemid = (short)(itemId &= 0x7FFF); m_x = (short)(x &= 0x7FFF); m_y = (short)(y &= 0x3FFF); }