// Read a boolean value from a packet bool isAlive = packet.ReadBool(); if (isAlive) { Console.WriteLine("Player is alive"); } else { Console.WriteLine("Player is dead"); }
// Read a flag value from a packet bool hasLoot = packet.ReadBool(); if (hasLoot) { // Read the item ID and quantity from the packet int itemId = packet.ReadInt32(); int quantity = packet.ReadInt32(); Console.WriteLine("Player obtained {0}x {1}", quantity, itemId); } else { Console.WriteLine("No loot to be had"); }This example reads a flag value from the packet that indicates whether there is loot to be had. If the flag is true, then the item ID and quantity are also read from the packet and outputted to the console. Otherwise, the message "No loot to be had" is printed. Package library: WowPacketParser.