Ejemplo n.º 1
1
 public SwingPacket(PacketReader reader)
     : base(0x2F, "Swing")
 {
     m_flag = reader.ReadByte();
     m_attacker = reader.ReadInt32();
     m_defender = reader.ReadInt32();
 }
        public ObjectPropertyListPacket(PacketReader reader)
            : base(0xD6, "Object Property List")
        {
            reader.ReadInt16(); // Always 0x0001
            m_serial = reader.ReadInt32();

            reader.ReadInt16(); // Always 0x0000
            m_hash = reader.ReadInt32();

            m_clilocs = new List<int>();
            m_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)
            {
                m_clilocs.Add(clilocId);

                int textLength = reader.ReadUInt16();
                string args = string.Empty;

                if (textLength > 0)
                {
                    args = reader.ReadUnicodeStringReverse(textLength / 2);
                }

                m_arguments.Add(args);

                clilocId = reader.ReadInt32();
            }
        }
Ejemplo n.º 3
1
 public DeathAnimationPacket(PacketReader reader)
     : base(0xAF, "Death Animation")
 {
     PlayerSerial = reader.ReadInt32();
     CorpseSerial = reader.ReadInt32();
     reader.ReadInt32(); // unknown - all zero's.
 }
Ejemplo n.º 4
1
        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);
        }
Ejemplo n.º 5
1
 public UpdateHealthPacket(PacketReader reader)
     : base(0xA1, "Update Health")
 {
     m_serial = reader.ReadInt32();
     m_max = reader.ReadInt16();
     m_current = reader.ReadInt16();
 }
Ejemplo n.º 6
1
 public OpenContainerPacket(PacketReader reader)
     : base(0x24, "Open Container")
 {
     m_serial = reader.ReadInt32();
     m_gumpId = reader.ReadUInt16();
     reader.ReadUInt16();
 }
Ejemplo n.º 7
1
 public UpdateStaminaPacket(PacketReader reader)
     : base(0xA3, "Update Stamina")
 {
     m_serial = reader.ReadInt32();
     m_max = reader.ReadInt16();
     m_current = reader.ReadInt16();
 }
        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));
            }

            m_items = items.ToArray();
            if (NextContainerContentsIsPre6017)
                NextContainerContentsIsPre6017 = false;
        }
Ejemplo n.º 9
0
        public CustomHousePacket(PacketReader reader)
            : base(0xD8, "Custom House Packet")
        {
            byte CompressionType = reader.ReadByte();
            if (CompressionType != 3)
            {
                m_houseSerial = Serial.Null;
                return;
            }
            reader.ReadByte(); // unknown, always 0?
            m_houseSerial = reader.ReadInt32();
            m_revisionHash = reader.ReadInt32();

            // this is for compression type 3 only
            int bufferLength = reader.ReadInt16();
            int trueBufferLength = reader.ReadInt16();
            m_numPlanes = reader.ReadByte();
            // end compression type 3

            m_planes = new CustomHousePlane[m_numPlanes];
            for (int i = 0; i < m_numPlanes; i++)
            {
                m_planes[i] = new CustomHousePlane(reader);
            }
        }
Ejemplo n.º 10
0
 public ServerRelayPacket(PacketReader reader)
     : base(0x8C, "Server Relay")
 {
     m_ipAddress = reader.ReadInt32();
     m_port = reader.ReadInt16();
     m_accountId = reader.ReadInt32();
 }
