public CustomHousePacket(PacketReader reader) : base(0xD8, "Custom House Packet") { byte CompressionType = reader.ReadByte(); if (CompressionType != 3) { _houseSerial = Serial.Null; return; } reader.ReadByte(); // unknown, always 0? _houseSerial = reader.ReadInt32(); _revisionHash = reader.ReadInt32(); // this is for compression type 3 only int bufferLength = reader.ReadInt16(); int trueBufferLength = reader.ReadInt16(); _numPlanes = reader.ReadByte(); // end compression type 3 _planes = new CustomHousePlane[_numPlanes]; for (int i = 0; i < _numPlanes; i++) { _planes[i] = new CustomHousePlane(reader); } }
public ObjectPropertyListPacket(PacketReader reader) : base(0xD6, "Object Property List") { reader.ReadInt16(); // Always 0x0001 _serial = reader.ReadInt32(); reader.ReadInt16(); // Always 0x0000 _hash = reader.ReadInt32(); _clilocs = new List<int>(); _arguments = new List<string>(); // Loop of all the item/creature's properties to display in the order to display them. The name is always the first entry. int clilocId = reader.ReadInt32(); while (clilocId != 0) { _clilocs.Add(clilocId); int textLength = reader.ReadUInt16(); string args = string.Empty; if (textLength > 0) { args = reader.ReadUnicodeStringReverse(textLength / 2); } _arguments.Add(args); clilocId = reader.ReadInt32(); } }
public ContainerContentPacket(PacketReader reader) : base(0x3C, "Container ContentPacket") { int itemCount = reader.ReadUInt16(); List<ContentItem> items = new List<ContentItem>(itemCount); for (int i = 0; i < itemCount; i++) { Serial serial = reader.ReadInt32(); int iItemID = reader.ReadUInt16(); int iUnknown = reader.ReadByte(); // signed, itemID offset. always 0 in RunUO. int iAmount = reader.ReadUInt16(); int iX = reader.ReadInt16(); int iY = reader.ReadInt16(); int iGridLocation = 0; if (!NextContainerContentsIsPre6017) iGridLocation = reader.ReadByte(); // always 0 in RunUO. int iContainerSerial = reader.ReadInt32(); int iHue = reader.ReadUInt16(); items.Add(new ContentItem(serial, iItemID, iAmount, iX, iY, iGridLocation, iContainerSerial, iHue)); } _items = items.ToArray(); if (NextContainerContentsIsPre6017) NextContainerContentsIsPre6017 = false; }
public UpdateStaminaPacket(PacketReader reader) : base(0xA3, "Update Stamina") { _serial = reader.ReadInt32(); _max = reader.ReadInt16(); _current = reader.ReadInt16(); }
public UpdateHealthPacket(PacketReader reader) : base(0xA1, "Update Health") { _serial = reader.ReadInt32(); _max = reader.ReadInt16(); _current = reader.ReadInt16(); }
public MovementRejectPacket(PacketReader reader) : base(0x21, "Move Request Rejected") { _sequence = reader.ReadByte(); // (matches sent sequence) _x = reader.ReadInt16(); _y = reader.ReadInt16(); _direction = reader.ReadByte(); _z = reader.ReadSByte(); }
public WornItemPacket(PacketReader reader) : base(0x2E, "Worn Item") { _serial = reader.ReadInt32(); _itemId = reader.ReadInt16(); reader.ReadByte(); _layer = reader.ReadByte(); _parentSerial = reader.ReadInt32(); _hue = reader.ReadInt16(); }
public PlaySoundEffectPacket(PacketReader reader) : base(0x54, "Play Sound Effect") { Mode = reader.ReadByte(); SoundModel = reader.ReadInt16(); Unknown = reader.ReadInt16(); X = reader.ReadInt16(); Y = reader.ReadInt16(); Z = reader.ReadInt16(); }
public MobileAnimationPacket(PacketReader reader) : base(0x6E, "Mobile Animation") { _serial = reader.ReadInt32(); _action = reader.ReadInt16(); _framecount = reader.ReadInt16(); _repeatcount = reader.ReadInt16(); _reverse = reader.ReadByte(); // 0x00=forward, 0x01=backwards _repeat = reader.ReadByte(); // 0 - Don't repeat / 1 repeat _delay = reader.ReadByte(); }
public AsciiMessagePacket(PacketReader reader) : base(0x1C, "Ascii Message") { _serial = reader.ReadInt32(); _graphic = reader.ReadInt16(); _type = (MessageType)reader.ReadByte(); _hue = reader.ReadInt16(); _font = reader.ReadInt16(); _name = reader.ReadString(30); _text = reader.ReadString(); }
public UnicodeMessagePacket(PacketReader reader) : base(0xAE, "Unicode Message") { _serial = reader.ReadInt32(); _model = reader.ReadInt16(); _msgType = (MessageType)reader.ReadByte(); _hue = reader.ReadInt16(); _font = reader.ReadInt16(); _language = reader.ReadInt32(); _speakerName = reader.ReadString(30); _spokenText = reader.ReadUnicodeString((reader.Buffer.Length - 48) / 2); }
// This is called when the packet is received. public TargetCursorMultiPacket(PacketReader reader) : base(0x99, "Target Cursor For Multi") { reader.ReadByte(); // (0x01 from server, 0x00 from client) _deedSerial = reader.ReadInt32(); reader.ReadByte(); // flag byte. Harmful = 1, Beneficial = 2. Unused. reader.ReadBytes(11); // unknown (all 0) _multiModel = reader.ReadInt16(); _offsetX = reader.ReadInt16(); _offsetY = reader.ReadInt16(); _offsetZ = reader.ReadInt16(); }
public MessageLocalizedPacket(PacketReader reader) : base(0xC1, "Message Localized") { Serial = reader.ReadInt32(); // 0xffff for system message Body = reader.ReadInt16(); // (0xff for system message MessageType = (MessageType)reader.ReadByte(); // 6 - lower left, 7 on player Hue = reader.ReadUInt16(); Font = reader.ReadInt16(); CliLocNumber = reader.ReadInt32(); SpeakerName = reader.ReadString(30); Arguements = reader.ReadUnicodeStringSafeReverse(); }
public ContainerContentUpdatePacket(PacketReader reader) : base(0x25, "Add Single Item") { _serial = reader.ReadInt32(); _itemId = reader.ReadUInt16(); reader.ReadByte(); // unknown _amount = reader.ReadUInt16(); _x = reader.ReadInt16(); _y = reader.ReadInt16(); _gridLocation = reader.ReadByte(); // always 0 in RunUO. _parentSerial = (Serial)reader.ReadInt32(); _hue = reader.ReadUInt16(); }
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 LoginConfirmPacket(PacketReader reader) : base(0x1B, "Login Confirm") { _serial = reader.ReadInt32(); reader.ReadInt32();//unknown.. _body = reader.ReadInt16(); _x = reader.ReadInt16(); _y = reader.ReadInt16(); _z = reader.ReadInt16(); _direction = reader.ReadByte(); }
public MobileUpdatePacket(PacketReader reader) : base(0x20, "Mobile Update") { _serial = reader.ReadInt32(); _body = reader.ReadInt16(); reader.ReadByte(); // Always 0 _hue = reader.ReadUInt16(); // Skin hue _flags = new MobileFlags(reader.ReadByte()); _x = reader.ReadInt16(); _y = reader.ReadInt16(); reader.ReadInt16(); // Always 0 _direction = reader.ReadByte(); _z = reader.ReadSByte(); }
public ChatPacket(PacketReader reader) : base(0xB3, "Chat Packet") { _language = reader.ReadString(3); reader.ReadInt16(); // unknown. _commandtype = reader.ReadByte(); }
public ServerRelayPacket(PacketReader reader) : base(0x8C, "Server Relay") { _ipAddress = reader.ReadInt32(); _port = reader.ReadInt16(); _accountId = reader.ReadInt32(); }
public MobileIncomingPacket(PacketReader reader) : base(0x78, "Mobile Incoming") { // Mobile _serial = reader.ReadInt32(); _body = reader.ReadInt16(); _x = reader.ReadInt16(); _y = reader.ReadInt16(); _z = reader.ReadSByte(); _direction = reader.ReadByte(); _hue = reader.ReadUInt16(); this.Flags = new MobileFlags(reader.ReadByte()); _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 _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(); } _equipment = items.ToArray(); } }
public ServerListPacket(PacketReader reader) : base(0xA8, "Server List") { _flags = reader.ReadByte(); ushort count = (ushort)reader.ReadInt16(); _servers = new ServerListEntry[count]; for (ushort i = 0; i < count; i++) { _servers[i] = new ServerListEntry(reader); ; } }
public SubServerPacket(PacketReader reader) : base(0xB3, "Chat Packet") { _x = reader.ReadInt16(); _y = reader.ReadInt16(); _z = reader.ReadInt16(); reader.ReadByte(); reader.ReadInt16(); reader.ReadInt16(); _mapWidth = reader.ReadInt16(); _mapHeight = reader.ReadInt16(); }
public MobileAttributesPacket(PacketReader reader) : base(0x2D, "Mobile Attributes") { _serial = reader.ReadInt32(); _maxHits = reader.ReadInt16(); _currentHits = reader.ReadInt16(); _maxMana = reader.ReadInt16(); _currentMana = reader.ReadInt16(); _maxStamina = reader.ReadInt16(); _currentStamina = reader.ReadInt16(); }
public WorldItemPacket(PacketReader reader) : base(0x1A, "ObjectInfo") { Serial serial = reader.ReadInt32(); ushort itemId = reader.ReadUInt16(); _amount = 0; if ((serial & 0x80000000) == 0x80000000) { _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(); _direction = 0; if ((x & 0x8000) == 0x8000) _direction = reader.ReadByte(); _z = reader.ReadSByte(); _hue = 0; if ((y & 0x8000) == 0x8000) _hue = reader.ReadUInt16(); _flags = 0; if ((y & 0x4000) == 0x4000) _flags = reader.ReadByte(); _serial = (int)(serial &= 0x7FFFFFFF); _itemid = (short)(itemId &= 0x7FFF); _x = (short)(x &= 0x7FFF); _y = (short)(y &= 0x3FFF); }
public GeneralInfoPacket(PacketReader reader) : base(0xBF, "General Information") { this._subcommand = reader.ReadInt16(); switch (this._subcommand) { case 0x06: // party system, not implemented. break; case 0x8: // Set cursor color / set map _mapid = reader.ReadByte(); break; case 0x14: // return context menu receiveContextMenu(reader); break; case 0x18: // Number of maps receiveMapDiffManifest(reader); break; case 0x1D: // House revision receiveHouseRevisionState(reader); break; case 0x04: // Close generic gump // !!! Not implemented yet. break; case 0x19: // Extended stats receiveExtendedStats(reader); break; case 0x21: // (AOS) Ability icon confirm. // no data, just (bf 00 05 00 21) break; default: // do nothing. This unhandled subcommand will raise an error in UltimaClient.cs. break; } }
public GlobalQueuePacket(PacketReader reader) : base(0xCB, "Global Queue") { _unk = reader.ReadByte(); _count = reader.ReadInt16(); }
public DamagePacket(PacketReader reader) : base(0x0B, "Damage") { _serial = reader.ReadInt32(); _damage = reader.ReadInt16(); }
public SupportedFeaturesPacket(PacketReader reader) : base(0xB9, "Enable Features") { _flags = (ushort)reader.ReadInt16(); }
public MobileStatusCompactPacket(PacketReader reader) : base(0x11, "StatusInfo") { _serial = reader.ReadInt32(); _playerName = reader.ReadString(30); _currentHealth = reader.ReadInt16(); _maxHealth = reader.ReadInt16(); _nameChangeFlag = reader.ReadByte(); // 0x1 = allowed, 0 = not allowed _statusTypeFlag = reader.ReadByte(); sex = (Sex)reader.ReadByte(); // 0=male, 1=female _strength = reader.ReadInt16(); _dexterity = reader.ReadInt16(); _intelligence = reader.ReadInt16(); _currentStamina = reader.ReadInt16(); _maxStamina = reader.ReadInt16(); _currentMana = reader.ReadInt16(); _maxMana = reader.ReadInt16(); _goldInInventory = reader.ReadInt32(); _armorRating = reader.ReadInt16(); _weight = reader.ReadInt16(); if (_statusTypeFlag >= 5) { _maxWeight = reader.ReadInt16(); _race = (Race)reader.ReadByte(); } if (_statusTypeFlag >= 3) { _statCap = reader.ReadInt16(); _followers = reader.ReadByte(); _maxFollowers = reader.ReadByte(); } if (_statusTypeFlag >= 4) { _resistFire = reader.ReadInt16(); _resistCold = reader.ReadInt16(); _resistPoison = reader.ReadInt16(); _resistEnergy = reader.ReadInt16(); _luck = reader.ReadInt16(); _dmgMin = reader.ReadInt16(); _dmgMax = reader.ReadInt16(); _tithingPoints = reader.ReadInt16(); } }
public PlayMusicPacket(PacketReader reader) : base(0x6D, "Play Music") { _id = reader.ReadInt16(); }