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(); }
// ============================================================ // Ctor, Dispose, Update, and CreateView() // ============================================================ public Mobile(Serial serial, Map map) : base(serial, map) { Equipment = new MobileEquipment(this); m_movement = new MobileMovement(this); m_movement.RequiresUpdate = true; Health = new CurrentMaxValue(); Stamina = new CurrentMaxValue(); Mana = new CurrentMaxValue(); Followers = new CurrentMaxValue(); Weight = new CurrentMaxValue(); Flags = new MobileFlags(); }
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 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(); } }