Ejemplo n.º 11
0
        public ContainerContentPacket(PacketReader reader)
            : base(0x3C, "Container ContentPacket")
        {
            int itemCount = reader.ReadUInt16();
            List<ItemInContainer> items = new List<ItemInContainer>(itemCount);

            bool PacketIsPre6017 = (reader.Buffer.Length == 5 + (19 * 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 (!PacketIsPre6017)
                    iGridLocation = reader.ReadByte(); // always 0 in RunUO.
                int iContainerSerial = reader.ReadInt32();
                int iHue = reader.ReadUInt16();

                items.Add(new ItemInContainer(serial, iItemID, iAmount, iX, iY, iGridLocation, iContainerSerial, iHue));
            }

            m_items = items.ToArray();
        }
Ejemplo n.º 12
0
 public PartyRemoveMemberInfo(PacketReader reader)
 {
     Count = reader.ReadByte();
     RemovedMember = reader.ReadInt32();
     Serials = new int[Count];
     for (int i = 0; i < Count; i++) {
         Serials[i] = reader.ReadInt32();
     }
 }
Ejemplo n.º 13
0
 public MapDiffInfo(PacketReader reader)
 {
     MapCount = reader.ReadInt32();
     MapPatches = new int[MapCount];
     StaticPatches = new int[MapCount];
     for (int i = 0; i < MapCount; i++) {
         StaticPatches[i] = reader.ReadInt32();
         MapPatches[i] = reader.ReadInt32();
     }
 }
Ejemplo n.º 14
0
 public WornItemPacket(PacketReader reader)
     : base(0x2E, "Worn Item")
 {
     m_serial = reader.ReadInt32();
     m_itemId = reader.ReadInt16();
     reader.ReadByte();
     m_layer = reader.ReadByte();
     m_parentSerial = reader.ReadInt32();
     m_hue = reader.ReadInt16();
 }
Ejemplo n.º 15
0
 public MessageLocalizedPacket(PacketReader reader)
     : base(0xC1, "Message Localized")
 {
     Serial = reader.ReadInt32(); // 0xffff for system message
     Body = reader.ReadInt16(); // (0xff for system message
     MessageType = (MessageTypes)reader.ReadByte(); // 6 - lower left, 7 on player
     Hue = reader.ReadUInt16();
     Font = reader.ReadInt16();
     CliLocNumber = reader.ReadInt32();
     SpeakerName = reader.ReadString(30).Trim();
     Arguements = reader.ReadUnicodeStringSafeReverse();
 }
 public UnicodeMessagePacket(PacketReader reader)
     : base(0xAE, "Unicode Message")
 {
     m_serial = reader.ReadInt32();
     m_model = reader.ReadInt16();
     m_msgType = (MessageTypes)reader.ReadByte();
     m_hue = reader.ReadInt16();
     m_font = reader.ReadInt16();
     m_language = reader.ReadInt32();
     m_speakerName = reader.ReadString(30);
     m_spokenText = reader.ReadUnicodeString((reader.Buffer.Length - 48) / 2);
 }
Ejemplo n.º 17
0
        public LoginConfirmPacket(PacketReader reader)
            : base(0x1B, "Login Confirm")
        {
            m_serial = reader.ReadInt32();

            reader.ReadInt32(); //unknown. Always 0.

            m_body = reader.ReadInt16();
            m_x = reader.ReadInt16();
            m_y = reader.ReadInt16();
            m_z = reader.ReadInt16();
            m_direction = reader.ReadByte();
        }
 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.
     ContainerSerial = (Serial)reader.ReadInt32();
     Hue = reader.ReadUInt16();
 }
 public ContainerContentUpdatePacket(PacketReader reader)
     : base(0x25, "Add Single Item")
 {
     m_serial = reader.ReadInt32();
     m_itemId = reader.ReadUInt16();
     reader.ReadByte(); // unknown
     m_amount = reader.ReadUInt16();
     m_x = reader.ReadInt16();
     m_y = reader.ReadInt16();
     m_gridLocation = reader.ReadByte(); // always 0 in RunUO.
     m_parentSerial = (Serial)reader.ReadInt32();
     m_hue = reader.ReadUInt16();
 }
Ejemplo n.º 20
0
        public StatusInfoPacket(PacketReader reader)
            : base(0x11, "StatusInfo")
        {
            Serial = reader.ReadInt32();
            PlayerName = reader.ReadString(30);
            CurrentHealth = reader.ReadInt16();
            MaxHealth = reader.ReadInt16();
            NameChangeFlag = reader.ReadByte() != 0x00; // 0x1 = allowed, 0 = not allowed
            StatusTypeFlag = reader.ReadByte();
            if (StatusTypeFlag > 0)
            {
                Sex = (Genders)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 = (Races)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();
                }
            }
        }
Ejemplo n.º 21
0
        public VendorBuyListPacket(PacketReader reader)
            : base(0x74, "Open Buy Window")
        {
            m_vendorPackSerial = reader.ReadInt32();
            m_itemCount = reader.ReadByte();
            m_prices = new int[m_itemCount];
            m_descriptions = new string[m_itemCount];

            for (int i = 0; i < m_itemCount; i++)
            {
                m_prices[i] = reader.ReadInt32();
                int descriptionLegnth = reader.ReadByte();
                m_descriptions[i] = reader.ReadString(descriptionLegnth);
            }
        }
Ejemplo n.º 22
0
        public VendorBuyListPacket(PacketReader reader)
            : base(0x74, "Open Buy Window")
        {
            VendorPackSerial = reader.ReadInt32();
            int count = reader.ReadByte();
            Items = new List<VendorBuyItem>();
            for (int i = 0; i < count; i++)
            {
                int price = reader.ReadInt32();
                int descriptionLegnth = reader.ReadByte();
                string description = reader.ReadString(descriptionLegnth);

                Items.Add(new VendorBuyItem(price, description));
            }
        }
 public AddSingleItemToContainerPacket(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();
     if (reader.Buffer.Length == 21)
         GridLocation = reader.ReadByte(); // always 0 in RunUO.
     else
         GridLocation = 0;
     ContainerSerial = (Serial)reader.ReadInt32();
     Hue = reader.ReadUInt16();
 }
