Exemplo n.º 1
1
        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);
            }
        }
Exemplo n.º 2
0
 public WeatherPacket(PacketReader reader)
     : base(0x65, "Set Weather")
 {
     _weatherType = reader.ReadByte();
     _effectId = reader.ReadByte();
     _temperature = reader.ReadByte();
 }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
 public TimePacket(PacketReader reader)
     : base(0x5B, "Time")
 {
     _hour = reader.ReadByte();
     _minute = reader.ReadByte();
     _second = reader.ReadByte();
 }
Exemplo n.º 5
0
 public TargetCursorPacket(PacketReader reader)
     : base(0x6C, "Target Cursor")
 {
     _commandtype = reader.ReadByte(); // 0x00 = Select Object; 0x01 = Select X, Y, Z
     _cursorid = reader.ReadInt32();
     _cursortype = reader.ReadByte(); // 0 - 2 = unknown; 3 = Cancel current targetting RunUO seems to always send 0.
 }
Exemplo n.º 6
0
 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();
 }
Exemplo n.º 7
0
        public WarModePacket(PacketReader reader)
            : base(0x72, "Request War Mode")
        {
            _warmode = reader.ReadByte();

            reader.ReadByte(); // always 0x00
            reader.ReadByte(); // always 0x32
            reader.ReadByte(); // always 0x00
        }
Exemplo n.º 8
0
 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();
 }
Exemplo n.º 9
0
 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();
 }
Exemplo n.º 10
0
 // 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();
 }
Exemplo n.º 11
0
 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();
 }
Exemplo n.º 12
0
 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();
 }
Exemplo n.º 13
0
 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();
 }
Exemplo n.º 14
0
 public MessageLocalizedAffixPacket(PacketReader reader)
     : base(0xCC, "Message Localized Affix")
 {
     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();
     flags = reader.ReadByte();
     SpeakerName = reader.ReadString(30);
     Affix = reader.ReadStringSafe();
     Arguements = reader.ReadUnicodeStringSafeReverse();
 }
Exemplo n.º 15
0
        public VendorBuyListPacket(PacketReader reader)
            : base(0x74, "Open Buy Window")
        {
            _vendorPackSerial = reader.ReadInt32();
            _itemCount = reader.ReadByte();
            _prices = new int[_itemCount];
            _descriptions = new string[_itemCount];

            for (int i = 0; i < this._itemCount; i++)
            {
                _prices[i] = reader.ReadInt32();
                int descriptionLegnth = reader.ReadByte();
                _descriptions[i] = reader.ReadString(descriptionLegnth);
            }
        }
Exemplo n.º 16
0
 public ChatPacket(PacketReader reader)
     : base(0xB3, "Chat Packet")
 {
     _language = reader.ReadString(3);
     reader.ReadInt16(); // unknown.
     _commandtype = reader.ReadByte();
 }
Exemplo n.º 17
0
 public SwingPacket(PacketReader reader)
     : base(0x2F, "Swing")
 {
     _flag = reader.ReadByte();
     _attacker = reader.ReadInt32();
     _defender = reader.ReadInt32();
 }
Exemplo n.º 18
0
        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();
            }
        }
Exemplo n.º 19
0
 public DragEffectPacket(PacketReader reader)
     : base(0x23, "Dragging Item")
 {
     _itemId = reader.ReadUInt16();
     reader.ReadByte(); // 0x03 bytes unknown.
     reader.ReadByte(); //
     reader.ReadByte(); //
     _amount = reader.ReadUInt16();
     _sourceContainer = reader.ReadInt32(); // 0xFFFFFFFF for ground
     _sourceX = reader.ReadUInt16();
     _sourceY = reader.ReadUInt16();
     _sourceZ = reader.ReadByte();
     _destContainer = reader.ReadInt32(); // 0xFFFFFFFF for ground
     _destX = reader.ReadUInt16();
     _destY = reader.ReadUInt16();
     _destZ = reader.ReadByte();
 }
Exemplo n.º 20
0
        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);
        }
Exemplo n.º 21
0
 public SendSkillsPacket(PacketReader reader)
     : base(0x3A, "Send Skills List")
 {
     PacketType = reader.ReadByte();
     bool hasSkillCap = (PacketType == 0x02 || PacketType == 0xDF);
     int numSkills = (reader.Size - reader.Index - (PacketType == 0x00 ? 2 : 0)) / (hasSkillCap ? 9 : 7);
     Skills = new SendSkillsPacket_SkillEntry[numSkills];
     for (int i = 0; i < numSkills; i++)
     {
         Skills[i] = new SendSkillsPacket_SkillEntry(reader.ReadUInt16(), reader.ReadUInt16(), reader.ReadUInt16(), reader.ReadByte());
         if (hasSkillCap)
             Skills[i].SetSkillCap(reader.ReadUInt16());
     }
     // 0x00: Full List of skills
     // 0xFF: Single skill update
     // 0x02: Full List of skills with skill cap for each skill
     // 0xDF: Single skill update with skill cap for skill
 }
Exemplo n.º 22
0
        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();
            }
        }
Exemplo n.º 23
0
 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();
 }
Exemplo n.º 24
0
        public CharacterCityListPacket(PacketReader reader)
            : base(0xA9, "Char/City List")
        {
            int characterCount = reader.ReadByte();
            _characters = new CharacterListEntry[characterCount];

            for (int i = 0; i < characterCount; i++)
            {
                _characters[i] = new CharacterListEntry(reader);
            }

            int locationCount = reader.ReadByte();
            _locations = new StartingLocation[locationCount];

            for (int i = 0; i < locationCount; i++)
            {
                _locations[i] = new StartingLocation(reader);
            }
        }
Exemplo n.º 25
0
 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();
 }
Exemplo n.º 26
0
        public CharacterListUpdatePacket(PacketReader reader)
            : base(0x86, "Character List Update")
        {
            // Documented at http://docs.polserver.com/packets/index.php?Packet=0xA8
            int characterCount = reader.ReadByte();
            _characters = new CharacterListEntry[characterCount];

            for (int i = 0; i < characterCount; i++)
            {
                _characters[i] = new CharacterListEntry(reader);
            }
        }
Exemplo n.º 27
0
 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);
 }
Exemplo n.º 28
0
 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();
 }
Exemplo n.º 29
0
        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();
        }
Exemplo n.º 30
0
        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); ;
            }
        }