public static void HandleAreaTriggerReShape(Packet packet) { packet.ReadPackedGuid128("TriggerGUID"); packet.ResetBitReader(); var hasAreaTriggerSpline = packet.ReadBit("HasAreaTriggerSpline"); var hasAreaTriggerUnkType = packet.ReadBit("HasAreaTriggerUnkType"); if (hasAreaTriggerSpline) ReadAreaTriggerSpline(packet); if (hasAreaTriggerUnkType) { packet.ResetBitReader(); var unk1 = packet.ReadBit("AreaTriggerUnk1"); var hasCenter = packet.ReadBit("HasCenter"); packet.ReadBit("Unk bit 703 1"); packet.ReadBit("Unk bit 703 2"); packet.ReadUInt32("Unk UInt 1"); packet.ReadInt32("Unk Int 1"); packet.ReadUInt32("Unk UInt 2"); packet.ReadSingle("Radius"); packet.ReadSingle("BlendFromRadius"); packet.ReadSingle("InitialAngel"); packet.ReadSingle("ZOffset"); if (unk1) packet.ReadPackedGuid128("AreaTriggerUnkGUID"); if (hasCenter) packet.ReadVector3("Center"); } }
public static void HandleCharEnum(Packet packet) { var count = packet.ReadByte("Count"); for (var i = 0; i < count; i++) { var guid = packet.ReadGuid("GUID"); var name = packet.ReadCString("Name"); var race = packet.ReadEnum<Race>("Race", TypeCode.Byte); var clss = packet.ReadEnum<Class>("Class", TypeCode.Byte); packet.ReadEnum<Gender>("Gender", TypeCode.Byte); packet.ReadByte("Skin"); packet.ReadByte("Face"); packet.ReadByte("Hair Style"); packet.ReadByte("Hair Color"); packet.ReadByte("Facial Hair"); var level = packet.ReadByte("Level"); var zone = packet.ReadEntryWithName<UInt32>(StoreNameType.Zone, "Zone Id"); var mapId = packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map Id"); var pos = packet.ReadVector3("Position"); packet.ReadInt32("Guild Id"); packet.ReadEnum<CharacterFlag>("Character Flags", TypeCode.Int32); if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056)) packet.ReadEnum<CustomizationFlag>("Customization Flags", TypeCode.Int32); var firstLogin = packet.ReadBoolean("First Login"); packet.ReadInt32("Pet Display Id"); packet.ReadInt32("Pet Level"); packet.ReadEnum<CreatureFamily>("Pet Family", TypeCode.Int32); for (var j = 0; j < 19; j++) { packet.ReadInt32("Equip Display Id"); packet.ReadEnum<InventoryType>("Equip Inventory Type", TypeCode.Byte); packet.ReadInt32("Equip Aura Id"); } int bagCount = ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3_11685) ? 4 : 1; for (var j = 0; j < bagCount; j++) { packet.ReadInt32("Bag Display Id"); packet.ReadEnum<InventoryType>("Bag Inventory Type", TypeCode.Byte); packet.ReadInt32("Bag Aura Id"); } if (firstLogin) { var startPos = new StartPosition {Map = mapId, Position = pos, Zone = zone}; packet.SniffFileInfo.Storage.StartPositions.TryAdd(new Tuple<Race, Class>(race, clss), startPos); } var playerInfo = new Player {Race = race, Class = clss, Name = name, FirstLogin = firstLogin, Level = level}; packet.SniffFileInfo.Storage.Objects.AddOrUpdate(guid, playerInfo); } }
public static void HandleBindPointUpdate(Packet packet) { packet.ReadVector3("Position"); packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map ID"); packet.ReadInt32("Zone ID"); }
public static void HandleCorpseLocation(Packet packet) { packet.ReadBit("Valid"); packet.ReadInt32("ActualMapID"); packet.ReadVector3("Position"); packet.ReadInt32("MapID"); packet.ReadPackedGuid128("Transport"); }
public static void HandlePetAction(Packet packet) { packet.ReadPackedGuid128("PetGUID"); var action = (uint)packet.ReadUInt16() + (packet.ReadByte() << 16); packet.AddValue("Action", action); packet.ReadByte("Slot"); packet.ReadPackedGuid128("TargetGUID"); packet.ReadVector3("ActionPosition"); }
public static void ReadAreaTriggerSpline(Packet packet, params object[] indexes) { packet.ReadInt32("TimeToTarget", indexes); packet.ReadInt32("ElapsedTimeForMovement", indexes); var int8 = packet.ReadInt32("VerticesCount", indexes); for (var i = 0; i < int8; ++i) packet.ReadVector3("Points", indexes, i); }
public static void HandlePetAction(Packet packet) { packet.ReadPackedGuid128("PetGUID"); ReadPetAction(packet, "Action"); packet.ReadPackedGuid128("TargetGUID"); packet.ReadVector3("ActionPosition"); }
public static void HandleGMTicketCreate(Packet packet) { packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map ID"); var vector = packet.ReadVector3(); packet.Writer.WriteLine("Position: {0}", vector); packet.ReadCString("Text"); packet.ReadUInt32("Unk UInt32 1"); packet.ReadBoolean("Need Response"); // FIXME: 3.3.3a has many more data here.. }
public static void HandlePetAction(Packet packet) { packet.ReadGuid("GUID"); var action = (uint)packet.ReadUInt16() + (packet.ReadByte() << 16); packet.AddValue("Action", action); packet.ReadByteE<ActionButtonType>("Type"); packet.ReadGuid("GUID"); if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_6_13596)) packet.ReadVector3("Position"); }
public static void HandlePetAction(Packet packet) { packet.ReadGuid("GUID"); var action = (uint)packet.ReadUInt16() + (packet.ReadByte() << 16); packet.WriteLine("Action: {0}", action); packet.ReadEnum<ActionButtonType>("Type", TypeCode.Byte); packet.ReadGuid("GUID"); if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_2_2_14545)) packet.ReadVector3("Position"); }
public static void HandleMoveApplyMovementForce(Packet packet) { packet.ReadPackedGuid128("MoverGUID"); packet.ReadInt32("SequenceIndex"); packet.ReadPackedGuid128("TriggerGUID"); packet.ReadVector3("Direction"); packet.ReadInt32("TransportID"); packet.ReadSingle("Facing"); packet.ResetBitReader(); packet.ReadBits("Reason", 2); }
public static void HandleCorpseQuery(Packet packet) { if (packet.Direction == Direction.ClientToServer) return; if (!packet.ReadBoolean("Corpse Found")) return; packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map ID"); packet.ReadVector3("Corpse Position"); packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Corpse Map ID"); if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_2_2_10482)) packet.ReadInt32("Corpse Low GUID"); }
public static void HandleCorpseQuery(Packet packet) { if (packet.Direction == Direction.ClientToServer) return; if (!packet.ReadBool("Corpse Found")) return; packet.ReadInt32<MapId>("Map ID"); packet.ReadVector3("Corpse Position"); packet.ReadInt32<MapId>("Corpse Map ID"); if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_2_2_10482)) packet.ReadInt32("Corpse Low GUID"); }
public static void HandlePlayScene(Packet packet) { var sceneId = packet.ReadInt32("SceneID"); SceneTemplate scene = new SceneTemplate { SceneID = (uint)sceneId }; scene.Flags = (uint)packet.ReadInt32("PlaybackFlags"); packet.ReadInt32("SceneInstanceID"); scene.ScriptPackageID = (uint)packet.ReadInt32("SceneScriptPackageID"); packet.ReadPackedGuid128("TransportGUID"); packet.ReadVector3("Pos"); packet.ReadSingle("Facing"); Storage.Scenes.Add(scene, packet.TimeSpan); }
public static void HandleCorpseQuery(Packet packet) { if (packet.Direction == Direction.ClientToServer) return; var found = packet.ReadBoolean("Corpse Found"); if (!found) return; packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map ID"); packet.ReadVector3("Corpse Position"); packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Corpse Map ID"); packet.ReadInt32("Corpse Low GUID"); }
public static void HandleGMTicketCreate(Packet packet) { packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map ID"); packet.ReadVector3("Position"); packet.ReadCString("Text"); packet.ReadUInt32("Need Response"); packet.ReadBoolean("Need GM interaction"); var count = packet.ReadInt32("Count"); for (int i = 0; i < count; i++) packet.WriteLine("[" + i + "] Sent: " + (packet.Time - packet.ReadTime()).ToFormattedString()); if (count == 0) packet.ReadInt32("Unk Int32"); else { var decompCount = packet.ReadInt32(); packet = packet.Inflate(decompCount); packet.WriteLine(packet.ReadCString()); } }
public static void HandleMoveTeleport(Packet packet) { packet.ReadPackedGuid128("MoverGUID"); packet.ReadInt32("SequenceIndex"); packet.ReadVector3("Position"); packet.ReadSingle("Facing"); packet.ReadByte("PreloadWorld"); var hasVehicleTeleport = packet.ReadBit("HasVehicleTeleport"); var hasTransport = packet.ReadBit("HasTransport"); // VehicleTeleport if (hasVehicleTeleport) { packet.ReadByte("VehicleSeatIndex"); packet.ReadBit("VehicleExitVoluntary"); packet.ReadBit("VehicleExitTeleport"); } if (hasTransport) packet.ReadPackedGuid128("TransportGUID"); }
public static void HandleMissileTrajectoryCollision(Packet packet) { packet.ReadPackedGuid128("CasterGUID"); packet.ReadInt32("SpellID"); packet.ReadByte("CastID"); packet.ReadVector3("CollisionPos"); }
public static void HandleCastVisual(Packet packet) { packet.ReadPackedGuid128("Source"); packet.ReadPackedGuid128("Target"); packet.ReadVector3("TargetPosition"); packet.ReadInt32("SpellVisualID"); packet.ReadSingle("TravelSpeed"); packet.ReadInt16("MissReason"); packet.ReadInt16("ReflectStatus"); packet.ReadSingle("Orientation"); packet.ReadBit("SpeedAsTime"); }
public static void ReadCharactersData(Packet packet, params object[] idx) { packet.ReadPackedGuid128("Guid", idx); packet.ReadByte("ListPosition", idx); var race = packet.ReadByteE<Race>("RaceID", idx); var klass = packet.ReadByteE<Class>("ClassID", idx); packet.ReadByte("SexID", idx); packet.ReadByte("SkinID", idx); packet.ReadByte("FaceID", idx); packet.ReadByte("HairStyle", idx); packet.ReadByte("HairColor", idx); packet.ReadByte("FacialHairStyle", idx); for (uint j = 0; j < 3; ++j) packet.ReadByte("CustomDisplay", idx, j); packet.ReadByte("ExperienceLevel", idx); var zone = packet.ReadUInt32("ZoneID", idx); var mapId = packet.ReadUInt32("MapID", idx); var pos = packet.ReadVector3("PreloadPos", idx); packet.ReadPackedGuid128("GuildGUID", idx); packet.ReadUInt32("Flags", idx); packet.ReadUInt32("Flags2", idx); packet.ReadUInt32("Flags3", idx); packet.ReadUInt32("PetCreatureDisplayID", idx); packet.ReadUInt32("PetExperienceLevel", idx); packet.ReadUInt32("PetCreatureFamilyID", idx); for (uint j = 0; j < 2; ++j) packet.ReadUInt32("ProfessionIDs", idx, j); for (uint j = 0; j < 23; ++j) { packet.ReadUInt32("InventoryItem DisplayID", idx, j); packet.ReadUInt32("InventoryItem DisplayEnchantID", idx, j); packet.ReadByteE<InventoryType>("InventoryItem InvType", idx, j); } packet.ReadTime("LastPlayedTime", idx); packet.ReadUInt16("SpecID", idx); packet.ReadUInt32("Unknown703", idx); packet.ReadUInt32("Flags4", idx); packet.ResetBitReader(); var nameLength = packet.ReadBits("Character Name Length", 6, idx); var firstLogin = packet.ReadBit("FirstLogin", idx); packet.ReadBit("BoostInProgress", idx); packet.ReadBits("UnkWod61x", 5, idx); packet.ReadWoWString("Character Name", nameLength, idx); if (firstLogin) { PlayerCreateInfo startPos = new PlayerCreateInfo { Race = race, Class = klass, Map = mapId, Zone = zone, Position = pos, Orientation = 0 }; Storage.StartPositions.Add(startPos, packet.TimeSpan); } }
public static void ReadMovementSpline(Packet packet, Vector3 pos, params object[] indexes) { packet.ReadInt32E<SplineFlag434>("Flags", indexes); packet.ReadByte("AnimTier", indexes); packet.ReadUInt32("TierTransStartTime", indexes); packet.ReadInt32("Elapsed", indexes); packet.ReadUInt32("MoveTime", indexes); packet.ReadSingle("JumpGravity", indexes); packet.ReadUInt32("SpecialTime", indexes); var pointsCount = packet.ReadInt32("PointsCount", indexes); packet.ReadByte("Mode", indexes); packet.ReadByte("VehicleExitVoluntary", indexes); packet.ReadPackedGuid128("TransportGUID", indexes); packet.ReadSByte("VehicleSeat", indexes); var packedDeltasCount = packet.ReadInt32("PackedDeltasCount", indexes); Vector3 endpos = new Vector3(); for (int i = 0; i < pointsCount; i++) { var spot = packet.ReadVector3(); // client always taking first point if (i == 0) endpos = spot; packet.AddValue("Points", spot, indexes, i); } var waypoints = new Vector3[packedDeltasCount]; for (int i = 0; i < packedDeltasCount; i++) { var packedDeltas = packet.ReadPackedVector3(); waypoints[i].X = packedDeltas.X; waypoints[i].Y = packedDeltas.Y; waypoints[i].Z = packedDeltas.Z; } packet.ResetBitReader(); var type = packet.ReadBits("Face", 2, indexes); var monsterSplineFilter = packet.ReadBit("HasMonsterSplineFilter", indexes); switch (type) { case 1: packet.ReadVector3("FaceSpot", indexes); break; case 2: packet.ReadSingle("FaceDirection", indexes); packet.ReadPackedGuid128("FacingGUID", indexes); break; case 3: packet.ReadSingle("FaceDirection", indexes); break; } if (monsterSplineFilter) ReadMonsterSplineFilter(packet, indexes, "MonsterSplineFilter"); // Calculate mid pos var mid = new Vector3 { X = (pos.X + endpos.X) * 0.5f, Y = (pos.Y + endpos.Y) * 0.5f, Z = (pos.Z + endpos.Z) * 0.5f }; for (var i = 0; i < packedDeltasCount; ++i) { var vec = new Vector3 { X = mid.X - waypoints[i].X, Y = mid.Y - waypoints[i].Y, Z = mid.Z - waypoints[i].Z }; packet.AddValue("WayPoints", vec, indexes, i); } }
public static void HandlePlayOrphanSpellVisual(Packet packet) { packet.ReadVector3("SourceLocation"); packet.ReadVector3("SourceOrientation"); packet.ReadVector3("TargetLocation"); packet.ReadPackedGuid128("Target"); packet.ReadInt32("SpellVisualID"); packet.ReadSingle("TravelSpeed"); packet.ReadSingle("UnkFloat"); packet.ReadBit("SpeedAsTime"); }
public static void HandleUnknown177(Packet packet) { packet.ReadBit("ForceUpdate"); // VignetteInstanceIDList var int1 = packet.ReadInt32("RemovedCount"); for (var i = 0; i < int1; ++i) packet.ReadPackedGuid128("IDs", i); // Added var int2 = packet.ReadInt32("AddedCount"); for (var i = 0; i < int2; ++i) packet.ReadPackedGuid128("IDs", i); // VignetteClientData var int3 = packet.ReadInt32("VignetteClientDataCount"); for (var i = 0; i < int3; ++i) { packet.ReadVector3("Position", i); packet.ReadPackedGuid128("ObjGUID", i); packet.ReadInt32("VignetteID", i); packet.ReadInt32("Unk", i); } // Updated var int4 = packet.ReadInt32("UpdatedCount"); for (var i = 0; i < int4; ++i) packet.ReadPackedGuid128("IDs", i); // VignetteClientData var int5 = packet.ReadInt32("VignetteClientDataCount"); for (var i = 0; i < int5; ++i) { packet.ReadVector3("Position", i); packet.ReadPackedGuid128("ObjGUID", i); packet.ReadInt32("VignetteID", i); packet.ReadInt32("Unk", i); } }
public static void HandleOnMonsterMove(Packet packet) { packet.ReadPackedGuid128("MoverGUID"); var pos = packet.ReadVector3("Position"); ReadMovementMonsterSpline(packet, pos, "MovementMonsterSpline"); }
public static void HandleMoveUpdateTeleport(Packet packet) { ReadMovementStats(packet); var int32 = packet.ReadInt32("MovementForcesCount"); for (int i = 0; i < int32; i++) { packet.ReadPackedGuid128("ID", i); packet.ReadVector3("Direction", i); packet.ReadInt32("TransportID", i); packet.ReadSingle("Magnitude", i); packet.ResetBitReader(); packet.ReadBits("Type", 2, i); } packet.ResetBitReader(); var bit260 = packet.ReadBit("HasWalkSpeed"); var bit276 = packet.ReadBit("HasRunSpeed"); var bit52 = packet.ReadBit("HasRunBackSpeed"); var bit28 = packet.ReadBit("HasSwimSpeed"); var bit76 = packet.ReadBit("HasSwimBackSpeed"); var bit20 = packet.ReadBit("HasFlightSpeed"); var bit268 = packet.ReadBit("HasFlightBackSpeed"); var bit60 = packet.ReadBit("HasTurnRate"); var bit68 = packet.ReadBit("HasPitchRate"); if (bit260) packet.ReadSingle("WalkSpeed"); if (bit276) packet.ReadSingle("RunSpeed"); if (bit52) packet.ReadSingle("RunBackSpeed"); if (bit28) packet.ReadSingle("SwimSpeed"); if (bit76) packet.ReadSingle("SwimBackSpeed"); if (bit20) packet.ReadSingle("FlightSpeed"); if (bit268) packet.ReadSingle("FlightBackSpeed"); if (bit60) packet.ReadSingle("TurnRate"); if (bit68) packet.ReadSingle("PitchRate"); }
public static void HandleNotifyDestLocSpellCast(Packet packet) { packet.ReadPackedGuid128("Caster"); packet.ReadPackedGuid128("DestTransport"); packet.ReadInt32("SpellID"); packet.ReadVector3("SourceLoc"); packet.ReadVector3("DestLoc"); packet.ReadSingle("MissileTrajectoryPitch"); packet.ReadSingle("MissileTrajectorySpeed"); packet.ReadInt32("TravelTime"); packet.ReadByte("DestLocSpellCastIndex"); packet.ReadByte("CastID"); }
public static void HandleNotifyMissileTrajectoryCollision(Packet packet) { packet.ReadPackedGuid128("Caster"); packet.ReadByte("CastID"); packet.ReadVector3("CollisionPos"); }
public static void ReadMovementForce(Packet packet) { packet.ReadPackedGuid128("ID"); packet.ReadVector3("Direction"); packet.ReadInt32("TransportID"); packet.ReadSingle("Magnitude"); packet.ResetBitReader(); packet.ReadBits("Type", 2); }
public static void ReadLocation(Packet packet, params object[] idx) { packet.ReadPackedGuid128("Transport", idx); packet.ReadVector3("Location", idx); }
public static void ReadMovementMonsterSpline(Packet packet, Vector3 pos, params object[] indexes) { packet.ReadUInt32("Id", indexes); packet.ReadVector3("Destination", indexes); ReadMovementSpline(packet, pos, indexes, "MovementSpline"); packet.ResetBitReader(); packet.ReadBit("CrzTeleport", indexes); packet.ReadBits("UnkBit", 2, indexes); }