Example #1
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

        }
Example #2
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
        }