public override PositionUpdate Decode_OP_MobUpdate(byte[] mobUpdatePacket) { PositionUpdate PosUpdate = new PositionUpdate(); ByteStream Buffer = new ByteStream(mobUpdatePacket); PosUpdate.SpawnID = Buffer.ReadUInt16(); Buffer.SkipBytes(2); UInt32 Word1 = Buffer.ReadUInt32(); UInt32 Word2 = Buffer.ReadUInt32(); UInt16 Word3 = Buffer.ReadUInt16(); PosUpdate.p.y = Utils.EQ19ToFloat((Int32)(Word1 & 0x7FFFF)); // Z is in the top 13 bits of Word1 and the bottom 6 of Word2 UInt32 ZPart1 = Word1 >> 19; // ZPart1 now has low order bits of Z in bottom 13 bits UInt32 ZPart2 = Word2 & 0x3F; // ZPart2 now has high order bits of Z in bottom 6 bits ZPart2 = ZPart2 << 13; PosUpdate.p.z = Utils.EQ19ToFloat((Int32)(ZPart1 | ZPart2)); PosUpdate.p.x = Utils.EQ19ToFloat((Int32)(Word2 >> 6) & 0x7FFFF); PosUpdate.p.heading = Utils.EQ19ToFloat((Int32)(Word3 & 0xFFF)); PosUpdate.HighRes = false; return PosUpdate; }
public override void ExploreItemPacket(StreamWriter outputStream, ByteStream buffer, PacketDirection direction) { buffer.SkipBytes(4); // Skip type field. ExploreSubItem(outputStream, ref buffer); outputStream.WriteLine(""); }
public override void ExploreClientUpdate(StreamWriter outputStream, ByteStream buffer, PacketDirection direction) { UInt16 SpawnID = buffer.ReadUInt16(); buffer.SkipBytes(6); float x = buffer.ReadSingle(); float y = buffer.ReadSingle(); buffer.SkipBytes(12); float z = buffer.ReadSingle(); buffer.SkipBytes(4); UInt32 Temp = buffer.ReadUInt32(); Temp = Temp & 0x3FFFFF; Temp = Temp >> 10; float heading = Utils.EQ19ToFloat((Int32)(Temp)); outputStream.WriteLine("Loc: {0}, {1}, {2} Heading: {3}", x, y, z, heading); outputStream.WriteLine(""); }
public override Item DecodeItemPacket(byte[] packetBuffer) { ByteStream Buffer = new ByteStream(packetBuffer); Item NewItem = new Item(); Buffer.SetPosition(30); NewItem.MerchantSlot = Buffer.ReadByte(); // 13 NewItem.Price = Buffer.ReadUInt32(); // 14 Buffer.SkipBytes(5); NewItem.Quantity = Buffer.ReadInt32(); // 23 Buffer.SetPosition(97); NewItem.Name = Buffer.ReadString(true); NewItem.Lore = Buffer.ReadString(true); NewItem.IDFile = Buffer.ReadString(true); Buffer.SkipBytes(1); NewItem.ID = Buffer.ReadUInt32(); return NewItem; }
public override void ExploreItemPacket(StreamWriter outputStream, ByteStream buffer, PacketDirection direction) { UInt32 StackSize = buffer.ReadUInt32(); buffer.SkipBytes(4); UInt32 Slot = buffer.ReadUInt32(); UInt32 MerchantSlot = buffer.ReadUInt32(); UInt32 Price = buffer.ReadUInt32(); Int32 Quantity = buffer.ReadInt32(); buffer.SetPosition(68); string Name = buffer.ReadString(true); outputStream.WriteLine("Item: {0} at Slot: {1}", Name, Slot); }
public override Item DecodeItemPacket(byte[] packetBuffer) { ByteStream Buffer = new ByteStream(packetBuffer); Item NewItem = new Item(); NewItem.StackSize = Buffer.ReadUInt32(); Buffer.SkipBytes(4); NewItem.Slot = Buffer.ReadUInt32(); NewItem.MerchantSlot = Buffer.ReadUInt32(); NewItem.Price = Buffer.ReadUInt32(); NewItem.Quantity = Buffer.ReadInt32(); Buffer.SetPosition(68); NewItem.Name = Buffer.ReadString(true); NewItem.Lore = Buffer.ReadString(true); NewItem.IDFile = Buffer.ReadString(true); NewItem.ID = Buffer.ReadUInt32(); return NewItem; }
/* * from seq source int32_t ZoneMgr::fillProfileStruct(charProfileStruct *player, const uint8_t *data, size_t len, bool checkLen) * * */ public override void ExplorePlayerProfile(StreamWriter outputStream, ByteStream buffer, PacketDirection direction) { outputStream.WriteLine("MooDump"); outputStream.WriteLine("{0, -5}: Checksum = {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); // Unknown buffer.SkipBytes(12); outputStream.WriteLine(""); outputStream.WriteLine("{0, -5}: Gender = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Race = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Class = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Level = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Level1 = {1}", buffer.GetPosition(), buffer.ReadByte()); // Bind points int BindCount = buffer.ReadInt32(); outputStream.WriteLine("{0, -5}: BindCount = {1}", buffer.GetPosition() - 4, BindCount); //not sure if this is right tbh for (int i = 0; i < BindCount; ++i) { outputStream.WriteLine("{0, -5}: Bind: {1} Zone: {2} XYZ: {3},{4},{5} Heading: {6}", buffer.GetPosition(), i, buffer.ReadUInt32(), buffer.ReadSingle(), buffer.ReadSingle(), buffer.ReadSingle(), buffer.ReadSingle()); } outputStream.WriteLine(""); outputStream.WriteLine("{0, -5}: Deity = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Intoxication = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine(""); // Spell slot refresh int spellRefreshCount = buffer.ReadInt32(); outputStream.WriteLine("{0, -5}: SpellRefreshCount = {1}", buffer.GetPosition() - 4, spellRefreshCount); for (int i = 0; i < spellRefreshCount; i++) { outputStream.WriteLine("{0, -5}: SpellRefreshCount{1} = {2}", buffer.GetPosition(), i, buffer.ReadUInt32()); } // Equipment uint EquipmentCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: EquipmentCount = {1}", buffer.GetPosition() - 4, EquipmentCount); for (int i = 0; i < EquipmentCount; ++i) { outputStream.Write("{0, -5}: Equip: {1} Values: ", buffer.GetPosition(), i); for (int j = 0; j < 5; ++j) { outputStream.Write(j != 3 ? "{0} " : " ItemId {0} ", buffer.ReadUInt32()); } outputStream.WriteLine(""); } // Something (9 ints) var sCount = buffer.ReadUInt32(); for (var i = 0; i < sCount; i++) { buffer.SkipBytes(20); } // Something (9 ints) var sCount1 = buffer.ReadUInt32(); for (var i = 0; i < sCount1; i++) { buffer.SkipBytes(4); } // Something (9 ints) var sCount2 = buffer.ReadUInt32(); for (var i = 0; i < sCount2; i++) { buffer.SkipBytes(4); } int preposn = buffer.GetPosition(); outputStream.WriteLine("{0, -5}: Hair Color = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Beard Color = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Eye1 Color = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Eye2 Color = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Hairstyle = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Beard = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Face = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Drakkin Heritage = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Drakkin Tattoo = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Drakkin Details = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Height = {1}", buffer.GetPosition(), buffer.ReadSingle()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadSingle()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadSingle()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadSingle()); outputStream.WriteLine("{0, -5}: Primary = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Secondary = {1}", buffer.GetPosition(), buffer.ReadUInt32()); int diff = buffer.GetPosition() - preposn; outputStream.WriteLine("Diff should be 52: {0}", diff); // Looks like face, haircolor, beardcolor, eyes, etc. Skipping over it. //Buffer.SkipBytes(52); outputStream.WriteLine("{0, -5}: Unspent Skill Points = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Mana = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Current HP = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: STR = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: STA = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: CHA = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: DEX = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: INT = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: AGI = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: WIS = {1}", buffer.GetPosition(), buffer.ReadUInt32()); buffer.SkipBytes(28); //Buffer.SkipBytes(28); UInt32 AACount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: AA Count = {1}", buffer.GetPosition() - 4, AACount); for (int i = 0; i < AACount; ++i) { outputStream.WriteLine(" AA: {0}, Value: {1}, Unknown08: {2}", buffer.ReadUInt32(), buffer.ReadUInt32(), buffer.ReadUInt32()); //Buffer.SkipBytes(12); } // Something (100 ints) uint sCount3 = buffer.ReadUInt32(); for (int i = 0; i < sCount3; i++) { buffer.SkipBytes(4); } // Something (25 ints) uint sCount4 = buffer.ReadUInt32(); for (int i = 0; i < sCount4; i++) { buffer.SkipBytes(4); } // Something (300 ints) uint sCount5 = buffer.ReadUInt32(); for (int i = 0; i < sCount5; i++) { buffer.SkipBytes(4); } // Something (20 ints) uint sCount6 = buffer.ReadUInt32(); for (int i = 0; i < sCount6; i++) { buffer.SkipBytes(4); } // Something (20 floats) uint sCount7 = buffer.ReadUInt32(); for (int i = 0; i < sCount7; i++) { buffer.SkipBytes(4); } // Something (100 floats) uint sCount8 = buffer.ReadUInt32(); for (int i = 0; i < sCount8; i++) { buffer.SkipBytes(4); } UInt32 SpellBookSlots = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: SpellBookSlot Count = {1}", buffer.GetPosition() - 4, SpellBookSlots); for (int i = 0; i < SpellBookSlots; ++i) { buffer.SkipBytes(4); } UInt32 SpellMemSlots = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Spell Mem Count = {1}", buffer.GetPosition() - 4, SpellMemSlots); for (int i = 0; i < SpellMemSlots; ++i) { buffer.SkipBytes(4); } // Something (13 ints) uint sCount9 = buffer.ReadUInt32(); for (int i = 0; i < sCount9; i++) { buffer.SkipBytes(4); } // Unknown buffer.SkipBytes(1); UInt32 BuffCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Buff Count = {1}", buffer.GetPosition() - 4, BuffCount); for (int i = 0; i < BuffCount; ++i) { buffer.ReadByte(); float UnkFloat = buffer.ReadSingle(); UInt32 PlayerID = buffer.ReadUInt32(); Byte UnkByte = buffer.ReadByte(); UInt32 Counters1 = buffer.ReadUInt32(); UInt32 Duration = buffer.ReadUInt32(); Byte Level = buffer.ReadByte(); UInt32 SpellID = buffer.ReadUInt32(); UInt32 SlotID = buffer.ReadUInt32(); buffer.SkipBytes(5); UInt32 Counters2 = buffer.ReadUInt32(); outputStream.WriteLine( "Sl: {0}, UF: {1}, PID: {2}, UByte: {3}, Cnt1: {4}, Dur: {5}, Lvl: {6} SpellID: {7}, SlotID: {8}, Cnt2: {9}", i, UnkFloat, PlayerID, UnkByte, Counters1, Duration, Level, SpellID, SlotID, Counters2); buffer.SkipBytes(44); } outputStream.WriteLine("{0, -5}: Plat = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Gold = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Silver = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Copper = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Plat Cursor = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Gold Cursor = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Silver Cursor = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Copper Cursor = {1}", buffer.GetPosition(), buffer.ReadUInt32()); // Unknown buffer.SkipBytes(20); outputStream.WriteLine("{0, -5}: AA Spent = {1}", buffer.GetPosition(), buffer.ReadUInt32()); // Unknown buffer.SkipBytes(4); outputStream.WriteLine("{0, -5}: AA Assigned = {1}", buffer.GetPosition(), buffer.ReadUInt32()); // Unknown buffer.SkipBytes(16); outputStream.WriteLine("{0, -5}: AA Unspent = {1}", buffer.GetPosition(), buffer.ReadUInt32()); // Unknown buffer.SkipBytes(2); /* // Bandolier Buffer.SkipBytes(1319); // Potion Belt Buffer.SkipBytes(160); */ //this could be wrong we could just skip UInt32 BandolierCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Bandolier Count = {1}", buffer.GetPosition() - 4, BandolierCount); for (int i = 0; i < BandolierCount; ++i) { buffer.ReadString(false); buffer.ReadString(false); buffer.SkipBytes(8); buffer.ReadString(false); buffer.SkipBytes(8); buffer.ReadString(false); buffer.SkipBytes(8); buffer.ReadString(false); buffer.SkipBytes(8); } UInt32 PotionCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Potion Count = {1}", buffer.GetPosition() - 4, PotionCount); for (int i = 0; i < PotionCount; ++i) { buffer.ReadString(false); buffer.SkipBytes(8); } // Unknown buffer.SkipBytes(84); outputStream.WriteLine("{0, -5}: Endurance= {1}", buffer.GetPosition(), buffer.ReadUInt32()); // Unknown buffer.SkipBytes(8); UInt32 NameLength = buffer.ReadUInt32(); var posn = buffer.GetPosition(); outputStream.WriteLine("{0, -5}: Name Length: {1}", buffer.GetPosition() - 4, NameLength); var name = buffer.ReadString(false); outputStream.WriteLine("{0, -5}: Name: {1}", buffer.GetPosition(), name); int CurrentPosition = buffer.GetPosition(); diff = CurrentPosition - posn; var skip = (int) NameLength - diff; outputStream.WriteLine("Diff is {0}. If it is not 0, then we will go overboard when setting posn. Skipping {1} bytes", diff, skip); buffer.SkipBytes(skip); UInt32 LastNameLength = buffer.ReadUInt32(); posn = buffer.GetPosition(); outputStream.WriteLine("{0, -5}: LastName Length: {1}", buffer.GetPosition() - 4, LastNameLength); name = buffer.ReadString(false); outputStream.WriteLine("{0, -5}: Last Name: {1}", buffer.GetPosition(), name); CurrentPosition = buffer.GetPosition(); diff = CurrentPosition - posn; skip = (int)LastNameLength - diff; outputStream.WriteLine("Diff is {0}. If it is not 0, then we will go overboard when setting posn. Skipping {1} bytes", diff, skip); buffer.SkipBytes(skip); // Unknown //Buffer.SkipBytes(4); outputStream.WriteLine("{0, -5}: Birthday {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Account start date {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Last Save Date {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Time played in Minutes {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Time Entitled On Account {1}", buffer.GetPosition(),buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Expansions {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); UInt32 LanguageCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Language Count = {1}", buffer.GetPosition() - 4, LanguageCount); for (int i = 0; i < LanguageCount; ++i) { buffer.SkipBytes(1); } outputStream.WriteLine("{0, -5}: Zone ID {1}", buffer.GetPosition(), buffer.ReadUInt16()); outputStream.WriteLine("{0, -5}: Zone Instance {1}", buffer.GetPosition(), buffer.ReadUInt16()); outputStream.WriteLine("{0, -5}: Y,X,Z {1},{2},{3} Heading: {4}", buffer.GetPosition(), buffer.ReadSingle(), buffer.ReadSingle(), buffer.ReadSingle(), buffer.ReadSingle()); //Moofta all above here is verified outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: GuildID? {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Experience {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Bank Plat {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Bank Gold {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Bank Silver {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Bank Copper {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Shared plat? {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); UInt32 Unknown42 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown, value 42? {1}", buffer.GetPosition() - 4, Unknown42); buffer.SkipBytes((int)(Unknown42 * 8)); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Career Tribute Favour {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Current Tribute Favour {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); UInt32 PersonalTributeCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Personal Tribute Count {1}", buffer.GetPosition() - 4, PersonalTributeCount); buffer.SkipBytes((int)(PersonalTributeCount * 8)); UInt32 GuildTributeCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Guild Tribute Count {1}", buffer.GetPosition() - 4, GuildTributeCount); buffer.SkipBytes((int)(GuildTributeCount * 8)); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("Skipping 121 bytes starting at offset {0}", buffer.GetPosition()); buffer.SkipBytes(121); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("Position now {0}", buffer.GetPosition()); UInt32 Unknown64 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown64 {1}", buffer.GetPosition() - 4, Unknown64); buffer.SkipBytes((int)Unknown64); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); Unknown64 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown64 {1}", buffer.GetPosition() - 4, Unknown64); buffer.SkipBytes((int)Unknown64); Unknown64 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown64 {1}", buffer.GetPosition() - 4, Unknown64); buffer.SkipBytes((int)Unknown64); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("Skipping 320 bytes starting at offset {0}", buffer.GetPosition()); buffer.SkipBytes(320); outputStream.WriteLine("Skipping 343 bytes starting at offset {0}", buffer.GetPosition()); buffer.SkipBytes(343); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); UInt32 Unknown6 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown6 {1} LDON Stuff then why have the count before it?", buffer.GetPosition() - 4, Unknown6); //for (int i = 0; i < Unknown6; ++i) //{ // OutputStream.WriteLine("{0, -5}: Unknown LDON? {1}", Buffer.GetPosition(), Buffer.ReadUInt32()); //} outputStream.WriteLine("{0, -5}: Ldon GUK points? {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Ldon MIR points? {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Ldon mmc points? {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Ldon ruj points? {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Ldon tak points? {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Ldon available points? {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); Unknown64 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown64 {1}", buffer.GetPosition() - 4, Unknown64); buffer.SkipBytes((int)Unknown64 * 4); // Air remaining ? outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); // Next 7 could be PVP stats, outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); // PVP LastKill struct ? outputStream.WriteLine("Skipping string + 24 bytes starting at offset {0}", buffer.GetPosition()); //Buffer.SkipBytes(25); Byte b; do { b = buffer.ReadByte(); } while (b != 0); buffer.SkipBytes(24); // PVP LastDeath struct ? outputStream.WriteLine("Skipping string + 24 bytes starting at offset {0}", buffer.GetPosition()); //Buffer.SkipBytes(25); do { b = buffer.ReadByte(); } while (b != 0); buffer.SkipBytes(24); // PVP Number of Kills in Last 24 hours ? outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); UInt32 Unknown50 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown50 {1}", buffer.GetPosition() - 4, Unknown50); // PVP Recent Kills ? outputStream.WriteLine("Pss pvp recent kills Skipping 50 x (String + 24 bytes) starting at offset {0}", buffer.GetPosition()); //Buffer.SkipBytes(1338); for (int i = 0; i < 50; ++i) { do { b = buffer.ReadByte(); } while (b != 0); buffer.SkipBytes(24); } // outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Group autoconsent? {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Raid autoconsent? {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Guild autoconsent? {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Level3? {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Showhelm? {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: RestTimer? {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("Skipping 1028 bytes starting at offset {0}", buffer.GetPosition()); buffer.SkipBytes(1028); //outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); //outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("Pointer is {0} bytes from end.", buffer.Length() - buffer.GetPosition()); }
public override List<ZonePoint> GetZonePointList() { List<ZonePoint> ZonePointList = new List<ZonePoint>(); List<byte[]> ZonePointPackets = GetPacketsOfType("OP_SendZonepoints", PacketDirection.ServerToClient); if (ZonePointPackets.Count < 1) { return ZonePointList; } // Assume there is only 1 packet and process the first one. ByteStream Buffer = new ByteStream(ZonePointPackets[0]); UInt32 Entries = Buffer.ReadUInt32(); if (Entries == 0) return ZonePointList; float x, y, z, Heading; UInt32 Number; UInt16 ZoneID, Instance; ZonePointList = new List<ZonePoint>(); for (int i = 0; i < Entries; ++i) { Number = Buffer.ReadUInt32(); y = Buffer.ReadSingle(); x = Buffer.ReadSingle(); z = Buffer.ReadSingle(); Heading = Buffer.ReadSingle(); if (Heading != 999) Heading = Heading / 2; ZoneID = Buffer.ReadUInt16(); Instance = Buffer.ReadUInt16(); Buffer.SkipBytes(4); // Skip the last UInt32 ZonePoint NewZonePoint = new ZonePoint(Number, ZoneID, Instance, x, y, z, x, y, z, Heading, ZoneID); ZonePointList.Add(NewZonePoint); } return ZonePointList; }
public override void ExploreSubItem(StreamWriter outputStream, ref ByteStream buffer) { UInt32 StackSize = buffer.ReadUInt32(); buffer.SkipBytes(4); UInt32 Slot = buffer.ReadUInt32(); UInt32 Price = buffer.ReadUInt32(); UInt32 MerchantSlot = buffer.ReadUInt32(); buffer.SkipBytes(16); buffer.SkipBytes(28); string Name = buffer.ReadString(true); buffer.ReadString(true); // Lore buffer.ReadString(true); // IDFile outputStream.WriteLine("Item Name: {0}", Name); buffer.SkipBytes(236); // ItemBodyStruct buffer.ReadString(true); // CharmFile buffer.SkipBytes(64); // ItemSecondaryBodyStruct buffer.ReadString(true); // Filename buffer.SkipBytes(76); // ItemTertiaryBodyStruct //Buffer.SkipBytes(30); // Click Effect Struct UInt32 Effect = buffer.ReadUInt32(); byte Level2 = buffer.ReadByte(); UInt32 Type = buffer.ReadUInt32(); byte Level = buffer.ReadByte(); UInt32 Unknown1 = buffer.ReadUInt32(); UInt32 Unknown2 = buffer.ReadUInt32(); UInt32 Unknown3 = buffer.ReadUInt32(); UInt32 Unknown4 = buffer.ReadUInt32(); UInt32 Unknown5 = buffer.ReadUInt32(); outputStream.WriteLine("Buffer pos is {0}" + buffer.GetPosition()); string ClickName = buffer.ReadString(true); // Clickname outputStream.WriteLine(" Click Name: {0}", ClickName); //Buffer.SkipBytes(4); // Clickunk7 UInt32 Unknown7 = buffer.ReadUInt32(); outputStream.WriteLine(" Effect: {0} Level2: {1} Type {2} Level {3}", Effect, Level2, Type, Level); outputStream.WriteLine(" Unks: {0} {1} {2} {3} {4} {5}", Unknown1, Unknown2, Unknown3, Unknown4, Unknown5, Unknown7); buffer.SkipBytes(30); // Proc Effect Struct buffer.ReadString(true); // Clickname buffer.SkipBytes(4); // Unknown5 buffer.SkipBytes(30); // Worn Effect Struct buffer.ReadString(true); // Wornname buffer.SkipBytes(4); // Unknown6 //Buffer.SkipBytes(30); // Worn Effect Struct Effect = buffer.ReadUInt32(); Level2 = buffer.ReadByte(); Type = buffer.ReadUInt32(); Level = buffer.ReadByte(); Unknown1 = buffer.ReadUInt32(); Unknown2 = buffer.ReadUInt32(); Unknown3 = buffer.ReadUInt32(); Unknown4 = buffer.ReadUInt32(); Unknown5 = buffer.ReadUInt32(); string FocusName = buffer.ReadString(true); // Focusname outputStream.WriteLine(" Focusname is {0}", FocusName); UInt32 Unknown6 = buffer.ReadUInt32(); outputStream.WriteLine(" Effect: {0} Level2: {1} Type {2} Level {3}", Effect, Level2, Type, Level); outputStream.WriteLine(" Unks: {0} {1} {2} {3} {4} {5}", Unknown1, Unknown2, Unknown3, Unknown4, Unknown5, Unknown6); //Buffer.SkipBytes(4); // Unknown6 buffer.SkipBytes(30); // Scroll Effect Struct buffer.ReadString(true); // Scrollname buffer.SkipBytes(4); // Unknown6 buffer.SkipBytes(30); // Bard Effect Struct buffer.ReadString(true); // Wornname buffer.SkipBytes(4); // Unknown6 buffer.SkipBytes(103); // Quaternarybodystruct - 4 UInt32 SubLengths = buffer.ReadUInt32(); //return; for (int i = 0; i < SubLengths; ++i) { buffer.SkipBytes(4); ExploreSubItem(outputStream, ref buffer); } return; ////Buffer.SkipBytes(236); // Item Body Struct //var ID = buffer.ReadUInt32(); //byte Weight = buffer.ReadByte(); //byte NoRent = buffer.ReadByte(); //byte NoDrop = buffer.ReadByte(); //byte Attune = buffer.ReadByte(); //byte Size = buffer.ReadByte(); //outputStream.WriteLine(" ID: {0} Weight: {1} NoRent: {2} NoDrop: {3} Attune {4} Size {5}", ID, Weight, NoRent, NoDrop, Attune, Size); //UInt32 Slots = buffer.ReadUInt32(); ////UInt32 Price = Buffer.ReadUInt32(); //UInt32 Icon = buffer.ReadUInt32(); //buffer.SkipBytes(2); //UInt32 BenefitFlags = buffer.ReadUInt32(); //byte Tradeskills = buffer.ReadByte(); //outputStream.WriteLine(" Slots: {0} Price: {1} Icon: {2} BenefitFlags {3} Tradeskills: {4}", Slots, Price, Icon, BenefitFlags, Tradeskills); //byte CR = buffer.ReadByte(); //byte DR = buffer.ReadByte(); //byte PR = buffer.ReadByte(); //byte MR = buffer.ReadByte(); //byte FR = buffer.ReadByte(); //byte SVC = buffer.ReadByte(); //outputStream.WriteLine(" CR: {0} DR: {1} PR: {2} MR: {3} FR: {4} SVC: {5}", CR, DR, PR, MR, FR, SVC); //byte AStr = buffer.ReadByte(); //byte ASta = buffer.ReadByte(); //byte AAgi = buffer.ReadByte(); //byte ADex = buffer.ReadByte(); //byte ACha = buffer.ReadByte(); //byte AInt = buffer.ReadByte(); //byte AWis = buffer.ReadByte(); //outputStream.WriteLine(" AStr: {0} ASta: {1} AAgi: {2} ADex: {3} ACha: {4} AInt: {5} AWis: {6}", AStr, ASta, AAgi, ADex, ACha, AInt, AWis); //Int32 HP = buffer.ReadInt32(); //Int32 Mana = buffer.ReadInt32(); //UInt32 Endurance = buffer.ReadUInt32(); //Int32 AC = buffer.ReadInt32(); //Int32 Regen = buffer.ReadInt32(); //Int32 ManaRegen = buffer.ReadInt32(); //Int32 EndRegen = buffer.ReadInt32(); //UInt32 Classes = buffer.ReadUInt32(); //UInt32 Races = buffer.ReadUInt32(); //UInt32 Deity = buffer.ReadUInt32(); //Int32 SkillModValue = buffer.ReadInt32(); //buffer.SkipBytes(4); //UInt32 SkillModType = buffer.ReadUInt32(); //UInt32 BaneDamageRace = buffer.ReadUInt32(); //UInt32 BaneDamageBody = buffer.ReadUInt32(); //UInt32 BaneDamageRaceAmount = buffer.ReadUInt32(); //Int32 BaneDamageAmount = buffer.ReadInt32(); //byte Magic = buffer.ReadByte(); //Int32 CastTime = buffer.ReadInt32(); //UInt32 ReqLevel = buffer.ReadUInt32(); //UInt32 RecLevel = buffer.ReadUInt32(); //UInt32 ReqSkill = buffer.ReadUInt32(); //UInt32 BardType = buffer.ReadUInt32(); //Int32 BardValue = buffer.ReadInt32(); //byte Light = buffer.ReadByte(); //byte Delay = buffer.ReadByte(); //byte ElemDamageAmount = buffer.ReadByte(); //byte ElemDamageType = buffer.ReadByte(); //byte Range = buffer.ReadByte(); //UInt32 Damage = buffer.ReadUInt32(); //UInt32 Color = buffer.ReadUInt32(); //byte ItemType = buffer.ReadByte(); //UInt32 Material = buffer.ReadUInt32(); //buffer.SkipBytes(4); //UInt32 EliteMaterial = buffer.ReadUInt32(); //float SellRate = buffer.ReadSingle(); //Int32 CombatEffects = buffer.ReadInt32(); //Int32 Shielding = buffer.ReadInt32(); //Int32 StunResist = buffer.ReadInt32(); //Int32 StrikeThrough = buffer.ReadInt32(); //Int32 ExtraDamageSkill = buffer.ReadInt32(); //Int32 ExtraDamageAmount = buffer.ReadInt32(); //Int32 SpellShield = buffer.ReadInt32(); //Int32 Avoidance = buffer.ReadInt32(); //Int32 Accuracy = buffer.ReadInt32(); //UInt32 CharmFileID = buffer.ReadUInt32(); //UInt32 FactionMod1 = buffer.ReadUInt32(); //Int32 FactionAmount1 = buffer.ReadInt32(); //UInt32 FactionMod2 = buffer.ReadUInt32(); //Int32 FactionAmount2 = buffer.ReadInt32(); //UInt32 FactionMod3 = buffer.ReadUInt32(); //Int32 FactionAmount3 = buffer.ReadInt32(); //UInt32 FactionMod4 = buffer.ReadUInt32(); //Int32 FactionAmount4 = buffer.ReadInt32(); //buffer.ReadString(true); // Charm File //buffer.SkipBytes(64); // Item Secondary Body Struct //buffer.ReadString(true); // Filename //buffer.SkipBytes(76); // Item Tertiary Body Struct //buffer.SkipBytes(30); // Click Effect Struct //buffer.ReadString(true); // Clickname //buffer.SkipBytes(4); // clickunk7 //buffer.SkipBytes(30); // Proc Effect Struct //buffer.ReadString(true); // Proc Name //buffer.SkipBytes(4); // unknown5 //buffer.SkipBytes(30); // Worn Effect Struct //buffer.ReadString(true); // Worn Name //buffer.SkipBytes(4); // unknown6 //buffer.SkipBytes(30); // Worn Effect Struct //buffer.ReadString(true); // Worn Name //buffer.SkipBytes(4); // unknown6 //buffer.SkipBytes(30); // Worn Effect Struct //buffer.ReadString(true); // Worn Name //buffer.SkipBytes(4); // unknown6 //buffer.SkipBytes(30); // Worn Effect Struct //buffer.ReadString(true); // Worn Name //buffer.SkipBytes(4); // unknown6 //buffer.SkipBytes(103); // Item Quaternary Body Struct - 4 (we want to read the SubLength field at the end) ////UInt32 SubLengths = Buffer.ReadUInt32(); //for (int i = 0; i < SubLengths; ++i) //{ // buffer.SkipBytes(4); // ExploreSubItem(outputStream, ref buffer); //} }
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; } ByteStream Buffer = new ByteStream(PlayerProfilePacket[0]); Buffer.SkipBytes(24); UInt32 BindCount = Buffer.ReadUInt32(); for (int i = 0; i < BindCount; ++i) { Buffer.SkipBytes(20); // sizeof(Bind Struct) } Buffer.SkipBytes(8); // Deity, intoxication UInt32 SpellRefreshCount = Buffer.ReadUInt32(); for (int i = 0; i < SpellRefreshCount; ++i) { Buffer.SkipBytes(4); } UInt32 EquipmentCount = Buffer.ReadUInt32(); for (int i = 0; i < EquipmentCount; ++i) { Buffer.SkipBytes(20); } UInt32 SomethingCount = Buffer.ReadUInt32(); for (int i = 0; i < SomethingCount; ++i) { Buffer.SkipBytes(20); } SomethingCount = Buffer.ReadUInt32(); for (int i = 0; i < SomethingCount; ++i) { Buffer.SkipBytes(4); } SomethingCount = Buffer.ReadUInt32(); for (int i = 0; i < SomethingCount; ++i) { Buffer.SkipBytes(4); } Buffer.SkipBytes(52); // Per SEQ, this looks like face, haircolor, beardcolor etc. UInt32 Points = Buffer.ReadUInt32(); UInt32 Mana = Buffer.ReadUInt32(); UInt32 CurHP = Buffer.ReadUInt32(); Buffer.SkipBytes(28); Buffer.SkipBytes(28); UInt32 AACount = Buffer.ReadUInt32(); for (int i = 0; i < AACount; ++i) { Buffer.SkipBytes(12); } SomethingCount = Buffer.ReadUInt32(); for (int i = 0; i < SomethingCount; ++i) { Buffer.SkipBytes(4); } SomethingCount = Buffer.ReadUInt32(); for (int i = 0; i < SomethingCount; ++i) { Buffer.SkipBytes(4); } SomethingCount = Buffer.ReadUInt32(); for (int i = 0; i < SomethingCount; ++i) { Buffer.SkipBytes(4); } SomethingCount = Buffer.ReadUInt32(); for (int i = 0; i < SomethingCount; ++i) { Buffer.SkipBytes(4); } SomethingCount = Buffer.ReadUInt32(); for (int i = 0; i < SomethingCount; ++i) { Buffer.SkipBytes(4); } SomethingCount = Buffer.ReadUInt32(); for (int i = 0; i < SomethingCount; ++i) { Buffer.SkipBytes(4); } UInt32 SpellBookSlots = Buffer.ReadUInt32(); for (int i = 0; i < SpellBookSlots; ++i) { Buffer.SkipBytes(4); } UInt32 SpellMemSlots = Buffer.ReadUInt32(); for (int i = 0; i < SpellMemSlots; ++i) { Buffer.SkipBytes(4); } SomethingCount = Buffer.ReadUInt32(); for (int i = 0; i < SomethingCount; ++i) { Buffer.SkipBytes(4); } Buffer.SkipBytes(1); UInt32 BuffCount = Buffer.ReadUInt32(); for (int i = 0; i < BuffCount; ++i) { Buffer.SkipBytes(80); } UInt32 Plat = Buffer.ReadUInt32(); UInt32 Gold = Buffer.ReadUInt32(); UInt32 Silver = Buffer.ReadUInt32(); UInt32 Copper = Buffer.ReadUInt32(); Buffer.SkipBytes(16); // Money on cursor Buffer.SkipBytes(20); UInt32 AASpent = Buffer.ReadUInt32(); Buffer.SkipBytes(30); UInt32 BandolierCount = Buffer.ReadUInt32(); for (int i = 0; i < BandolierCount; ++i) { Buffer.ReadString(false); Buffer.ReadString(false); Buffer.SkipBytes(8); Buffer.ReadString(false); Buffer.SkipBytes(8); Buffer.ReadString(false); Buffer.SkipBytes(8); Buffer.ReadString(false); Buffer.SkipBytes(8); } UInt32 PotionCount = Buffer.ReadUInt32(); for (int i = 0; i < PotionCount; ++i) { Buffer.ReadString(false); Buffer.SkipBytes(8); } Buffer.SkipBytes(100); int CurrentPosition = Buffer.GetPosition(); String PlayerName = Buffer.ReadString(false); Buffer.SetPosition(CurrentPosition + 64); Buffer.SkipBytes(96); // This is what I am after ... UInt16 ZoneID = Buffer.ReadUInt16(); return ZoneID; } catch (Exception) { return 0; } }
public override NewZoneStruct GetZoneData() { NewZoneStruct NewZone = new NewZoneStruct(); List<byte[]> ZonePackets = GetPacketsOfType("OP_NewZone", PacketDirection.ServerToClient); if (ZonePackets.Count < 1) return NewZone; // Assume there is only 1 packet and process the first one. ByteStream Buffer = new ByteStream(ZonePackets[0]); string CharName = Buffer.ReadFixedLengthString(64, false); NewZone.ShortName = Buffer.ReadFixedLengthString(32, false); Buffer.SkipBytes(96); // Skip Unknown NewZone.LongName = Buffer.ReadFixedLengthString(278, true); NewZone.Type = Buffer.ReadByte(); NewZone.FogRed = Buffer.ReadBytes(4); NewZone.FogGreen = Buffer.ReadBytes(4); NewZone.FogBlue = Buffer.ReadBytes(4); Buffer.SkipBytes(1); // Unknown for (int i = 0; i < 4; ++i) NewZone.FogMinClip[i] = Buffer.ReadSingle(); for (int i = 0; i < 4; ++i) NewZone.FogMaxClip[i] = Buffer.ReadSingle(); NewZone.Gravity = Buffer.ReadSingle(); NewZone.TimeType = Buffer.ReadByte(); Buffer.SkipBytes(49); // Unknown NewZone.Sky = Buffer.ReadByte(); Buffer.SkipBytes(13); // Unknown NewZone.ZEM = Buffer.ReadSingle(); NewZone.SafeY = Buffer.ReadSingle(); NewZone.SafeX = Buffer.ReadSingle(); NewZone.SafeZ = Buffer.ReadSingle(); NewZone.MinZ = Buffer.ReadSingle(); NewZone.MaxZ = Buffer.ReadSingle(); NewZone.UnderWorld = Buffer.ReadSingle(); NewZone.MinClip = Buffer.ReadSingle(); NewZone.MaxClip = Buffer.ReadSingle(); Buffer.SkipBytes(84); // Unknown NewZone.ShortName2 = Buffer.ReadFixedLengthString(96, false); Buffer.SkipBytes(52); // Unknown NewZone.ZoneID = Buffer.ReadUInt16(); NewZone.InstanceID = Buffer.ReadUInt16(); Buffer.SkipBytes(38); // Unknown NewZone.FallDamage = Buffer.ReadByte(); Buffer.SkipBytes(21); // Unknown NewZone.FogDensity = Buffer.ReadSingle(); // Everything else after this point in the packet is unknown. return NewZone; }
public override void ExploreZoneEntry(StreamWriter outputStream, ByteStream buffer, PacketDirection direction) { if (direction != PacketDirection.ServerToClient) return; try { var firstName = buffer.ReadString(false); //verified outputStream.WriteLine("Name = {0}", firstName); //File.WriteAllBytes(string.Format("{0}.bin",Utils.MakeCleanName(firstName)),buffer.Buffer); var spawnId = buffer.ReadUInt32();//verified outputStream.WriteLine("SpawnID = {0}", spawnId); var level = buffer.ReadByte();//verified outputStream.WriteLine("Level = {0}", level); buffer.SkipBytes(4); var isNpc = buffer.ReadByte();//verified outputStream.WriteLine("IsNPC = {0}", isNpc); var bitfield = buffer.ReadUInt32(); outputStream.WriteLine("Name: {0}, Bitfield: {1}", firstName, Convert.ToString(bitfield, 2)); outputStream.WriteLine("Gender: {0}", (bitfield & 3));//verified var otherData = buffer.ReadByte(); outputStream.WriteLine("OtherData = {0}", otherData); buffer.SkipBytes(8); // otherdata stuff is unverified if ((otherData & 1) > 0) { outputStream.WriteLine("OD: {0}", buffer.ReadString(false)); outputStream.WriteLine("OD: {0}", buffer.ReadString(false)); outputStream.WriteLine("OD: {0}", buffer.ReadString(false)); buffer.SkipBytes(53); } if ((otherData & 4) > 0) { outputStream.WriteLine("Aura: {0}", buffer.ReadString(false)); outputStream.WriteLine("Aura: {0}", buffer.ReadString(false)); buffer.SkipBytes(54); } //properties unverified in the sense that I don't know if they represent anything useful other than bodytype var properties = buffer.ReadByte(); outputStream.WriteLine("Properties = {0}, Offset now {1}", properties, buffer.GetPosition()); UInt32 bodyType = 0; if (properties > 0) bodyType = buffer.ReadUInt32(); //verified outputStream.WriteLine("Bodytype = {0}", bodyType); if (properties != 1) outputStream.WriteLine("XXXX Properties is {0}", properties); for (var i = 1; i < properties; ++i) outputStream.WriteLine(" Prop: {0}", buffer.ReadUInt32()); var hp = buffer.ReadByte(); //not 100% sure this is HP. I got 47% on my character when her hp at 100%. Poss mana? //Below here is verified var beardStyle = buffer.ReadByte(); outputStream.WriteLine("Beardstyle is {0}", beardStyle); var hairColor = buffer.ReadByte(); outputStream.WriteLine("Hair color is {0}", hairColor); var eye1 = buffer.ReadByte(); outputStream.WriteLine("Eye1 is {0}", eye1); var eye2 = buffer.ReadByte(); outputStream.WriteLine("Eye2 is {0}", eye2); var hairStyle = buffer.ReadByte(); outputStream.WriteLine("Hair style is {0}", hairStyle); var beardColor = buffer.ReadByte(); outputStream.WriteLine("Beard color is {0}", beardColor); var drakkinHeritage=buffer.ReadUInt32(); outputStream.WriteLine("Drakkin Heritage is {0}", drakkinHeritage); // an_unemployed_mercenary's and some newer npc's seem to have this set to 255, then have invalid numbers for the next ones if(drakkinHeritage==255) { outputStream.WriteLine("We should set drakkinHeritage to 0 as well as the other Drakkin stuff."); outputStream.WriteLine("Drakkin Heritage is 0"); outputStream.WriteLine("Drakkin Tattoo is 0"); outputStream.WriteLine("Drakkin Details is 0"); buffer.SkipBytes(8); } else { outputStream.WriteLine("Drakkin Tattoo is {0}", buffer.ReadUInt32()); outputStream.WriteLine("Drakkin Details is {0}", buffer.ReadUInt32()); } var equipChest2 = buffer.ReadByte(); //AKA texture var useWorn = equipChest2 == 255; buffer.SkipBytes(2); var helm = buffer.ReadByte(); //unverified var size = buffer.ReadSingle(); //verified var face = buffer.ReadByte(); // Probably correct var walkSpeed = buffer.ReadSingle(); //dunno valid ranges for this so this is anyone's guess :P var runSpeed = buffer.ReadSingle(); // verified var race = buffer.ReadUInt32(); //verified //dunno about bits below here outputStream.WriteLine("Holding = {0}", buffer.ReadByte()); outputStream.WriteLine("Deity = {0}", buffer.ReadUInt32()); //verified outputStream.WriteLine("GuildID = {0}", buffer.ReadUInt32());//unverified outputStream.WriteLine("Guildstatus = {0}", buffer.ReadUInt32());//unverified outputStream.WriteLine("Class = {0}", buffer.ReadUInt32());//verified outputStream.WriteLine("Size: {0}, Face: {1}, Walkspeed: {2}, RunSpeed: {3}, Race: {4}", size, face,walkSpeed, runSpeed, race); buffer.SkipBytes(1); //PVP-//unverified outputStream.WriteLine("Stand State = {0}", buffer.ReadByte());//unverified outputStream.WriteLine("Light = {0}", buffer.ReadByte());//unverified buffer.SkipBytes(1); //Flymode! //unverified var lastName = buffer.ReadString(false); outputStream.WriteLine("LastName = {0}", lastName); //verified buffer.SkipBytes(6); outputStream.WriteLine("PetOwnerId = {0}", buffer.ReadUInt32());//unverified buffer.SkipBytes(isNpc == 1 ? 37 : 25); if (isNpc == 0 || NPCType.IsPlayableRace(race)) { var posn = buffer.GetPosition(); for (int ColourSlot = 0; ColourSlot < 9; ++ColourSlot) outputStream.WriteLine("Color {0} is {1}", ColourSlot, buffer.ReadUInt32()); var diff = buffer.GetPosition() - posn; Debug.Assert(diff==36, "Colour slots wrong!"); //Player equip verified for (var i = 0; i < 9; ++i) { var equip3 = buffer.ReadUInt32(); var equipx = buffer.ReadUInt32(); var equip2 = buffer.ReadUInt32(); var equip1 = buffer.ReadUInt32(); var equip0 = buffer.ReadUInt32(); outputStream.WriteLine("Equip slot {0}: 0,1,2,x,3 is {1}, {2}, {3}, {4}, {5}", i, equip0, equip1, equip2, equipx, equip3); } } else { //vsab at this point this section is 100% untested // Non playable race // Melee Texture 1 is 20 bytes in // Melee Texture 1 is 40 bytes in // This whole segment is 28 + 24 + 8 = 60 // Skip 20, Read m1, skip 16, read m2, skip 16 /* OutputStream.WriteLine("None playable race, offset now {0}", Buffer.GetPosition()); Buffer.SkipBytes(28); UInt32 MeleeTexture1 = Buffer.ReadUInt32(); Buffer.SkipBytes(12); UInt32 MeleeTexture2 = Buffer.ReadUInt32(); Buffer.SkipBytes(12); */ outputStream.WriteLine("None playable race, offset now {0}", buffer.GetPosition()); buffer.SkipBytes(20); var meleeTexture1 = buffer.ReadUInt32(); buffer.SkipBytes(16); var meleeTexture2 = buffer.ReadUInt32(); buffer.SkipBytes(16); } //positions verified! outputStream.WriteLine("Position starts at offset {0}", buffer.GetPosition()); var position1 = buffer.ReadUInt32(); outputStream.WriteLine("Position1 untreated {0}", position1); var position2 = buffer.ReadUInt32(); outputStream.WriteLine("Position2 untreated {0}", position2); var position3 = buffer.ReadUInt32(); outputStream.WriteLine("Position3 untreated {0}", position3); var position4 = buffer.ReadUInt32(); outputStream.WriteLine("Position4 untreated {0}", position4); var position5 = buffer.ReadUInt32(); outputStream.WriteLine("Position5 untreated {0}", position5); var xPos = Utils.EQ19ToFloat((Int32)((position4 >> 13) & 0x7FFFF)); var yPos = Utils.EQ19ToFloat((Int32)(position1 >> 12) & 0x7FFFF); var zPos = Utils.EQ19ToFloat((Int32)(position3) & 0x7FFFF); var heading = Utils.EQ19ToFloat((Int32)(position5) & 0x7FF); outputStream.WriteLine("(X,Y,Z) = {0}, {1}, {2}, Heading = {3}", xPos, yPos, zPos, heading); if ((otherData & 16) > 1) outputStream.WriteLine("Title: {0}", buffer.ReadString(false)); //verified if ((otherData & 32) > 1) outputStream.WriteLine("Suffix: {0}", buffer.ReadString(false)); //verified buffer.SkipBytes(8); var isMerc = buffer.ReadByte(); //verified outputStream.WriteLine("IsMerc: {0}", isMerc); buffer.SkipBytes(54); var expectedLength = buffer.Length(); var currentPoint = buffer.GetPosition(); outputStream.WriteLine("Buffer Length: {0}, Current Position: {1}",expectedLength,currentPoint); Debug.Assert(currentPoint == expectedLength, "Length mismatch while parsing zone spawns"); outputStream.WriteLine(""); } catch (Exception) { } }
public override void ExploreRequestClientZoneChange(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction) { UInt32 ZoneID = Buffer.ReadUInt32(); UInt32 Unknown = Buffer.ReadUInt32(); float y = Buffer.ReadSingle(); float x = Buffer.ReadSingle(); float z = Buffer.ReadSingle(); float heading = Buffer.ReadSingle(); Buffer.SkipBytes(148); float uf = Buffer.ReadSingle(); OutputStream.WriteLine("UF = {0}", uf); }
public override List<Door> GetDoors() { List<Door> DoorList = new List<Door>(); List<byte[]> SpawnDoorPacket = GetPacketsOfType("OP_SpawnDoor", PacketDirection.ServerToClient); if ((SpawnDoorPacket.Count == 0) || (SpawnDoorPacket[0].Length == 0)) return DoorList; int DoorCount = SpawnDoorPacket[0].Length / 92; ByteStream Buffer = new ByteStream(SpawnDoorPacket[0]); for (int d = 0; d < DoorCount; ++d) { string DoorName = Buffer.ReadFixedLengthString(32, false); float YPos = Buffer.ReadSingle(); float XPos = Buffer.ReadSingle(); float ZPos = Buffer.ReadSingle(); float Heading = Buffer.ReadSingle(); UInt32 Incline = Buffer.ReadUInt32(); Int32 Size = Buffer.ReadInt32(); Buffer.SkipBytes(4); // Skip Unknown Byte DoorID = Buffer.ReadByte(); Byte OpenType = Buffer.ReadByte(); Byte StateAtSpawn = Buffer.ReadByte(); Byte InvertState = Buffer.ReadByte(); Int32 DoorParam = Buffer.ReadInt32(); // Skip past the trailing unknowns in the door struct, moving to the next door in the packet. Buffer.SkipBytes(24); string DestZone = "NONE"; Door NewDoor = new Door(DoorName, YPos, XPos, ZPos, Heading, Incline, Size, DoorID, OpenType, StateAtSpawn, InvertState, DoorParam, DestZone, 0, 0, 0, 0); DoorList.Add(NewDoor); } return DoorList; }
public override List<ZoneEntryStruct> GetSpawns() { List<ZoneEntryStruct> ZoneSpawns = new List<ZoneEntryStruct>(); List<byte[]> SpawnPackets = GetPacketsOfType("OP_ZoneEntry", PacketDirection.ServerToClient); foreach (byte[] SpawnPacket in SpawnPackets) { ZoneEntryStruct NewSpawn = new ZoneEntryStruct(); ByteStream Buffer = new ByteStream(SpawnPacket); NewSpawn.SpawnName = Buffer.ReadString(true); NewSpawn.SpawnName = Utils.MakeCleanName(NewSpawn.SpawnName); NewSpawn.SpawnID = Buffer.ReadUInt32(); NewSpawn.Level = Buffer.ReadByte(); float UnkSize = Buffer.ReadSingle(); NewSpawn.IsNPC = Buffer.ReadByte(); UInt32 Bitfield = Buffer.ReadUInt32(); NewSpawn.Showname = (Bitfield >> 28) & 1; NewSpawn.TargetableWithHotkey = (Bitfield >> 27) & 1; NewSpawn.Targetable = (Bitfield >> 26) & 1; NewSpawn.ShowHelm = (Bitfield >> 24) & 1; NewSpawn.Gender = (Bitfield >> 20) & 3; NewSpawn.Padding5 = (Bitfield >> 4) & 1; NewSpawn.Padding7 = (Bitfield >> 6) & 2047; NewSpawn.Padding26 = (Bitfield >> 25) & 1; Byte OtherData = Buffer.ReadByte(); Buffer.SkipBytes(8); // Skip 8 unknown bytes NewSpawn.DestructableString1 = ""; NewSpawn.DestructableString2 = ""; NewSpawn.DestructableString3 = ""; if ((NewSpawn.IsNPC == 1) && ((OtherData & 3) > 0)) { // Destructable Objects. Not handled yet // //SQLOut(String.Format("-- OBJECT FOUND SpawnID {0}", SpawnID.ToString("x"))); NewSpawn.DestructableString1 = Buffer.ReadString(false); NewSpawn.DestructableString2 = Buffer.ReadString(false); NewSpawn.DestructableString3 = Buffer.ReadString(false); NewSpawn.DestructableUnk1 = Buffer.ReadUInt32(); NewSpawn.DestructableUnk2 = Buffer.ReadUInt32(); NewSpawn.DestructableID1 = Buffer.ReadUInt32(); NewSpawn.DestructableID2 = Buffer.ReadUInt32(); NewSpawn.DestructableID3 = Buffer.ReadUInt32(); NewSpawn.DestructableID4 = Buffer.ReadUInt32(); NewSpawn.DestructableUnk3 = Buffer.ReadUInt32(); NewSpawn.DestructableUnk4 = Buffer.ReadUInt32(); NewSpawn.DestructableUnk5 = Buffer.ReadUInt32(); NewSpawn.DestructableUnk6 = Buffer.ReadUInt32(); NewSpawn.DestructableUnk7 = Buffer.ReadUInt32(); NewSpawn.DestructableUnk8 = Buffer.ReadUInt32(); NewSpawn.DestructableUnk9 = Buffer.ReadUInt32(); NewSpawn.DestructableByte = Buffer.ReadByte(); //SQLOut(String.Format("-- DES: {0,8:x} {1,8:x} {2,8:d} {3,8:d} {4,8:d} {5,8:d} {6,8:x} {7,8:x} {8,8:x} {9,8:x} {10,8:x} {11,8:x} {12,8:x} {13,2:x} {14} {15} {16}", // DestructableUnk1, DestructableUnk2, DestructableID1, DestructableID2, DestructableID3, DestructableID4, // DestructableUnk3, DestructableUnk4, DestructableUnk5, DestructableUnk6, DestructableUnk7, DestructableUnk8, // DestructableUnk9, DestructableByte, DestructableString1, DestructableString2, DestructableString3)); } NewSpawn.Size = Buffer.ReadSingle(); NewSpawn.Face = Buffer.ReadByte(); NewSpawn.WalkSpeed = Buffer.ReadSingle(); NewSpawn.RunSpeed = Buffer.ReadSingle(); NewSpawn.Race = Buffer.ReadUInt32(); NewSpawn.PropCount = Buffer.ReadByte(); NewSpawn.BodyType = 0; if (NewSpawn.PropCount >= 1) { NewSpawn.BodyType = Buffer.ReadUInt32(); for (int j = 1; j < NewSpawn.PropCount; ++j) Buffer.SkipBytes(4); } Buffer.SkipBytes(1); // Skip HP % NewSpawn.HairColor = Buffer.ReadByte(); NewSpawn.BeardColor = Buffer.ReadByte(); NewSpawn.EyeColor1 = Buffer.ReadByte(); NewSpawn.EyeColor2 = Buffer.ReadByte(); NewSpawn.HairStyle = Buffer.ReadByte(); NewSpawn.Beard = Buffer.ReadByte(); NewSpawn.DrakkinHeritage = Buffer.ReadUInt32(); NewSpawn.DrakkinTattoo = Buffer.ReadUInt32(); NewSpawn.DrakkinDetails = Buffer.ReadUInt32(); Buffer.SkipBytes(1); // Skip Holding NewSpawn.Deity = Buffer.ReadUInt32(); Buffer.SkipBytes(8); // Skip GuildID and GuildRank NewSpawn.Class = Buffer.ReadByte(); Buffer.SkipBytes(4); // Skip PVP, Standstate, Light, Flymode NewSpawn.EquipChest2 = Buffer.ReadByte(); bool UseWorn = (NewSpawn.EquipChest2 == 255); Buffer.SkipBytes(2); // 2 Unknown bytes; NewSpawn.Helm = Buffer.ReadByte(); NewSpawn.LastName = Buffer.ReadString(false); Buffer.SkipBytes(5); // AATitle + unknown byte NewSpawn.PetOwnerID = Buffer.ReadUInt32(); Buffer.SkipBytes(25); // Unknown byte + 6 unknown uint32 UInt32 Position1 = Buffer.ReadUInt32(); UInt32 Position2 = Buffer.ReadUInt32(); UInt32 Position3 = Buffer.ReadUInt32(); UInt32 Position4 = Buffer.ReadUInt32(); UInt32 Position5 = Buffer.ReadUInt32(); NewSpawn.YPos = Utils.EQ19ToFloat((Int32)(Position3 & 0x7FFFF)); NewSpawn.Heading = Utils.EQ19ToFloat((Int32)(Position4 & 0xFFF)); NewSpawn.XPos = Utils.EQ19ToFloat((Int32)(Position4 >> 12) & 0x7FFFF); NewSpawn.ZPos = Utils.EQ19ToFloat((Int32)(Position5 & 0x7FFFF)); for (int ColourSlot = 0; ColourSlot < 9; ++ColourSlot) NewSpawn.SlotColour[ColourSlot] = Buffer.ReadUInt32(); NewSpawn.MeleeTexture1 = 0; NewSpawn.MeleeTexture2 = 0; if (NPCType.IsPlayableRace(NewSpawn.Race)) { for (int i = 0; i < 9; ++i) { NewSpawn.Equipment[i] = Buffer.ReadUInt32(); UInt32 Equip1 = Buffer.ReadUInt32(); UInt32 Equip0 = Buffer.ReadUInt32(); } if (NewSpawn.Equipment[Constants.MATERIAL_CHEST] > 0) { NewSpawn.EquipChest2 = (byte)NewSpawn.Equipment[Constants.MATERIAL_CHEST]; } NewSpawn.ArmorTintRed = (byte)((NewSpawn.SlotColour[Constants.MATERIAL_CHEST] >> 16) & 0xff); NewSpawn.ArmorTintGreen = (byte)((NewSpawn.SlotColour[Constants.MATERIAL_CHEST] >> 8) & 0xff); NewSpawn.ArmorTintBlue = (byte)(NewSpawn.SlotColour[Constants.MATERIAL_CHEST] & 0xff); if (NewSpawn.Equipment[Constants.MATERIAL_PRIMARY] > 0) NewSpawn.MeleeTexture1 = NewSpawn.Equipment[Constants.MATERIAL_PRIMARY]; if (NewSpawn.Equipment[Constants.MATERIAL_SECONDARY] > 0) NewSpawn.MeleeTexture2 = NewSpawn.Equipment[Constants.MATERIAL_SECONDARY]; if (UseWorn) NewSpawn.Helm = (byte)NewSpawn.Equipment[Constants.MATERIAL_HEAD]; else NewSpawn.Helm = 0; } else { // Non playable race NewSpawn.MeleeTexture1 = NewSpawn.SlotColour[3]; NewSpawn.MeleeTexture2 = NewSpawn.SlotColour[6]; } if (NewSpawn.EquipChest2 == 255) NewSpawn.EquipChest2 = 0; if (NewSpawn.Helm == 255) NewSpawn.Helm = 0; if ((OtherData & 4) > 0) { NewSpawn.Title = Buffer.ReadString(false); } if ((OtherData & 8) > 0) { NewSpawn.Suffix = Buffer.ReadString(false); } // unknowns Buffer.SkipBytes(8); NewSpawn.IsMercenary = Buffer.ReadByte(); ZoneSpawns.Add(NewSpawn); } return ZoneSpawns; }
public override void ExploreZoneEntry(StreamWriter outputStream, ByteStream buffer, PacketDirection direction) { if (direction != PacketDirection.ServerToClient) return; string Name = buffer.ReadString(false); UInt32 SpawnID = buffer.ReadUInt32(); byte Level = buffer.ReadByte(); buffer.SkipBytes(4); bool IsNPC = (buffer.ReadByte() != 0); UInt32 Bitfield = buffer.ReadUInt32(); string DestructableString1; string DestructableString2; string DestructableString3; UInt32 DestructableUnk1; UInt32 DestructableUnk2; UInt32 DestructableID1; UInt32 DestructableID2; UInt32 DestructableID3; UInt32 DestructableID4; UInt32 DestructableUnk3; UInt32 DestructableUnk4; UInt32 DestructableUnk5; UInt32 DestructableUnk6; UInt32 DestructableUnk7; UInt32 DestructableUnk8; UInt32 DestructableUnk9; byte DestructableByte; Byte OtherData = buffer.ReadByte(); buffer.SkipBytes(8); // Skip 8 unknown bytes DestructableString1 = ""; DestructableString2 = ""; DestructableString3 = ""; outputStream.WriteLine("Spawn Name: {0} ID: {1} Level: {2} {3}\r\n", Name, SpawnID, Level, IsNPC ? "NPC" : "Player"); if ((OtherData & 1) > 0) { // Destructable Objects. DestructableString1 = buffer.ReadString(false); DestructableString2 = buffer.ReadString(false); DestructableString3 = buffer.ReadString(false); DestructableUnk1 = buffer.ReadUInt32(); DestructableUnk2 = buffer.ReadUInt32(); DestructableID1 = buffer.ReadUInt32(); DestructableID2 = buffer.ReadUInt32(); DestructableID3 = buffer.ReadUInt32(); DestructableID4 = buffer.ReadUInt32(); DestructableUnk3 = buffer.ReadUInt32(); DestructableUnk4 = buffer.ReadUInt32(); DestructableUnk5 = buffer.ReadUInt32(); DestructableUnk6 = buffer.ReadUInt32(); DestructableUnk7 = buffer.ReadUInt32(); DestructableUnk8 = buffer.ReadUInt32(); DestructableUnk9 = buffer.ReadUInt32(); DestructableByte = buffer.ReadByte(); outputStream.WriteLine("DESTRUCTABLE OBJECT:\r\n"); outputStream.WriteLine(" String1: {0}", DestructableString1); outputStream.WriteLine(" String2: {0}", DestructableString2); outputStream.WriteLine(" String3: {0}\r\n", DestructableString3); outputStream.WriteLine(" Unk1: {0,8:x} Unk2: {1,8:x}\r\n ID1 : {2,8:x} ID2 : {3,8:x} ID3 : {4,8:x} ID4 : {5,8:x}\r\n Unk3: {6,8:x} Unk4: {7,8:x} Unk5: {8,8:x} Unk6: {9,8:x}\r\n Unk7: {10,8:x} Unk8: {11,8:x} Unk9: {12,8:x}\r\n UnkByte: {13,2:x}", DestructableUnk1, DestructableUnk2, DestructableID1, DestructableID2, DestructableID3, DestructableID4, DestructableUnk3, DestructableUnk4, DestructableUnk5, DestructableUnk6, DestructableUnk7, DestructableUnk8, DestructableUnk9, DestructableByte); } buffer.SkipBytes(17); byte PropCount = buffer.ReadByte(); if (PropCount >= 1) { buffer.SkipBytes(4); for (int j = 1; j < PropCount; ++j) buffer.SkipBytes(4); } byte HP = buffer.ReadByte(); outputStream.WriteLine("HP% is {0}\r\n", HP); AddExplorerSpawn(SpawnID, Name); }
public override void ExploreZoneEntry(StreamWriter outputStream, ByteStream buffer, PacketDirection direction) { if (direction != PacketDirection.ServerToClient) return; string FirstName = buffer.ReadString(false); outputStream.WriteLine("Name = {0}", FirstName); UInt32 SpawnID = buffer.ReadUInt32(); outputStream.WriteLine("SpawnID = {0}", SpawnID); byte Level = buffer.ReadByte(); outputStream.WriteLine("Level = {0}", Level); buffer.SkipBytes(4); byte IsNPC = buffer.ReadByte(); outputStream.WriteLine("IsNPC = {0}", IsNPC); UInt32 Bitfield = buffer.ReadUInt32(); outputStream.WriteLine("Name: {0}, Bitfield: {1}", FirstName, Convert.ToString(Bitfield, 2)); byte OtherData = buffer.ReadByte(); outputStream.WriteLine("OtherData = {0}", OtherData); buffer.SkipBytes(8); if ((OtherData & 1) > 0) { outputStream.WriteLine("OD: {0}", buffer.ReadString(false)); outputStream.WriteLine("OD: {0}", buffer.ReadString(false)); outputStream.WriteLine("OD: {0}", buffer.ReadString(false)); buffer.SkipBytes(53); } if ((OtherData & 4) > 0) { outputStream.WriteLine("Aura: {0}", buffer.ReadString(false)); outputStream.WriteLine("Aura: {0}", buffer.ReadString(false)); buffer.SkipBytes(54); } byte Properties = buffer.ReadByte(); outputStream.WriteLine("Properties = {0}, Offset now {1}", Properties, buffer.GetPosition()); UInt32 BodyType = 0; if(Properties > 0) BodyType = buffer.ReadUInt32(); outputStream.WriteLine("Bodytype = {0}", BodyType); if (Properties != 1) outputStream.WriteLine("XXXX Properties is {0}", Properties); for (int i = 1; i < Properties; ++i) outputStream.WriteLine(" Prop: {0}", buffer.ReadUInt32()); outputStream.WriteLine("Position is now {0}", buffer.GetPosition()); byte HP = buffer.ReadByte(); byte HairColor = buffer.ReadByte(); byte BeardColor = buffer.ReadByte(); byte Eye1 = buffer.ReadByte(); byte Eye2 = buffer.ReadByte(); byte HairStyle = buffer.ReadByte(); byte BeardStyle = buffer.ReadByte(); outputStream.WriteLine("Beardstyle is {0}", BeardStyle); buffer.SkipBytes(12); // Drakkin stuff byte EquipChest2 = buffer.ReadByte(); buffer.SkipBytes(2); byte Helm = buffer.ReadByte(); float Size = buffer.ReadSingle(); byte Face = buffer.ReadByte(); float WalkSpeed = buffer.ReadSingle(); float RunSpeed = buffer.ReadSingle(); UInt32 Race = buffer.ReadUInt32(); outputStream.WriteLine("Size: {0}, Face: {1}, Walkspeed: {2}, RunSpeed: {3}, Race: {4}", Size, Face, WalkSpeed, RunSpeed, Race); //Buffer.SkipBytes(18); buffer.SkipBytes(5); UInt32 GuildID = buffer.ReadUInt32(); UInt32 GuildRank = buffer.ReadUInt32(); buffer.SkipBytes(5); outputStream.WriteLine("GuildID: {0}, Guild Rank: {1}", GuildID, GuildRank); buffer.ReadString(false); buffer.SkipBytes(35); if ((IsNPC == 0) || NPCType.IsPlayableRace(Race)) { for (int ColourSlot = 0; ColourSlot < 9; ++ColourSlot) outputStream.WriteLine("Color {0} is {1}", ColourSlot, buffer.ReadUInt32()); for (int i = 0; i < 9; ++i) { UInt32 Equip3 = buffer.ReadUInt32(); UInt32 Equipx = buffer.ReadUInt32(); UInt32 Equip2 = buffer.ReadUInt32(); UInt32 Equip1 = buffer.ReadUInt32(); UInt32 Equip0 = buffer.ReadUInt32(); outputStream.WriteLine("Equip slot {0}: 0,1,2,x,3 is {1}, {2}, {3}, {4}, {5}", i, Equip0, Equip1, Equip2, Equipx, Equip3); } } else { // Non playable race // Melee Texture 1 is 20 bytes in // Melee Texture 1 is 40 bytes in // This whole segment is 28 + 24 + 8 = 60 // Skip 20, Read m1, skip 16, read m2, skip 16 /* OutputStream.WriteLine("None playable race, offset now {0}", Buffer.GetPosition()); Buffer.SkipBytes(28); UInt32 MeleeTexture1 = Buffer.ReadUInt32(); Buffer.SkipBytes(12); UInt32 MeleeTexture2 = Buffer.ReadUInt32(); Buffer.SkipBytes(12); */ outputStream.WriteLine("None playable race, offset now {0}", buffer.GetPosition()); buffer.SkipBytes(20); UInt32 MeleeTexture1 = buffer.ReadUInt32(); buffer.SkipBytes(16); UInt32 MeleeTexture2 = buffer.ReadUInt32(); buffer.SkipBytes(16); } outputStream.WriteLine("Position starts at offset {0}", buffer.GetPosition()); UInt32 Position1 = buffer.ReadUInt32(); UInt32 Position2 = buffer.ReadUInt32(); UInt32 Position3 = buffer.ReadUInt32(); UInt32 Position4 = buffer.ReadUInt32(); UInt32 Position5 = buffer.ReadUInt32(); float YPos = Utils.EQ19ToFloat((Int32)(Position1 >> 12)); float ZPos = Utils.EQ19ToFloat((Int32)(Position3 >> 13) & 0x7FFFF); float XPos = Utils.EQ19ToFloat((Int32)(Position4) & 0x7FFFF); float Heading = Utils.EQ19ToFloat((Int32)(Position5) & 0x7FFFF); outputStream.WriteLine("(X,Y,Z) = {0}, {1}, {2}, Heading = {3}", XPos, YPos, ZPos, Heading); if((OtherData & 16) > 1) outputStream.WriteLine("Title: {0}", buffer.ReadString(false)); if ((OtherData & 32) > 1) outputStream.WriteLine("Suffix: {0}", buffer.ReadString(false)); buffer.SkipBytes(8); byte IsMerc = buffer.ReadByte(); outputStream.WriteLine("IsMerc: {0}", IsMerc); buffer.SkipBytes(54); outputStream.WriteLine("Buffer Length: {0}, Current Position: {1}", buffer.Length(), buffer.GetPosition()); if (buffer.Length() != buffer.GetPosition()) outputStream.WriteLine("PARSE ERROR"); outputStream.WriteLine(""); }
public override void ExploreMobUpdate(StreamWriter outputStream, ByteStream buffer, PacketDirection direction) { UInt32 SpawnID = buffer.ReadUInt16(); buffer.SkipBytes(2); UInt32 Word1 = buffer.ReadUInt32(); UInt32 Word2 = buffer.ReadUInt32(); UInt16 Word3 = buffer.ReadUInt16(); float y = Utils.EQ19ToFloat((Int32)(Word1 & 0x7FFFF)); // Z is in the top 13 bits of Word1 and the bottom 6 of Word2 UInt32 ZPart1 = Word1 >> 19; // ZPart1 now has low order bits of Z in bottom 13 bits UInt32 ZPart2 = Word2 & 0x3F; // ZPart2 now has high order bits of Z in bottom 6 bits ZPart2 = ZPart2 << 13; float z = Utils.EQ19ToFloat((Int32)(ZPart1 | ZPart2)); float x = Utils.EQ19ToFloat((Int32)(Word2 >> 6) & 0x7FFFF); float heading = Utils.EQ19ToFloat((Int32)(Word3 & 0xFFF)); outputStream.WriteLine("Spawn: {0} XYZ: {1}, {2}, {3}, Heading: {4}", SpawnID, x, y, z, heading); }
public override void DecodeItemPacket(StreamWriter outputStream, ByteStream buffer, PacketDirection direction) { String UnkString = buffer.ReadString(false); //Buffer.SkipBytes(88); buffer.SkipBytes(35); UInt32 RecastTimer = buffer.ReadUInt32(); buffer.SkipBytes(49); String ItemName = buffer.ReadString(false); String ItemLore = buffer.ReadString(false); String ItemIDFile = buffer.ReadString(false); buffer.ReadString(false); UInt32 ItemID = buffer.ReadUInt32(); outputStream.WriteLine("ItemName: {0}, IDFile: {1}", ItemName, ItemIDFile); outputStream.WriteLine("Recast Time: {0:X}", RecastTimer); buffer.SkipBytes(251); String CharmFile = buffer.ReadString(false); outputStream.WriteLine("CharmFile: {0}", CharmFile); buffer.SkipBytes(74); // Secondary BS String FileName = buffer.ReadString(false); outputStream.WriteLine("FileName: {0}", CharmFile); buffer.SkipBytes(76); // Tertiary BS UInt32 ClickEffect = buffer.ReadUInt32(); //Buffer.SkipBytes(26); // ClickEffect Struct //OutputStream.WriteLine("Click Effect - effect : {0}", Buffer.ReadUInt32()); outputStream.WriteLine("Click Effect - level2 : {0}", buffer.ReadByte()); outputStream.WriteLine("Click Effect - Type : {0}", buffer.ReadUInt32()); outputStream.WriteLine("Click Effect - level : {0}", buffer.ReadByte()); outputStream.WriteLine("Click Effect - Max Charges : {0}", buffer.ReadUInt32()); outputStream.WriteLine("Click Effect - Cast Time : {0}", buffer.ReadUInt32()); outputStream.WriteLine("Click Effect - Recast : {0}", buffer.ReadUInt32()); outputStream.WriteLine("Click Effect - Recast Type: {0}", buffer.ReadUInt32()); outputStream.WriteLine("Click Effect - Unk5: {0}", buffer.ReadUInt32()); String ClickName = buffer.ReadString(false); outputStream.WriteLine("ClickEffect = {0}, ClickName = {1}", ClickEffect, ClickName); buffer.ReadUInt32(); ClickEffect = buffer.ReadUInt32(); buffer.SkipBytes(26); // ClickEffect Struct ClickName = buffer.ReadString(false); outputStream.WriteLine("ClickEffect = {0}, ClickName = {1}", ClickEffect, ClickName); buffer.ReadUInt32(); ClickEffect = buffer.ReadUInt32(); buffer.SkipBytes(26); // ClickEffect Struct ClickName = buffer.ReadString(false); outputStream.WriteLine("ClickEffect = {0}, ClickName = {1}", ClickEffect, ClickName); buffer.ReadUInt32(); ClickEffect = buffer.ReadUInt32(); buffer.SkipBytes(26); // ClickEffect Struct ClickName = buffer.ReadString(false); outputStream.WriteLine("ClickEffect = {0}, ClickName = {1}", ClickEffect, ClickName); buffer.ReadUInt32(); ClickEffect = buffer.ReadUInt32(); buffer.SkipBytes(26); // ClickEffect Struct ClickName = buffer.ReadString(false); outputStream.WriteLine("ClickEffect = {0}, ClickName = {1}", ClickEffect, ClickName); buffer.ReadUInt32(); ClickEffect = buffer.ReadUInt32(); buffer.SkipBytes(26); // ClickEffect Struct ClickName = buffer.ReadString(false); outputStream.WriteLine("ClickEffect = {0}, ClickName = {1}", ClickEffect, ClickName); buffer.ReadUInt32(); //Buffer.SkipBytes(167); buffer.SkipBytes(125); //Byte UnkByte = Buffer.ReadByte(); //OutputStream.WriteLine("Unk byte is {0:X}", UnkByte); outputStream.WriteLine("At String ? Pos is {0}", buffer.GetPosition()); UnkString = buffer.ReadString(false); outputStream.WriteLine("Unk String is {0}", UnkString); buffer.SkipBytes(41); UInt32 SubItemCount = buffer.ReadUInt32(); outputStream.WriteLine("Buffer Pos: {0}, SubItemCount = {1}", buffer.GetPosition(), SubItemCount); for (int j = 0; j < SubItemCount; ++j) { buffer.ReadUInt32(); DecodeItemPacket(outputStream, buffer, direction); } }
public override void ExplorePlayerProfile(StreamWriter outputStream, ByteStream buffer, PacketDirection direction) { outputStream.WriteLine("{0, -5}: Checksum = {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: ChecksumSize = {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown = {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown = {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine(""); outputStream.WriteLine("{0, -5}: Gender = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Race = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Class = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Level = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Level1 = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine(""); UInt32 BindCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: BindCount = {1}", buffer.GetPosition() - 4, BindCount); for (int i = 0; i < BindCount; ++i) { outputStream.WriteLine("{0, -5}: Bind: {1} Zone: {2} XYZ: {3},{4},{5} Heading: {6}", buffer.GetPosition(), i, buffer.ReadUInt32(), buffer.ReadSingle(), buffer.ReadSingle(), buffer.ReadSingle(), buffer.ReadSingle()); } outputStream.WriteLine(""); outputStream.WriteLine("{0, -5}: Deity = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Intoxication = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine(""); //Buffer.SkipBytes(8); // Deity, intoxication UInt32 UnknownCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown Count = {1}", buffer.GetPosition() - 4, UnknownCount); for (int i = 0; i < UnknownCount; ++i) { outputStream.WriteLine("{0, -5}: Unknown : {1}, Value = {2}", buffer.GetPosition(), i, buffer.ReadUInt32()); //Buffer.SkipBytes(4); } UInt32 EquipmentCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: EquipmentCount = {1}", buffer.GetPosition() - 4, EquipmentCount); for (int i = 0; i < EquipmentCount; ++i) { outputStream.Write("{0, -5}: Equip: {1} Values: ", buffer.GetPosition(), i); for (int j = 0; j < 5; ++j) outputStream.Write("{0} ", buffer.ReadUInt32()); outputStream.WriteLine(""); //Buffer.SkipBytes(20); } UInt32 EquipmentCount2 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: EquipmentCount2 = {1}", buffer.GetPosition() - 4, EquipmentCount2); for (int i = 0; i < EquipmentCount2; ++i) { outputStream.Write("{0, -5}: Equip2: {1} Values: ", buffer.GetPosition(), i); for (int j = 0; j < 5; ++j) outputStream.Write("{0} ", buffer.ReadUInt32()); outputStream.WriteLine(""); //Buffer.SkipBytes(20); } UInt32 TintCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: TintCount = {1}", buffer.GetPosition() - 4, TintCount); for (int i = 0; i < TintCount; ++i) { outputStream.WriteLine("{0, -5}: TintCount : {1}, Value = {2}", buffer.GetPosition(), i, buffer.ReadUInt32()); //Buffer.SkipBytes(4); } UInt32 TintCount2 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: TintCount2 = {1}", buffer.GetPosition() - 4, TintCount2); for (int i = 0; i < TintCount; ++i) { outputStream.WriteLine("{0, -5}: TintCount2 : {1}, Value = {2}", buffer.GetPosition(), i, buffer.ReadUInt32()); //Buffer.SkipBytes(4); } outputStream.WriteLine("{0, -5}: Hair Color = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Beard Color = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Eye1 Color = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Eye2 Color = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Hairstyle = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Beard = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Face = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Drakkin Heritage = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Drakkin Tattoo = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Drakkin Details = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Height = {1}", buffer.GetPosition(), buffer.ReadSingle()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadSingle()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadSingle()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadSingle()); outputStream.WriteLine("{0, -5}: Primary = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Secondary = {1}", buffer.GetPosition(), buffer.ReadUInt32()); //Buffer.SkipBytes(52); // Per SEQ, this looks like face, haircolor, beardcolor etc. outputStream.WriteLine("{0, -5}: Unspent Skill Points = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Mana = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Current HP = {1}", buffer.GetPosition(), buffer.ReadUInt32()); //UInt32 Points = Buffer.ReadUInt32(); //UInt32 Mana = Buffer.ReadUInt32(); //UInt32 CurHP = Buffer.ReadUInt32(); //OutputStream.WriteLine("Points, Mana, CurHP = {0}, {1}, {2}", Points, Mana, CurHP); outputStream.WriteLine("{0, -5}: STR = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: STA = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: CHA = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: DEX = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: INT = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: AGI = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: WIS = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadUInt32()); //Buffer.SkipBytes(28); //Buffer.SkipBytes(28); UInt32 AACount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: AA Count = {1}", buffer.GetPosition() - 4, AACount); for (int i = 0; i < AACount; ++i) { outputStream.WriteLine(" AA: {0}, Value: {1}, Unknown08: {2}", buffer.ReadUInt32(), buffer.ReadUInt32(), buffer.ReadUInt32()); //Buffer.SkipBytes(12); } UInt32 SkillCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Skill Count = {1}", buffer.GetPosition() - 4, SkillCount); for (int i = 0; i < SkillCount; ++i) { buffer.SkipBytes(4); } UInt32 SomethingCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Something Count = {1}", buffer.GetPosition() - 4, SomethingCount); for (int i = 0; i < SomethingCount; ++i) { //Buffer.SkipBytes(4); outputStream.WriteLine("Something {0} : {1}", i, buffer.ReadUInt32()); } UInt32 DisciplineCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Discipline Count = {1}", buffer.GetPosition() - 4, DisciplineCount); for (int i = 0; i < DisciplineCount; ++i) { buffer.SkipBytes(4); } UInt32 TimeStampCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: TimeStamp Count = {1}", buffer.GetPosition() - 4, TimeStampCount); for (int i = 0; i < TimeStampCount; ++i) { //Buffer.SkipBytes(4); outputStream.WriteLine("Timestamp {0} : {1}", i, buffer.ReadUInt32()); } System.DateTime dateTime; UInt32 RecastCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Recast Count = {1}", buffer.GetPosition() - 4, RecastCount); for (int i = 0; i < RecastCount; ++i) { //Buffer.SkipBytes(4); UInt32 TimeStamp = buffer.ReadUInt32(); dateTime = new System.DateTime(1970, 1, 1, 0, 0, 0, 0); dateTime = dateTime.AddSeconds(TimeStamp); outputStream.WriteLine("Recast {0} : {1} {2}", i, TimeStamp, dateTime.ToString()); } UInt32 TimeStamp2Count = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: TimeStamp2 Count = {1}", buffer.GetPosition() - 4, TimeStamp2Count); for (int i = 0; i < TimeStamp2Count; ++i) { //Buffer.SkipBytes(4); UInt32 TimeStamp = buffer.ReadUInt32(); dateTime = new System.DateTime(1970, 1, 1, 0, 0, 0, 0); dateTime = dateTime.AddSeconds(TimeStamp); outputStream.WriteLine("Timestamp {0} : {1} {2}", i, TimeStamp, dateTime.ToString()); } UInt32 SpellBookSlots = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: SpellBookSlot Count = {1}", buffer.GetPosition() - 4, SpellBookSlots); for (int i = 0; i < SpellBookSlots; ++i) { buffer.SkipBytes(4); } UInt32 SpellMemSlots = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Spell Mem Count = {1}", buffer.GetPosition() - 4, SpellMemSlots); for (int i = 0; i < SpellMemSlots; ++i) { buffer.SkipBytes(4); } SomethingCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown Count = {1}", buffer.GetPosition() - 4, SomethingCount); for (int i = 0; i < SomethingCount; ++i) { //Buffer.SkipBytes(4); outputStream.WriteLine("Unknown {0} : {1}", i, buffer.ReadUInt32()); } outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadByte()); UInt32 BuffCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Buff Count = {1}", buffer.GetPosition() - 4, BuffCount); for (int i = 0; i < BuffCount; ++i) { buffer.ReadByte(); float UnkFloat = buffer.ReadSingle(); UInt32 PlayerID = buffer.ReadUInt32(); Byte UnkByte = buffer.ReadByte(); UInt32 Counters1 = buffer.ReadUInt32(); UInt32 Duration = buffer.ReadUInt32(); Byte Level = buffer.ReadByte(); UInt32 SpellID = buffer.ReadUInt32(); UInt32 SlotID = buffer.ReadUInt32(); buffer.SkipBytes(5); UInt32 Counters2 = buffer.ReadUInt32(); outputStream.WriteLine("Sl: {0}, UF: {1}, PID: {2}, UByte: {3}, Cnt1: {4}, Dur: {5}, Lvl: {6} SpellID: {7}, SlotID: {8}, Cnt2: {9}", i, UnkFloat, PlayerID, UnkByte, Counters1, Duration, Level, SpellID, SlotID, Counters2); buffer.SkipBytes(44); } outputStream.WriteLine("{0, -5}: Plat = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Gold = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Silver = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Copper = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Plat Cursor = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Gold Cursor = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Silver Cursor = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Copper Cursor = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Toxicity? = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Thirst? = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Hunger? = {1}", buffer.GetPosition(), buffer.ReadUInt32()); //Buffer.SkipBytes(20); outputStream.WriteLine("{0, -5}: AA Spent = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: AA Point Count? = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: AA Assigned = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: AA Spent General = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: AA Spent Archetype = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: AA Spent Class = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: AA Spent Special = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: AA Unspent = {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown", buffer.GetPosition(), buffer.ReadUInt16()); //Buffer.SkipBytes(30); UInt32 BandolierCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Bandolier Count = {1}", buffer.GetPosition() - 4, BandolierCount); for (int i = 0; i < BandolierCount; ++i) { buffer.ReadString(false); buffer.ReadString(false); buffer.SkipBytes(8); buffer.ReadString(false); buffer.SkipBytes(8); buffer.ReadString(false); buffer.SkipBytes(8); buffer.ReadString(false); buffer.SkipBytes(8); } UInt32 PotionCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Potion Count = {1}", buffer.GetPosition() - 4, PotionCount); for (int i = 0; i < PotionCount; ++i) { buffer.ReadString(false); buffer.SkipBytes(8); } outputStream.WriteLine("{0, -5}: Unknown {1}", buffer.GetPosition(), buffer.ReadInt32()); outputStream.WriteLine("{0, -5}: Item HP Total? {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Endurance Total? {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Mana Total? {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Expansion Count {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); UInt32 NameLength = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Name Length: {1}", buffer.GetPosition() - 4, NameLength); int CurrentPosition = buffer.GetPosition(); outputStream.WriteLine("{0, -5}: Name: {1}", buffer.GetPosition(), buffer.ReadString(false)); buffer.SetPosition(CurrentPosition + (int)NameLength); UInt32 LastNameLength = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: LastName Length: {1}", buffer.GetPosition() - 4, LastNameLength); CurrentPosition = buffer.GetPosition(); outputStream.WriteLine("{0, -5}: Last Name: {1}", buffer.GetPosition(), buffer.ReadString(false)); buffer.SetPosition(CurrentPosition + (int)LastNameLength); outputStream.WriteLine("{0, -5}: Birthday {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Account Start Date {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Last Login Date {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Time Played Minutes {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Time Entitled On Account {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Expansions {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); UInt32 LanguageCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Language Count = {1}", buffer.GetPosition() - 4, LanguageCount); for (int i = 0; i < LanguageCount; ++i) { buffer.SkipBytes(1); } outputStream.WriteLine("{0, -5}: Zone ID {1}", buffer.GetPosition(), buffer.ReadUInt16()); outputStream.WriteLine("{0, -5}: Zone Instance {1}", buffer.GetPosition(), buffer.ReadUInt16()); outputStream.WriteLine("{0, -5}: Y,X,Z {1},{2},{3} Heading: {4}", buffer.GetPosition(), buffer.ReadSingle(), buffer.ReadSingle(), buffer.ReadSingle(), buffer.ReadSingle()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: GuildID? {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Experience {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Bank Plat {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Bank Gold {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Bank Silver {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Bank Copper {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); UInt32 Unknown42 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown, value 42? {1}", buffer.GetPosition() - 4, Unknown42); buffer.SkipBytes((int)(Unknown42 * 8)); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Career Tribute Favour {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Current Tribute Favour {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); UInt32 PersonalTributeCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Personal Tribute Count {1}", buffer.GetPosition() - 4, PersonalTributeCount); buffer.SkipBytes((int)(PersonalTributeCount * 8)); UInt32 GuildTributeCount = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Guild Tribute Count {1}", buffer.GetPosition() - 4, GuildTributeCount); buffer.SkipBytes((int)(GuildTributeCount * 8)); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("Skipping 121 bytes starting at offset {0}", buffer.GetPosition()); buffer.SkipBytes(121); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("Position now {0}", buffer.GetPosition()); UInt32 Unknown64 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown64 {1}", buffer.GetPosition() - 4, Unknown64); buffer.SkipBytes((int)Unknown64); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); Unknown64 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown64 {1}", buffer.GetPosition() - 4, Unknown64); buffer.SkipBytes((int)Unknown64); Unknown64 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown64 {1}", buffer.GetPosition() - 4, Unknown64); buffer.SkipBytes((int)Unknown64); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("Skipping 320 bytes starting at offset {0}", buffer.GetPosition()); buffer.SkipBytes(320); outputStream.WriteLine("Skipping 343 bytes starting at offset {0}", buffer.GetPosition()); buffer.SkipBytes(343); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); UInt32 Unknown6 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown6 {1} LDON Stuff ?", buffer.GetPosition() - 4, Unknown6); for (int i = 0; i < Unknown6; ++i) outputStream.WriteLine("{0, -5}: Unknown LDON? {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); Unknown64 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown64 {1}", buffer.GetPosition() - 4, Unknown64); buffer.SkipBytes((int)Unknown64 * 4); // Air remaining ? outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); // Next 7 could be PVP stats, outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); // PVP LastKill struct ? outputStream.WriteLine("Skipping string + 24 bytes starting at offset {0}", buffer.GetPosition()); //Buffer.SkipBytes(25); Byte b; do { b = buffer.ReadByte(); } while (b != 0); buffer.SkipBytes(24); // PVP LastDeath struct ? outputStream.WriteLine("Skipping string + 24 bytes starting at offset {0}", buffer.GetPosition()); //Buffer.SkipBytes(25); do { b = buffer.ReadByte(); } while (b != 0); buffer.SkipBytes(24); // PVP Number of Kills in Last 24 hours ? outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); UInt32 Unknown50 = buffer.ReadUInt32(); outputStream.WriteLine("{0, -5}: Unknown50 {1}", buffer.GetPosition() - 4, Unknown50); // PVP Recent Kills ? outputStream.WriteLine("Skipping 50 x (String + 24 bytes) starting at offset {0}", buffer.GetPosition()); //Buffer.SkipBytes(1338); for (int i = 0; i < 50; ++i) { do { b = buffer.ReadByte(); } while (b != 0); buffer.SkipBytes(24); } // outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Group autoconsent? {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Raid autoconsent? {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Guild autoconsent? {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: Level3? {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Showhelm? {1}", buffer.GetPosition(), buffer.ReadByte()); outputStream.WriteLine("{0, -5}: RestTimer? {1}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("Skipping 1028 bytes starting at offset {0}", buffer.GetPosition()); buffer.SkipBytes(1028); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("{0, -5}: Unknown {1:X}", buffer.GetPosition(), buffer.ReadUInt32()); outputStream.WriteLine("Pointer is {0} bytes from end.", buffer.Length() - buffer.GetPosition()); }
public override List<PositionUpdate> GetClientMovementUpdates() { List<PositionUpdate> Updates = new List<PositionUpdate>(); List<EQApplicationPacket> PacketList = Packets.PacketList; UInt32 OP_ClientUpdate = OpManager.OpCodeNameToNumber("OP_ClientUpdate"); foreach (EQApplicationPacket UpdatePacket in PacketList) { if ((UpdatePacket.OpCode != OP_ClientUpdate) || (UpdatePacket.Direction != PacketDirection.ClientToServer)) continue; ByteStream Buffer = new ByteStream(UpdatePacket.Buffer); PositionUpdate PosUpdate = new PositionUpdate(); PosUpdate.SpawnID = Buffer.ReadUInt16(); Buffer.SkipBytes(6); PosUpdate.p.x = Buffer.ReadSingle(); PosUpdate.p.y = Buffer.ReadSingle(); Buffer.SkipBytes(12); PosUpdate.p.z = Buffer.ReadSingle(); PosUpdate.p.TimeStamp = UpdatePacket.PacketTime; Buffer.SkipBytes(4); UInt32 Temp = Buffer.ReadUInt32(); Temp = Temp & 0x3FFFFF; Temp = Temp >> 10; PosUpdate.p.heading = Utils.EQ19ToFloat((Int32)(Temp)); Updates.Add(PosUpdate); } return Updates; }
public override bool DumpAAs(string fileName) { List<byte[]> AAPackets = GetPacketsOfType("OP_SendAATable", PacketDirection.ServerToClient); if (AAPackets.Count < 1) return false; StreamWriter OutputFile; try { OutputFile = new StreamWriter(fileName); } catch { return false; } OutputFile.WriteLine("-- There are " + AAPackets.Count + " OP_SendAATable packets."); OutputFile.WriteLine(""); foreach (byte[] Packet in AAPackets) { ByteStream Buffer = new ByteStream(Packet); UInt32 AAID = Buffer.ReadUInt32(); byte Unknown004 = Buffer.ReadByte(); UInt32 HotKeySID = Buffer.ReadUInt32(); UInt32 HotKeySID2 = Buffer.ReadUInt32(); UInt32 TitleSID = Buffer.ReadUInt32(); UInt32 DescSID = Buffer.ReadUInt32(); UInt32 ClassType = Buffer.ReadUInt32(); UInt32 Cost = Buffer.ReadUInt32(); UInt32 Seq = Buffer.ReadUInt32(); UInt32 CurrentLevel = Buffer.ReadUInt32(); UInt32 unknown037 = Buffer.ReadUInt32(); UInt32 PreReqSkill = Buffer.ReadUInt32(); UInt32 unknown045 = Buffer.ReadUInt32(); UInt32 PreReqMinPoint = Buffer.ReadUInt32(); UInt32 Type = Buffer.ReadUInt32(); UInt32 SpellID = Buffer.ReadUInt32(); UInt32 Unknown057 = Buffer.ReadUInt32(); UInt32 SpellType = Buffer.ReadUInt32(); UInt32 SpellRefresh = Buffer.ReadUInt32(); UInt16 Classes = Buffer.ReadUInt16(); UInt16 Berserker = Buffer.ReadUInt16(); UInt32 MaxLevel = Buffer.ReadUInt32(); UInt32 LastID = Buffer.ReadUInt32(); UInt32 NextID = Buffer.ReadUInt32(); UInt32 Cost2 = Buffer.ReadUInt32(); Buffer.SkipBytes(7); UInt32 AAExpansion = Buffer.ReadUInt32(); UInt32 SpecialCategory = Buffer.ReadUInt32(); Buffer.SkipBytes(8); UInt32 TotalAbilities = Buffer.ReadUInt32(); OutputFile.WriteLine(String.Format("AAID: {0}", AAID)); OutputFile.WriteLine(" Unknown004:\t" + Unknown004); OutputFile.WriteLine(" HotkeySID:\t" + HotKeySID); OutputFile.WriteLine(" HotkeySID2:\t" + HotKeySID2); OutputFile.WriteLine(" TitleSID:\t" + TitleSID); OutputFile.WriteLine(" DescSID:\t" + DescSID); OutputFile.WriteLine(" ClassType:\t" + ClassType); OutputFile.WriteLine(" Cost:\t\t" + Cost); OutputFile.WriteLine(" Seq:\t\t" + Seq); OutputFile.WriteLine(" CurrentLevel:\t" + CurrentLevel); OutputFile.WriteLine(" Unknown037:\t" + unknown037); OutputFile.WriteLine(" Unknown045:\t" + unknown045); OutputFile.Write(" PreReqSkill (SEQs):\t"); OutputFile.Write("{0} ", PreReqSkill); OutputFile.WriteLine(""); OutputFile.Write(" PreReqSkills MinPoints:\t"); OutputFile.Write("{0} ", PreReqMinPoint); OutputFile.WriteLine(""); OutputFile.WriteLine(" Type:\t\t" + Type); OutputFile.WriteLine(" SpellID:\t" + SpellID); OutputFile.WriteLine(" Unknown057:\t" + Unknown057); OutputFile.WriteLine(" SpellType:\t" + SpellType); OutputFile.WriteLine(" SpellRefresh:\t" + SpellRefresh); OutputFile.WriteLine(" Classes:\t" + Classes); OutputFile.WriteLine(" Berserker:\t" + Berserker); OutputFile.WriteLine(" MaxLevel:\t" + MaxLevel); OutputFile.WriteLine(" LastID:\t" + LastID); OutputFile.WriteLine(" NextID:\t" + NextID); OutputFile.WriteLine(" Cost2:\t\t" + Cost2); OutputFile.WriteLine(" AAExpansion:\t" + AAExpansion); OutputFile.WriteLine(" SpecialCat:\t" + SpecialCategory); OutputFile.WriteLine(""); OutputFile.WriteLine(" TotalAbilities:\t" + TotalAbilities); OutputFile.WriteLine(""); for (int i = 0; i < TotalAbilities; ++i) { UInt32 Ability = Buffer.ReadUInt32(); Int32 Base1 = Buffer.ReadInt32(); Int32 Base2 = Buffer.ReadInt32(); UInt32 Slot = Buffer.ReadUInt32(); OutputFile.WriteLine(String.Format(" Ability:\t{0}\tBase1:\t{1}\tBase2:\t{2}\tSlot:\t{3}", Ability, Base1, Base2, Slot)); } OutputFile.WriteLine(""); OutputFile.Flush(); } OutputFile.Close(); return true; }
public override List<GroundSpawnStruct> GetGroundSpawns() { List<GroundSpawnStruct> GroundSpawns = new List<GroundSpawnStruct>(); List<byte[]> GroundSpawnPackets = GetPacketsOfType("OP_GroundSpawn", PacketDirection.ServerToClient); foreach (byte[] GroundSpawnPacket in GroundSpawnPackets) { GroundSpawnStruct GroundSpawn = new GroundSpawnStruct(); ByteStream Buffer = new ByteStream(GroundSpawnPacket); GroundSpawn.DropID = Buffer.ReadUInt32(); GroundSpawn.Name = Buffer.ReadString(false); GroundSpawn.ZoneID = Buffer.ReadUInt16(); GroundSpawn.InstanceID = Buffer.ReadUInt16(); Buffer.SkipBytes(8); // Two unknown uint32s GroundSpawn.Heading = Buffer.ReadSingle(); Buffer.SkipBytes(12); // First float is 255 to make some groundspawns appear, second 4 bytes unknown, last is a float GroundSpawn.y = Buffer.ReadSingle(); GroundSpawn.x = Buffer.ReadSingle(); GroundSpawn.z = Buffer.ReadSingle(); GroundSpawn.ObjectType = Buffer.ReadUInt32(); GroundSpawns.Add(GroundSpawn); } return GroundSpawns; }
//See SpawnShell.cpp int32_t SpawnShell::fillSpawnStruct(spawnStruct *spawn, const uint8_t *data, size_t len, bool checkLen)? public override void ExploreZoneEntry(StreamWriter outputStream, ByteStream buffer, PacketDirection direction) { if (direction != PacketDirection.ServerToClient) return; try { string FirstName = buffer.ReadString(false); outputStream.WriteLine("Name = {0}", FirstName); UInt32 SpawnID = buffer.ReadUInt32(); outputStream.WriteLine("SpawnID = {0}", SpawnID); byte Level = buffer.ReadByte(); outputStream.WriteLine("Level = {0}", Level); buffer.SkipBytes(4); byte IsNPC = buffer.ReadByte(); outputStream.WriteLine("IsNPC = {0}", IsNPC); UInt32 Bitfield = buffer.ReadUInt32(); outputStream.WriteLine("Name: {0}, Bitfield: {1}", FirstName, Convert.ToString(Bitfield, 2)); byte OtherData = buffer.ReadByte(); outputStream.WriteLine("OtherData = {0}", OtherData); buffer.SkipBytes(8); if ((OtherData & 1) > 0) { outputStream.WriteLine("OD: {0}", buffer.ReadString(false)); outputStream.WriteLine("OD: {0}", buffer.ReadString(false)); outputStream.WriteLine("OD: {0}", buffer.ReadString(false)); buffer.SkipBytes(53); } if ((OtherData & 4) > 0) { outputStream.WriteLine("Aura: {0}", buffer.ReadString(false)); outputStream.WriteLine("Aura: {0}", buffer.ReadString(false)); buffer.SkipBytes(54); } byte Properties = buffer.ReadByte(); outputStream.WriteLine("Properties = {0}, Offset now {1}", Properties, buffer.GetPosition()); UInt32 BodyType = 0; if (Properties > 0) BodyType = buffer.ReadUInt32(); outputStream.WriteLine("Bodytype = {0}", BodyType); if (Properties != 1) outputStream.WriteLine("XXXX Properties is {0}", Properties); for (int i = 1; i < Properties; ++i) outputStream.WriteLine(" Prop: {0}", buffer.ReadUInt32()); outputStream.WriteLine("Position is now {0}", buffer.GetPosition()); byte HP = buffer.ReadByte(); byte HairColor = buffer.ReadByte(); byte BeardColor = buffer.ReadByte(); byte Eye1 = buffer.ReadByte(); byte Eye2 = buffer.ReadByte(); byte HairStyle = buffer.ReadByte(); byte BeardStyle = buffer.ReadByte(); outputStream.WriteLine("Beardstyle is {0}", BeardStyle); buffer.SkipBytes(12); // Drakkin stuff byte EquipChest2 = buffer.ReadByte(); buffer.SkipBytes(2); byte Helm = buffer.ReadByte(); float Size = buffer.ReadSingle(); byte Face = buffer.ReadByte(); float WalkSpeed = buffer.ReadSingle(); float RunSpeed = buffer.ReadSingle(); UInt32 Race = buffer.ReadUInt32(); outputStream.WriteLine("Size: {0}, Face: {1}, Walkspeed: {2}, RunSpeed: {3}, Race: {4}", Size, Face, WalkSpeed, RunSpeed, Race); //MooftaL above here is correct, below is incorrect time to get from seq... outputStream.WriteLine("Holding = {0}", buffer.ReadByte()); outputStream.WriteLine("Deity = {0}", buffer.ReadUInt32()); outputStream.WriteLine("GuildID = {0}", buffer.ReadUInt32()); outputStream.WriteLine("Guildstatus = {0}", buffer.ReadUInt32()); outputStream.WriteLine("Classs? = {0}", buffer.ReadUInt32()); buffer.SkipBytes(1); outputStream.WriteLine("State = {0}", buffer.ReadByte()); outputStream.WriteLine("Light = {0}", buffer.ReadByte()); buffer.SkipBytes(1); outputStream.WriteLine("LastName = {0}", buffer.ReadString(false)); buffer.SkipBytes(6); outputStream.WriteLine("PetOwnerId = {0}", buffer.ReadUInt32()); if (IsNPC==1) { buffer.SkipBytes(37); } else { buffer.SkipBytes(25); } if (IsNPC == 0 || NPCType.IsPlayableRace(Race)) { //for (int ColourSlot = 0; ColourSlot < 9; ++ColourSlot) // outputStream.WriteLine("Color {0} is {1}", ColourSlot, buffer.ReadUInt32()); buffer.SkipBytes(36); for (int i = 0; i < 9; ++i) { UInt32 Equip3 = buffer.ReadUInt32(); UInt32 Equipx = buffer.ReadUInt32(); UInt32 Equip2 = buffer.ReadUInt32(); UInt32 Equip1 = buffer.ReadUInt32(); UInt32 Equip0 = buffer.ReadUInt32(); outputStream.WriteLine("Equip slot {0}: 0,1,2,x,3 is {1}, {2}, {3}, {4}, {5}", i, Equip0, Equip1, Equip2, Equipx, Equip3); } } else { //Moofta at this point this section is 100% untested // Non playable race // Melee Texture 1 is 20 bytes in // Melee Texture 1 is 40 bytes in // This whole segment is 28 + 24 + 8 = 60 // Skip 20, Read m1, skip 16, read m2, skip 16 /* OutputStream.WriteLine("None playable race, offset now {0}", Buffer.GetPosition()); Buffer.SkipBytes(28); UInt32 MeleeTexture1 = Buffer.ReadUInt32(); Buffer.SkipBytes(12); UInt32 MeleeTexture2 = Buffer.ReadUInt32(); Buffer.SkipBytes(12); */ outputStream.WriteLine("None playable race, offset now {0}", buffer.GetPosition()); buffer.SkipBytes(20); UInt32 MeleeTexture1 = buffer.ReadUInt32(); buffer.SkipBytes(16); UInt32 MeleeTexture2 = buffer.ReadUInt32(); buffer.SkipBytes(16); } outputStream.WriteLine("Position starts at offset {0}", buffer.GetPosition()); /* * union { struct { unsigned pitch:12; signed deltaX:13; // change in x unsigned padding01:7; signed z:19; // z coord (3rd loc value) signed deltaHeading:10; // change in heading unsigned padding02:3; signed x:19; // x coord (1st loc value) signed deltaZ:13; // change in z unsigned heading:12; // heading signed deltaY:13; // change in y unsigned padding03:7; signed animation:10; // velocity signed y:19; // y coord (2nd loc value) unsigned padding04:3; }; int32_t posData[5]; };*/ UInt32 Position1 = buffer.ReadUInt32(); outputStream.WriteLine("Position1 untreated {0}", Position1); UInt32 Position2 = buffer.ReadUInt32(); outputStream.WriteLine("Position2 untreated {0}", Position2); UInt32 Position3 = buffer.ReadUInt32(); outputStream.WriteLine("Position3 untreated {0}", Position3); //verified as X position UInt32 Position4 = buffer.ReadUInt32(); outputStream.WriteLine("Position4 untreated {0}", Position4); UInt32 Position5 = buffer.ReadUInt32(); //verified as Y position float XPos = Utils.EQ19ToFloat((Int32)(Position3) & 0x7FFFF); //Verified float YPos = Utils.EQ19ToFloat((Int32) (Position5 >> 10) & 0x7FFFF); //Verified float ZPos = Utils.EQ19ToFloat((Int32) ((Position2) & 0x7FFFF)); //thanks Demonstar55 //heading is definitely NOT Position3 float Heading = Utils.EQ19ToFloat((Int32)(Position4) & 0xFFF); //can't verify //for(var i = 0; i < 32; ++i) // OutputStream.WriteLine("Pos3 << {0} = {1}", i, Utils.EQ19ToFloat((Int32)(Position3 >> i) & 0x3FF)); outputStream.WriteLine("(X,Y,Z) = {0}, {1}, {2}, Heading = {3}", XPos, YPos, ZPos, Heading); if ((OtherData & 16) > 1) outputStream.WriteLine("Title: {0}", buffer.ReadString(false)); if ((OtherData & 32) > 1) outputStream.WriteLine("Suffix: {0}", buffer.ReadString(false)); buffer.SkipBytes(8); byte IsMerc = buffer.ReadByte(); outputStream.WriteLine("IsMerc: {0}", IsMerc); buffer.SkipBytes(54); outputStream.WriteLine("Buffer Length: {0}, Current Position: {1}", buffer.Length(), buffer.GetPosition()); if (buffer.Length() != buffer.GetPosition()) outputStream.WriteLine("PARSE ERROR"); outputStream.WriteLine(""); } catch (Exception) { } }
public override List<ZoneEntryStruct> GetSpawns() { List<ZoneEntryStruct> zoneSpawns = new List<ZoneEntryStruct>(); List<byte[]> spawnPackets = GetPacketsOfType("OP_ZoneEntry", PacketDirection.ServerToClient); foreach (var spawnPacket in spawnPackets) { var newSpawn = new ZoneEntryStruct(); var buffer = new ByteStream(spawnPacket); newSpawn.SpawnName = buffer.ReadString(true); newSpawn.SpawnName = Utils.MakeCleanName(newSpawn.SpawnName); newSpawn.SpawnID = buffer.ReadUInt32(); newSpawn.Level = buffer.ReadByte(); buffer.SkipBytes(4); newSpawn.IsNPC = buffer.ReadByte(); var bitfield=buffer.ReadUInt32(); newSpawn.Gender = (bitfield & 3); var otherData = buffer.ReadByte(); buffer.SkipBytes(8); if ((otherData & 1) > 0) { newSpawn.DestructableString1 = buffer.ReadString(false); newSpawn.DestructableString2 = buffer.ReadString(false); newSpawn.DestructableString3 = buffer.ReadString(false); buffer.SkipBytes(53); } if ((otherData & 4) > 0) { buffer.ReadString(false); buffer.ReadString(false); buffer.SkipBytes(54); } newSpawn.PropCount = buffer.ReadByte(); if (newSpawn.PropCount > 0) newSpawn.BodyType = buffer.ReadUInt32(); else newSpawn.BodyType = 0; for (var i = 1; i < newSpawn.PropCount; ++i) buffer.SkipBytes(4); buffer.SkipBytes(1); // Skip HP % newSpawn.Beard = buffer.ReadByte(); //Beardstyle newSpawn.HairColor = buffer.ReadByte(); newSpawn.EyeColor1 = buffer.ReadByte(); newSpawn.EyeColor2 = buffer.ReadByte(); newSpawn.HairStyle = buffer.ReadByte(); newSpawn.BeardColor = buffer.ReadByte(); newSpawn.DrakkinHeritage = buffer.ReadUInt32(); // vsab: an_unemployed_mercenary's and some newer npc's seem to have newSpawn.DrakkinHeritage set to 255, then have invalid numbers for the next ones if (newSpawn.DrakkinHeritage == 255) { newSpawn.DrakkinHeritage = 0; newSpawn.DrakkinTattoo = 0; newSpawn.DrakkinDetails = 0; buffer.SkipBytes(8); } else { newSpawn.DrakkinTattoo = buffer.ReadUInt32(); newSpawn.DrakkinDetails = buffer.ReadUInt32(); } newSpawn.EquipChest2 = buffer.ReadByte(); var useWorn = (newSpawn.EquipChest2 == 255); buffer.SkipBytes(2); // 2 Unknown bytes; newSpawn.Helm= buffer.ReadByte(); newSpawn.Size = buffer.ReadSingle(); newSpawn.Face = buffer.ReadByte(); newSpawn.WalkSpeed = buffer.ReadSingle(); newSpawn.RunSpeed = buffer.ReadSingle(); newSpawn.Race = buffer.ReadUInt32(); buffer.SkipBytes(1); // Skip Holding newSpawn.Deity = buffer.ReadUInt32(); buffer.SkipBytes(8); // Skip GuildID and GuildRank newSpawn.Class = buffer.ReadUInt32(); buffer.SkipBytes(1); // Skip PVP, Standstate, Light, Flymode newSpawn.StandState = buffer.ReadByte(); //110 is sitting, 100 is standing, 120 is FD/corpse, mounts show as 102 buffer.SkipBytes(2); newSpawn.LastName = buffer.ReadString(true); buffer.SkipBytes(6); newSpawn.PetOwnerID = buffer.ReadUInt32(); newSpawn.MeleeTexture1 = 0; newSpawn.MeleeTexture2 = 0; buffer.SkipBytes(newSpawn.IsNPC == 1 ? 37 : 25); if (newSpawn.IsNPC == 0 || NPCType.IsPlayableRace(newSpawn.Race)) { var posn = buffer.GetPosition(); for (var colourSlot = 0; colourSlot < 9; ++colourSlot) newSpawn.SlotColour[colourSlot] = buffer.ReadUInt32(); var diff = buffer.GetPosition() - posn; Debug.Assert(diff == 36, "Colour slots wrong!"); for (var i = 0; i < 9; ++i) { newSpawn.Equipment[i] = buffer.ReadUInt32(); var equip3 = buffer.ReadUInt32(); var equip2 = buffer.ReadUInt32(); var equip1 = buffer.ReadUInt32(); var equip0 = buffer.ReadUInt32(); } if (newSpawn.Equipment[Constants.MATERIAL_CHEST] > 0) { newSpawn.EquipChest2 = (byte)newSpawn.Equipment[Constants.MATERIAL_CHEST]; } //vsab: unverified..... newSpawn.ArmorTintRed = (byte)((newSpawn.SlotColour[Constants.MATERIAL_CHEST] >> 16) & 0xff); newSpawn.ArmorTintGreen = (byte)((newSpawn.SlotColour[Constants.MATERIAL_CHEST] >> 8) & 0xff); newSpawn.ArmorTintBlue = (byte)(newSpawn.SlotColour[Constants.MATERIAL_CHEST] & 0xff); if (newSpawn.Equipment[Constants.MATERIAL_PRIMARY] > 0) newSpawn.MeleeTexture1 = newSpawn.Equipment[Constants.MATERIAL_PRIMARY]; if (newSpawn.Equipment[Constants.MATERIAL_SECONDARY] > 0) newSpawn.MeleeTexture2 = newSpawn.Equipment[Constants.MATERIAL_SECONDARY]; if (useWorn) newSpawn.Helm = (byte)newSpawn.Equipment[Constants.MATERIAL_HEAD]; else newSpawn.Helm = 0; } else { buffer.SkipBytes(20); newSpawn.MeleeTexture1 = buffer.ReadUInt32(); buffer.SkipBytes(16); newSpawn.MeleeTexture2 = buffer.ReadUInt32(); buffer.SkipBytes(16); } if (newSpawn.EquipChest2 == 255) newSpawn.EquipChest2 = 0; if (newSpawn.Helm == 255) newSpawn.Helm = 0; var position1 = buffer.ReadUInt32(); var position2 = buffer.ReadUInt32(); //not valid this patch var position3 = buffer.ReadUInt32(); var position4 = buffer.ReadUInt32(); var position5 = buffer.ReadUInt32(); newSpawn.XPos = Utils.EQ19ToFloat((Int32)((position4 >> 13) & 0x7FFFF)); newSpawn.YPos = Utils.EQ19ToFloat((Int32)(position1 >> 12) & 0x7FFFF); newSpawn.ZPos = Utils.EQ19ToFloat((Int32)(position3) & 0x7FFFF); newSpawn.Heading = Utils.EQ19ToFloat((Int32)(position5) & 0x7FF); if ((otherData & 16) > 1) { newSpawn.Title = buffer.ReadString(false); } if ((otherData & 32) > 1) { newSpawn.Suffix = buffer.ReadString(false); } // unknowns buffer.SkipBytes(8); newSpawn.IsMercenary = buffer.ReadByte(); buffer.SkipBytes(54); var expectedLength = buffer.Length(); var currentPoint = buffer.GetPosition(); Debug.Assert(currentPoint == expectedLength, "Length mismatch while parsing zone spawns"); zoneSpawns.Add(newSpawn); } return zoneSpawns; }
public override UInt16 GetZoneNumber() { try { List<byte[]> NewZonePacket = GetPacketsOfType("OP_NewZone", PacketDirection.ServerToClient); if (NewZonePacket.Count == 0) { return 0; } var Buffer = new ByteStream(NewZonePacket[0]); Buffer.SkipBytes(852); UInt16 ZoneID = Buffer.ReadUInt16(); return ZoneID; } catch (Exception) { return 0; } }
public override void ExploreSubItem(StreamWriter outputStream, ref ByteStream buffer) { buffer.SkipBytes(8); byte Area = buffer.ReadByte(); UInt16 MainSlot = buffer.ReadUInt16(); Int16 SubSlot = buffer.ReadInt16(); buffer.SkipBytes(54); string Name = buffer.ReadString(true); if (SubSlot >= 0) outputStream.Write(" "); string AreaName = "Unknown"; switch (Area) { case 0: AreaName = "Personal Inventory"; break; case 1: AreaName = "Bank"; break; case 2: AreaName = "Shared Bank"; break; case 6: AreaName = "Personal Tribute"; break; case 7: AreaName = "Guild Tribute"; break; case 8: AreaName = "Merchant"; break; } outputStream.WriteLine("Area: {0} {1} Main Slot {2,2} Sub Slot {3,3} Name {4}", Area, AreaName.PadRight(20), MainSlot, SubSlot, Name); buffer.ReadString(true); // Lore buffer.ReadString(true); // IDFile //Buffer.SkipBytes(236); // Item Body Struct UInt32 ID = buffer.ReadUInt32(); byte Weight = buffer.ReadByte(); byte NoRent = buffer.ReadByte(); byte NoDrop = buffer.ReadByte(); byte Attune = buffer.ReadByte(); byte Size = buffer.ReadByte(); outputStream.WriteLine(" ID: {0} Weight: {1} NoRent: {2} NoDrop: {3} Attune {4} Size {5}", ID, Weight, NoRent, NoDrop, Attune, Size); UInt32 Slots = buffer.ReadUInt32(); UInt32 Price = buffer.ReadUInt32(); UInt32 Icon = buffer.ReadUInt32(); buffer.SkipBytes(2); UInt32 BenefitFlags = buffer.ReadUInt32(); byte Tradeskills = buffer.ReadByte(); outputStream.WriteLine(" Slots: {0} Price: {1} Icon: {2} BenefitFlags {3} Tradeskills: {4}", Slots, Price, Icon, BenefitFlags, Tradeskills); byte CR = buffer.ReadByte(); byte DR = buffer.ReadByte(); byte PR = buffer.ReadByte(); byte MR = buffer.ReadByte(); byte FR = buffer.ReadByte(); byte SVC = buffer.ReadByte(); outputStream.WriteLine(" CR: {0} DR: {1} PR: {2} MR: {3} FR: {4} SVC: {5}", CR, DR, PR, MR, FR, SVC); byte AStr = buffer.ReadByte(); byte ASta = buffer.ReadByte(); byte AAgi = buffer.ReadByte(); byte ADex = buffer.ReadByte(); byte ACha = buffer.ReadByte(); byte AInt = buffer.ReadByte(); byte AWis = buffer.ReadByte(); outputStream.WriteLine(" AStr: {0} ASta: {1} AAgi: {2} ADex: {3} ACha: {4} AInt: {5} AWis: {6}", AStr, ASta, AAgi, ADex, ACha, AInt, AWis); Int32 HP = buffer.ReadInt32(); Int32 Mana = buffer.ReadInt32(); UInt32 Endurance = buffer.ReadUInt32(); Int32 AC = buffer.ReadInt32(); Int32 Regen = buffer.ReadInt32(); Int32 ManaRegen = buffer.ReadInt32(); Int32 EndRegen = buffer.ReadInt32(); UInt32 Classes = buffer.ReadUInt32(); UInt32 Races = buffer.ReadUInt32(); UInt32 Deity = buffer.ReadUInt32(); Int32 SkillModValue = buffer.ReadInt32(); buffer.SkipBytes(4); UInt32 SkillModType = buffer.ReadUInt32(); UInt32 BaneDamageRace = buffer.ReadUInt32(); UInt32 BaneDamageBody = buffer.ReadUInt32(); UInt32 BaneDamageRaceAmount = buffer.ReadUInt32(); Int32 BaneDamageAmount = buffer.ReadInt32(); byte Magic = buffer.ReadByte(); Int32 CastTime = buffer.ReadInt32(); UInt32 ReqLevel = buffer.ReadUInt32(); UInt32 RecLevel = buffer.ReadUInt32(); UInt32 ReqSkill = buffer.ReadUInt32(); UInt32 BardType = buffer.ReadUInt32(); Int32 BardValue = buffer.ReadInt32(); byte Light = buffer.ReadByte(); byte Delay = buffer.ReadByte(); byte ElemDamageAmount = buffer.ReadByte(); byte ElemDamageType = buffer.ReadByte(); byte Range = buffer.ReadByte(); UInt32 Damage = buffer.ReadUInt32(); UInt32 Color = buffer.ReadUInt32(); byte ItemType = buffer.ReadByte(); UInt32 Material = buffer.ReadUInt32(); buffer.SkipBytes(4); UInt32 EliteMaterial = buffer.ReadUInt32(); float SellRate = buffer.ReadSingle(); Int32 CombatEffects = buffer.ReadInt32(); Int32 Shielding = buffer.ReadInt32(); Int32 StunResist = buffer.ReadInt32(); Int32 StrikeThrough = buffer.ReadInt32(); Int32 ExtraDamageSkill = buffer.ReadInt32(); Int32 ExtraDamageAmount = buffer.ReadInt32(); Int32 SpellShield = buffer.ReadInt32(); Int32 Avoidance = buffer.ReadInt32(); Int32 Accuracy = buffer.ReadInt32(); UInt32 CharmFileID = buffer.ReadUInt32(); UInt32 FactionMod1 = buffer.ReadUInt32(); Int32 FactionAmount1 = buffer.ReadInt32(); UInt32 FactionMod2 = buffer.ReadUInt32(); Int32 FactionAmount2 = buffer.ReadInt32(); UInt32 FactionMod3 = buffer.ReadUInt32(); Int32 FactionAmount3 = buffer.ReadInt32(); UInt32 FactionMod4 = buffer.ReadUInt32(); Int32 FactionAmount4 = buffer.ReadInt32(); buffer.ReadString(true); // Charm File buffer.SkipBytes(64); // Item Secondary Body Struct buffer.ReadString(true); // Filename buffer.SkipBytes(76); // Item Tertiary Body Struct buffer.SkipBytes(30); // Click Effect Struct buffer.ReadString(true); // Clickname buffer.SkipBytes(4); // clickunk7 buffer.SkipBytes(30); // Proc Effect Struct buffer.ReadString(true); // Proc Name buffer.SkipBytes(4); // unknown5 buffer.SkipBytes(30); // Worn Effect Struct buffer.ReadString(true); // Worn Name buffer.SkipBytes(4); // unknown6 buffer.SkipBytes(30); // Worn Effect Struct buffer.ReadString(true); // Worn Name buffer.SkipBytes(4); // unknown6 buffer.SkipBytes(30); // Worn Effect Struct buffer.ReadString(true); // Worn Name buffer.SkipBytes(4); // unknown6 buffer.SkipBytes(30); // Worn Effect Struct buffer.ReadString(true); // Worn Name buffer.SkipBytes(4); // unknown6 buffer.SkipBytes(103); // Item Quaternary Body Struct - 4 (we want to read the SubLength field at the end) UInt32 SubLengths = buffer.ReadUInt32(); for (int i = 0; i < SubLengths; ++i) { buffer.SkipBytes(4); ExploreSubItem(outputStream, ref buffer); } }
public override void ExploreSpawnDoor(StreamWriter outputStream, ByteStream buffer, PacketDirection direction) { uint DoorCount = buffer.Length() / 96; outputStream.WriteLine("Door Count: {0}", DoorCount); for (int d = 0; d < DoorCount; ++d) { string DoorName = buffer.ReadFixedLengthString(32, false); float YPos = buffer.ReadSingle(); float XPos = buffer.ReadSingle(); float ZPos = buffer.ReadSingle(); float Heading = buffer.ReadSingle(); UInt32 Incline = buffer.ReadUInt32(); Int32 Size = buffer.ReadInt32(); buffer.SkipBytes(4); // Skip Unknown Byte DoorID = buffer.ReadByte(); Byte OpenType = buffer.ReadByte(); Byte StateAtSpawn = buffer.ReadByte(); Byte InvertState = buffer.ReadByte(); Int32 DoorParam = buffer.ReadInt32(); outputStream.WriteLine(" Name: {0} ID: {1} OT: {2} SAS: {3} IS: {4} DP: {5}", DoorName, DoorID, OpenType, StateAtSpawn, InvertState, DoorParam); // Skip past the trailing unknowns in the door struct, moving to the next door in the packet. buffer.SkipBytes(28); } }
public override List<ZoneEntryStruct> GetSpawns() { List<ZoneEntryStruct> ZoneSpawns = new List<ZoneEntryStruct>(); List<byte[]> SpawnPackets = GetPacketsOfType("OP_ZoneEntry", PacketDirection.ServerToClient); foreach (byte[] SpawnPacket in SpawnPackets) { ZoneEntryStruct newSpawn = new ZoneEntryStruct(); ByteStream buffer = new ByteStream(SpawnPacket); newSpawn.SpawnName = buffer.ReadString(true); newSpawn.SpawnName = Utils.MakeCleanName(newSpawn.SpawnName); newSpawn.SpawnID = buffer.ReadUInt32(); newSpawn.Level = buffer.ReadByte(); float UnkSize = buffer.ReadSingle(); newSpawn.IsNPC = buffer.ReadByte(); UInt32 Bitfield = buffer.ReadUInt32(); newSpawn.Gender = (Bitfield & 3); Byte OtherData = buffer.ReadByte(); buffer.SkipBytes(8); // Skip 8 unknown bytes newSpawn.DestructableString1 = ""; newSpawn.DestructableString2 = ""; newSpawn.DestructableString3 = ""; if ((newSpawn.IsNPC > 0) && ((OtherData & 1) > 0)) { // Destructable Objects newSpawn.DestructableString1 = buffer.ReadString(false); newSpawn.DestructableString2 = buffer.ReadString(false); newSpawn.DestructableString3 = buffer.ReadString(false); buffer.SkipBytes(53); } if ((OtherData & 4) > 0) { // Auras buffer.ReadString(false); buffer.ReadString(false); buffer.SkipBytes(54); } newSpawn.PropCount = buffer.ReadByte(); if (newSpawn.PropCount > 0) newSpawn.BodyType = buffer.ReadUInt32(); else newSpawn.BodyType = 0; for (int j = 1; j < newSpawn.PropCount; ++j) buffer.SkipBytes(4); buffer.SkipBytes(1); // Skip HP % newSpawn.HairColor = buffer.ReadByte(); newSpawn.BeardColor = buffer.ReadByte(); newSpawn.EyeColor1 = buffer.ReadByte(); newSpawn.EyeColor2 = buffer.ReadByte(); newSpawn.HairStyle = buffer.ReadByte(); newSpawn.Beard = buffer.ReadByte(); newSpawn.DrakkinHeritage = buffer.ReadUInt32(); newSpawn.DrakkinTattoo = buffer.ReadUInt32(); newSpawn.DrakkinDetails = buffer.ReadUInt32(); newSpawn.EquipChest2 = buffer.ReadByte(); bool UseWorn = (newSpawn.EquipChest2 == 255); buffer.SkipBytes(2); // 2 Unknown bytes; newSpawn.Helm = buffer.ReadByte(); newSpawn.Size = buffer.ReadSingle(); newSpawn.Face = buffer.ReadByte(); newSpawn.WalkSpeed = buffer.ReadSingle(); newSpawn.RunSpeed = buffer.ReadSingle(); newSpawn.Race = buffer.ReadUInt32(); buffer.SkipBytes(1); // Skip Holding newSpawn.Deity = buffer.ReadUInt32(); buffer.SkipBytes(8); // Skip GuildID and GuildRank newSpawn.Class = buffer.ReadByte(); buffer.SkipBytes(4); // Skip PVP, Standstate, Light, Flymode newSpawn.LastName = buffer.ReadString(true); buffer.SkipBytes(6); newSpawn.PetOwnerID = buffer.ReadUInt32(); buffer.SkipBytes(25); newSpawn.MeleeTexture1 = 0; newSpawn.MeleeTexture2 = 0; if ((newSpawn.IsNPC == 0) || NPCType.IsPlayableRace(newSpawn.Race)) { for (int ColourSlot = 0; ColourSlot < 9; ++ColourSlot) newSpawn.SlotColour[ColourSlot] = buffer.ReadUInt32(); for (int i = 0; i < 9; ++i) { newSpawn.Equipment[i] = buffer.ReadUInt32(); UInt32 Equip3 = buffer.ReadUInt32(); UInt32 Equip2 = buffer.ReadUInt32(); UInt32 Equip1 = buffer.ReadUInt32(); UInt32 Equip0 = buffer.ReadUInt32(); } if (newSpawn.Equipment[Constants.MATERIAL_CHEST] > 0) { newSpawn.EquipChest2 = (byte)newSpawn.Equipment[Constants.MATERIAL_CHEST]; } newSpawn.ArmorTintRed = (byte)((newSpawn.SlotColour[Constants.MATERIAL_CHEST] >> 16) & 0xff); newSpawn.ArmorTintGreen = (byte)((newSpawn.SlotColour[Constants.MATERIAL_CHEST] >> 8) & 0xff); newSpawn.ArmorTintBlue = (byte)(newSpawn.SlotColour[Constants.MATERIAL_CHEST] & 0xff); if (newSpawn.Equipment[Constants.MATERIAL_PRIMARY] > 0) newSpawn.MeleeTexture1 = newSpawn.Equipment[Constants.MATERIAL_PRIMARY]; if (newSpawn.Equipment[Constants.MATERIAL_SECONDARY] > 0) newSpawn.MeleeTexture2 = newSpawn.Equipment[Constants.MATERIAL_SECONDARY]; if (UseWorn) newSpawn.Helm = (byte)newSpawn.Equipment[Constants.MATERIAL_HEAD]; else newSpawn.Helm = 0; } else { // Non playable race buffer.SkipBytes(20); newSpawn.MeleeTexture1 = buffer.ReadUInt32(); buffer.SkipBytes(16); newSpawn.MeleeTexture2 = buffer.ReadUInt32(); buffer.SkipBytes(16); } if (newSpawn.EquipChest2 == 255) newSpawn.EquipChest2 = 0; if (newSpawn.Helm == 255) newSpawn.Helm = 0; UInt32 Position1 = buffer.ReadUInt32(); UInt32 Position2 = buffer.ReadUInt32(); UInt32 Position3 = buffer.ReadUInt32(); UInt32 Position4 = buffer.ReadUInt32(); UInt32 Position5 = buffer.ReadUInt32(); newSpawn.YPos = Utils.EQ19ToFloat((Int32)((Position1 >> 12) & 0x7FFFF)); newSpawn.ZPos = Utils.EQ19ToFloat((Int32)(Position2) & 0x7FFFF); newSpawn.XPos = Utils.EQ19ToFloat((Int32)(Position4 >> 13) & 0x7FFFF); newSpawn.Heading = Utils.EQ19ToFloat((Int32)(Position3 >> 13) & 0xFFF); if ((OtherData & 16) > 0) { newSpawn.Title = buffer.ReadString(false); } if ((OtherData & 32) > 0) { newSpawn.Suffix = buffer.ReadString(false); } // unknowns buffer.SkipBytes(8); newSpawn.IsMercenary = buffer.ReadByte(); buffer.SkipBytes(54); var expectedLength = buffer.Length(); var currentPoint = buffer.GetPosition(); Debug.Assert(currentPoint == expectedLength, "Length mismatch while parsing zone spawns"); ZoneSpawns.Add(newSpawn); } return ZoneSpawns; }
public override MerchantManager GetMerchantData(NPCSpawnList npcsl) { List<EQApplicationPacket> PacketList = Packets.PacketList; UInt32 OP_ShopRequest = OpManager.OpCodeNameToNumber("OP_ShopRequest"); UInt32 OP_ShopEnd = OpManager.OpCodeNameToNumber("OP_ShopEnd"); UInt32 OP_ItemPacket = OpManager.OpCodeNameToNumber("OP_ItemPacket"); MerchantManager mm = new MerchantManager(); for (int i = 0; i < PacketList.Count; ++i) { EQApplicationPacket p = PacketList[i]; if ((p.Direction == PacketDirection.ServerToClient) && (p.OpCode == OP_ShopRequest)) { ByteStream Buffer = new ByteStream(p.Buffer); UInt32 MerchantSpawnID = Buffer.ReadUInt32(); NPCSpawn npc = npcsl.GetNPC(MerchantSpawnID); UInt32 NPCTypeID; if (npc != null) NPCTypeID = npc.NPCTypeID; else NPCTypeID = 0; mm.AddMerchant(MerchantSpawnID); for (int j = i + 1; j < PacketList.Count; ++j) { p = PacketList[j]; if (p.OpCode == OP_ShopEnd) break; if (p.OpCode == OP_ItemPacket) { Buffer = new ByteStream(p.Buffer); UInt32 StackSize = Buffer.ReadUInt32(); Buffer.SkipBytes(4); UInt32 Slot = Buffer.ReadUInt32(); UInt32 MerchantSlot = Buffer.ReadUInt32(); UInt32 Price = Buffer.ReadUInt32(); Int32 Quantity = Buffer.ReadInt32(); Buffer.SetPosition(68); // Point to item name string ItemName = Buffer.ReadString(true); string Lore = Buffer.ReadString(true); string IDFile = Buffer.ReadString(true); UInt32 ItemID = Buffer.ReadUInt32(); //if (Quantity == -1) mm.AddMerchantItem(MerchantSpawnID, ItemID, ItemName, MerchantSlot, Quantity); } } } } return mm; }