Ejemplo n.º 24
0
 public OpenPaperdollPacket(PacketReader reader)
     : base(0x88, "Open Paperdoll")
 {
     Serial = reader.ReadInt32();
     MobileName = reader.ReadStringSafe(60);
     //+flags
 }
Ejemplo n.º 25
0
 public ExtendedStatsInfo(PacketReader reader)
 {
     int clientFlag = reader.ReadByte(); // (0x2 for 2D client, 0x5 for KR client)
     Serial = reader.ReadInt32();
     byte unknown0 = reader.ReadByte(); // (always 0)
     byte lockFlags = reader.ReadByte();
     // Lock flags = bitflags 00SSDDII
     //     00 = up
     //     01 = down
     //     10 = locked
     // FF = update mobile status animation ( KR only )
     if (lockFlags != 0xFF) {
         int strengthLock = (lockFlags >> 4) & 0x03;
         int dexterityLock = (lockFlags >> 2) & 0x03;
         int inteligenceLock = (lockFlags) & 0x03;
         Locks = new StatLocks(strengthLock, dexterityLock, inteligenceLock);
     }
     if (clientFlag == 5) {
         Tracer.Warn("ClientFlags == 5 in GeneralInfoPacket ExtendedStats 0x19. This is not a KR client.");
         // If(Lock flags = 0xFF) //Update mobile status animation
         //  BYTE[1] Status // Unveryfied if lock flags == FF the locks will be handled here
         //  BYTE[1] unknown (0x00)
         //  BYTE[1] Animation
         //  BYTE[1] unknown (0x00)
         //  BYTE[1] Frame
         // else
         //  BYTE[1] unknown (0x00)
         //  BYTE[4] unknown (0x00000000)
         // endif
     }
 }
Ejemplo n.º 26
0
 public TargetCursorPacket(PacketReader reader)
     : base(0x6C, "Target Cursor")
 {
     m_commandtype = reader.ReadByte(); // 0x00 = Select Object; 0x01 = Select X, Y, Z
     m_cursorid = reader.ReadInt32();
     m_cursortype = reader.ReadByte(); // 0 - 2 = unknown; 3 = Cancel current targetting RunUO seems to always send 0.
 }
Ejemplo n.º 27
0
 public DragEffectPacket(PacketReader reader)
     : base(0x23, "Dragging Item")
 {
     ItemId = reader.ReadUInt16();
     reader.ReadByte(); // 0x03 bytes unknown.
     reader.ReadByte(); //
     reader.ReadByte(); //
     Amount = reader.ReadUInt16();
     Source = reader.ReadInt32(); // 0x00000000 or 0xFFFFFFFF for ground
     SourceX = reader.ReadUInt16();
     SourceY = reader.ReadUInt16();
     SourceZ = reader.ReadByte();
     Destination = reader.ReadInt32(); // 0x00000000 or 0xFFFFFFFF for ground
     DestX = reader.ReadUInt16();
     DestY = reader.ReadUInt16();
     DestZ = reader.ReadByte();
 }
Ejemplo n.º 28
0
 public ServerListEntry(PacketReader reader)
 {
     index = (ushort)reader.ReadInt16();
     name = reader.ReadString(30);
     percentFull = reader.ReadByte();
     timezone = reader.ReadByte();
     address = (uint)reader.ReadInt32();
 }
Ejemplo n.º 29
0
 public DragEffectPacket(PacketReader reader)
     : base(0x23, "Dragging Item")
 {
     m_itemId = reader.ReadUInt16();
     reader.ReadByte(); // 0x03 bytes unknown.
     reader.ReadByte(); //
     reader.ReadByte(); //
     m_amount = reader.ReadUInt16();
     m_sourceContainer = reader.ReadInt32(); // 0xFFFFFFFF for ground
     m_sourceX = reader.ReadUInt16();
     m_sourceY = reader.ReadUInt16();
     m_sourceZ = reader.ReadByte();
     m_destContainer = reader.ReadInt32(); // 0xFFFFFFFF for ground
     m_destX = reader.ReadUInt16();
     m_destY = reader.ReadUInt16();
     m_destZ = reader.ReadByte();
 }
Ejemplo n.º 30
0
 public ServerListEntry(PacketReader reader)
 {
     Index = (ushort)reader.ReadInt16();
     Name = reader.ReadString(32);
     PercentFull = reader.ReadByte();
     Timezone = reader.ReadByte();
     Address = (uint)reader.ReadInt32();
 }