Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public override UInt16 GetZoneNumber()
- {
- // A return value of zero from this method should be intepreted as 'Unable to identify patch version'.
- // Thanks to ShowEQ team for details on how to parse the variable length PP
- try
- {
- List<byte[]> PlayerProfilePacket = GetPacketsOfType("OP_PlayerProfile", PacketDirection.ServerToClient);
- if (PlayerProfilePacket.Count == 0)
- {
- return 0;
- }
- var Buffer = new ByteStream(PlayerProfilePacket[0]);
- Buffer.SkipBytes(4); // checksum
- Buffer.SkipBytes(12); // unknown
- Buffer.SkipBytes(1); // gender
- Buffer.SkipBytes(4); // race
- Buffer.SkipBytes(4); // class_
- Buffer.SkipBytes(1); // level
- Buffer.SkipBytes(1); // level1
- // Bind points
- int BindCount = Buffer.ReadInt32();
- Buffer.SkipBytes(20 * BindCount); // bind structs - 20 = sizeof(BindStruct)
- Buffer.SkipBytes(4); // deity
- Buffer.SkipBytes(4); // intoxication
- // Spell slot refresh
- int spellRefreshCount = Buffer.ReadInt32();
- Buffer.SkipBytes(4 * spellRefreshCount); // spell refresh slots - just int32 * count
- // Equipment
- uint EquipmentCount = Buffer.ReadUInt32();
- Buffer.SkipBytes(20 * EquipmentCount); // equipment
- // Something (9 ints)
- var sCount = Buffer.ReadUInt32();
- Buffer.SkipBytes(20 * sCount);
- // Something (9 ints)
- var sCount1 = Buffer.ReadUInt32();
- Buffer.SkipBytes(4 * sCount1);
- // Something (9 ints)
- var sCount2 = Buffer.ReadUInt32();
- Buffer.SkipBytes(4 * sCount2);
- Buffer.SkipBytes(52); // face, haircolor, etc
- Buffer.SkipBytes(4 * 10); // points, mana, curHP ... WIS
- Buffer.SkipBytes(28); // unknown
- UInt32 AACount = Buffer.ReadUInt32();
- Buffer.SkipBytes(4 * 3 * AACount); // AA stuffs
- // Something (100 ints)
- uint sCount3 = Buffer.ReadUInt32();
- Buffer.SkipBytes(4 * sCount3);
- // Something (25 ints)
- uint sCount4 = Buffer.ReadUInt32();
- Buffer.SkipBytes(4 * sCount4);
- // Something (300 ints)
- uint sCount5 = Buffer.ReadUInt32();
- Buffer.SkipBytes(4 * sCount5);
- // Something (20 ints)
- uint sCount6 = Buffer.ReadUInt32();
- Buffer.SkipBytes(4 * sCount6);
- // Something (20 floats)
- uint sCount7 = Buffer.ReadUInt32();
- Buffer.SkipBytes(4 * sCount7);
- // Something (100 floats)
- uint sCount8 = Buffer.ReadUInt32();
- Buffer.SkipBytes(4 * sCount8);
- UInt32 SpellBookSlots = Buffer.ReadUInt32();
- Buffer.SkipBytes(4 * SpellBookSlots);
- UInt32 SpellMemSlots = Buffer.ReadUInt32();
- Buffer.SkipBytes(4 * SpellMemSlots);
- // Something (13 ints)
- uint sCount9 = Buffer.ReadUInt32();
- Buffer.SkipBytes(4 * sCount9);
- // Unknown
- Buffer.SkipBytes(1);
- UInt32 BuffCount = Buffer.ReadUInt32();
- Buffer.SkipBytes(80 * BuffCount); // buffs - 80 = sizeof(spellBuff)
- Buffer.SkipBytes(4); // money
- Buffer.SkipBytes(4);
- Buffer.SkipBytes(4);
- Buffer.SkipBytes(4);
- Buffer.SkipBytes(4); // money cursor
- Buffer.SkipBytes(4);
- Buffer.SkipBytes(4);
- Buffer.SkipBytes(4);
- // Unknown
- Buffer.SkipBytes(20);
- Buffer.SkipBytes(4); // aa_spent
- // Unknown
- Buffer.SkipBytes(4);
- Buffer.SkipBytes(4); // aa_assigned
- // Unknown
- Buffer.SkipBytes(16);
- Buffer.SkipBytes(4); // aa_unspent
- // Unknown
- Buffer.SkipBytes(2);
- UInt32 BandolierCount = Buffer.ReadUInt32();
- for (int i = 0; i < BandolierCount; ++i)
- {
- Buffer.ReadString(false); // bandolierName
- Buffer.ReadString(false); // mainhand
- Buffer.SkipBytes(8);
- Buffer.ReadString(false); // offhand
- Buffer.SkipBytes(8);
- Buffer.ReadString(false); // range
- Buffer.SkipBytes(8);
- Buffer.ReadString(false); // ammo
- Buffer.SkipBytes(8);
- }
- UInt32 PotionCount = Buffer.ReadUInt32();
- for (int i = 0; i < PotionCount; ++i)
- {
- Buffer.ReadString(false);
- Buffer.SkipBytes(8);
- }
- // Unknown
- Buffer.SkipBytes(84);
- Buffer.SkipBytes(4); // endurance
- // Unknown
- Buffer.SkipBytes(12);
- Buffer.SkipBytes(64); // name
- Buffer.SkipBytes(4); // unknown
- Buffer.SkipBytes(64); // lastname
- Buffer.SkipBytes(4); // birthdayTime
- Buffer.SkipBytes(4); // accountCreateDate
- Buffer.SkipBytes(4); // lastSaveTime
- Buffer.SkipBytes(4); // timePlayedMin
- Buffer.SkipBytes(8); // unknown
- UInt32 LanguageCount = Buffer.ReadUInt32();
- Buffer.SkipBytes(1 * LanguageCount); // langs
- // This is what I am after ...
- UInt16 ZoneID = Buffer.ReadUInt16();
- return ZoneID;
- }
- catch (Exception)
- {
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment