public static void HandleVoiceRosterUpdate(Packet packet)
        {
            packet.ReadGuid("Group GUID");
            packet.ReadInt16("Channel ID");
            packet.ReadByte("Channel Type"); // 0: channel, 2: party
            packet.ReadCString("Channel Name");
            packet.WriteLine("Encryption Key: " + Utilities.ByteArrayToHexString(packet.ReadBytes(16)));
            packet.WriteLine("IP: " + packet.ReadIPAddress());
            packet.ReadInt16("Voice Server Port");

            var count = packet.ReadByte("Player Count");

            packet.ReadGuid("Leader GUID");

            var leaderFlags1 = packet.ReadByte();
            packet.WriteLine("Leader Flags 1: 0x" + leaderFlags1.ToString("X2"));

            var leaderFlags2 = packet.ReadByte();
            packet.WriteLine("Leader Flags 2: 0x" + leaderFlags2.ToString("X2"));

            for (var i = 0; i < count - 1; i++)
            {
                packet.ReadGuid("Player GUID");
                packet.ReadByte("Index");
                var flags1 = packet.ReadByte();
                packet.WriteLine("Flags 1: 0x" + flags1.ToString("X2"));
                var flags2 = packet.ReadByte();
                packet.WriteLine("Flags 2: 0x" + flags2.ToString("X2"));
            }
        }
        public static void HandleVoiceRosterUpdate(Packet packet)
        {
            packet.ReadGuid("Group GUID");
            packet.ReadInt16("Channel ID");
            packet.ReadByte("Channel Type"); // 0: channel, 2: party
            packet.ReadCString("Channel Name");
            packet.ReadBytes("Encryption Key", 16);
            packet.ReadIPAddress("IP");
            packet.ReadInt16("Voice Server Port");

            var count = packet.ReadByte("Player Count");

            packet.ReadGuid("Leader GUID");

            var leaderFlags1 = packet.ReadByte();
            packet.AddValue("Leader Flags 1", "0x" + leaderFlags1.ToString("X2"));

            var leaderFlags2 = packet.ReadByte();
            packet.AddValue("Leader Flags 2", "0x" + leaderFlags2.ToString("X2"));

            for (var i = 0; i < count - 1; i++)
            {
                packet.ReadGuid("Player GUID");
                packet.ReadByte("Index");
                var flags1 = packet.ReadByte();
                packet.AddValue("Flags 1", "0x" + flags1.ToString("X2"));
                var flags2 = packet.ReadByte();
                packet.AddValue("Flags 2", "0x" + flags2.ToString("X2"));
            }
        }
Example #3
0
        public static void HandlePetSpells(Packet packet)
        {
            packet.ReadPackedGuid128("PetGUID");
            packet.ReadInt16("CreatureFamily");
            packet.ReadInt16("Specialization");
            packet.ReadInt32("TimeLimit");

            ReadPetFlags(packet, "PetModeAndOrders");

            const int maxCreatureSpells = 10;
            for (var i = 0; i < maxCreatureSpells; i++) // Read pet / vehicle spell ids
                V6_0_2_19033.Parsers.PetHandler.ReadPetAction(packet, "ActionButtons", i);

            var actionsCount = packet.ReadInt32("ActionsCount");
            var cooldownsCount = packet.ReadUInt32("CooldownsCount");
            var spellHistoryCount = packet.ReadUInt32("SpellHistoryCount");

            for (int i = 0; i < actionsCount; i++)
                V6_0_2_19033.Parsers.PetHandler.ReadPetAction(packet, i, "Actions");

            for (int i = 0; i < cooldownsCount; i++)
                V6_0_2_19033.Parsers.PetHandler.ReadPetSpellCooldownData(packet, i, "PetSpellCooldown");

            for (int i = 0; i < spellHistoryCount; i++)
                V6_0_2_19033.Parsers.PetHandler.ReadPetSpellHistoryData(packet, i, "PetSpellHistory");
        }
        public static void ReadClientBattlePet(Packet packet, params object[] idx)
        {
            packet.ReadPackedGuid128("BattlePetGUID", idx);

            packet.ReadInt32("SpeciesID", idx);
            packet.ReadInt32("DisplayID", idx);
            packet.ReadInt32("CollarID", idx);

            packet.ReadInt16("BreedID", idx);
            packet.ReadInt16("Level", idx);
            packet.ReadInt16("Xp", idx);
            packet.ReadInt16("BattlePetDBFlags", idx);

            packet.ReadInt32("Power", idx);
            packet.ReadInt32("Health", idx);
            packet.ReadInt32("MaxHealth", idx);
            packet.ReadInt32("Speed", idx);

            packet.ReadByte("BreedQuality", idx);

            packet.ResetBitReader();

            var customNameLength = packet.ReadBits(7);
            var hasOwnerInfo = packet.ReadBit("HasOwnerInfo", idx);
            packet.ReadBit("NoRename", idx);

            packet.ReadWoWString("CustomName", customNameLength, idx);

            if (hasOwnerInfo)
                V6_0_2_19033.Parsers.BattlePetHandler.ReadClientBattlePetOwnerInfo(packet, "OwnerInfo", idx);
        }
Example #5
0
        public static void HandleAuthResponse(Packet packet)
        {
            var count = 0u;
            var count1 = 0u;
            var isQueued = packet.ReadBit("Is In Queue");

            if (isQueued)
                packet.ReadBit("unk0");

            var hasAccountData = packet.ReadBit("Has Account Data");

            if (hasAccountData)
            {
                packet.ReadBit("Unk 1");
                packet.ReadBit("Unk 2");
                count1 = packet.ReadBits("Race Activation Count", 23);
                packet.ReadBit("Unk 3");
                packet.ReadBits("Unkbits", 21);
                count = packet.ReadBits("Class Activation Count", 23);
                packet.ReadBits("Unkbits", 22);
                packet.ReadBit("Unk 4");

            }
            packet.ResetBitReader();

            if (hasAccountData)
            {
                packet.ReadByte("unk");
                for (var i = 0; i < count; ++i)
                {
                    packet.ReadEnum<ClientType>("Class Expansion", TypeCode.Byte, i);
                    packet.ReadEnum<Class>("Class", TypeCode.Byte, i);
                }

                packet.ReadInt16("UnkInt16 1");
                packet.ReadInt16("UnkInt16 2");

                for (var i = 0; i < count1; ++i)
                {
                    packet.ReadEnum<ClientType>("Race Expansion", TypeCode.Byte, i);
                    packet.ReadEnum<Race>("Race", TypeCode.Byte, i);
                }

                packet.ReadUInt32("Unk 8");
                packet.ReadUInt32("Unk 9");
                packet.ReadUInt32("Unk 10");

                packet.ReadEnum<ClientType>("Account Expansion", TypeCode.Byte);
                packet.ReadEnum<ClientType>("Player Expansion", TypeCode.Byte);

            }

            packet.ReadEnum<ResponseCode>("Auth Code", TypeCode.Byte);

            if (isQueued)
                packet.ReadUInt32("Unk 11");
        }
        public static void HandleBattleFinalRound(Packet packet)
        {
            var bits14 = 0;
            bits14 = (int)packet.ReadBits(20);

            var bit1 = new bool[bits14];
            var bit2 = new bool[bits14];
            var bit3 = new bool[bits14];
            var bit4 = new bool[bits14];
            var bit6 = new bool[bits14];
            var bit10 = new bool[bits14];
            var battleAbandon = false;
            var bit24 = false;
            var bitEB = new bool[bits14];

            for (var i = 0; i < 2; ++i) // for win/lose
            {
                bit24 = packet.ReadBit("Win/Lose", i);
            }

            for (var i = 0; i < bits14; ++i)
            {
                bit3[i] = packet.ReadBit();
                bit1[i] = packet.ReadBit();
                bit2[i] = packet.ReadBit();
                bitEB[i] = packet.ReadBit();
                bit4[i] = !packet.ReadBit("unk4", i);
                bit6[i] = !packet.ReadBit("unk6", i);
                bit10[i] = !packet.ReadBit("unk10", i);
            }

            var bit11 = packet.ReadBit();
            battleAbandon = packet.ReadBit("battleAbandon");

            for (var i = 0; i < 2; ++i)
            {
                packet.ReadInt32("Int28", i);
            }

            for (var i = 0; i < bits14; ++i)
            {
                packet.ReadByte("Slot", i);

                if (bit4[i])
                    packet.ReadInt16("Level after fight", i);
                if (bit6[i])
                    packet.ReadInt16("Experience", i);

                packet.ReadInt32("Health after fight", i);
                packet.ReadInt32("Health", i);

                if (bit10[i])
                    packet.ReadInt16("Level before fight", i);
            }
        }
        public static void HandleLoadCUFProfiles(Packet packet)
        {
            var count = packet.ReadBits("count", 19);

            var strlen = new uint[count];

            for (int i = 0; i < count; ++i)
            {
                packet.ReadBit("Talent spec 1", i);                         // 165
                packet.ReadBit("3 player group", i);                        // 159
                packet.ReadBit("Unk 157", i);                               // 157
                packet.ReadBit("10 player group", i);                       // 161
                packet.ReadBit("40 player group", i);                       // 164
                packet.ReadBit("Border", i);                                // 141
                packet.ReadBit("Class colors", i);                          // 142
                packet.ReadBit("Keep groups together", i);                  // 134
                packet.ReadBit("Display power bars", i);                    // 140
                strlen[i] = packet.ReadBits("String length", 7, i);         // 0
                packet.ReadBit("Pets", i);                                  // 135
                packet.ReadBit("Aggro highlight", i);                       // 138
                packet.ReadBit("Unk 145", i);                               // 145
                packet.ReadBit("PvP", i);                                   // 167
                packet.ReadBit("Unk 156", i);                               // 156
                packet.ReadBit("Main tank and assist", i);                  // 136
                packet.ReadBit("Debuffs", i);                               // 144
                packet.ReadBit("Horizontal groups", i);                     // 143
                packet.ReadBit("Talent spec 2", i);                         // 166
                packet.ReadBit("Incoming heals", i);                        // 137
                packet.ReadBit("Dispellable debuffs", i);                   // 139
                packet.ReadBit("25 player group", i);                       // 163
                packet.ReadBit("PvE", i);                                   // 168
                packet.ReadBit("5 player group", i);                        // 160
                packet.ReadBit("15 player group", i);                       // 162
                packet.ReadBit("2 player group", i);                        // 158
            }

            for (int i = 0; i < count; ++i)
            {
                packet.ReadInt16("Unk 152", i);                             // 152
                packet.ReadInt16("Unk 154", i);                             // 154
                packet.ReadByte("Health text", i); // 0 - none, 1 - remaining, 2 - lost, 3 - percentage 133
                packet.ReadWoWString("Name", (int)strlen[i], i);            // 172
                packet.ReadByte("Unk 147", i);                              // 147
                packet.ReadByte("Unk 146", i);                              // 146
                packet.ReadInt16("Frame height", i);                        // 128
                packet.ReadByte("Unk 148", i);                              // 148
                packet.ReadByte("Sort by", i); // 0 - role, 1 - group, 2 - alphabetical 132
                packet.ReadInt16("Frame width", i);                         // 130
                packet.ReadInt16("Unk 150", i);                             // 150
            }
        }
        public static void HandleLoadCUFProfiles(Packet packet)
        {
            var count = packet.ReadBits("Count", 19);

            var strlen = new uint[count];

            for (var i = 0; i < count; ++i)
            {
                packet.ReadBit("Unk 1", i);
                packet.ReadBit("Unk 2", i);
                packet.ReadBit("Unk 3", i);
                packet.ReadBit("Unk 4", i);
                packet.ReadBit("Unk 5", i);
                packet.ReadBit("Unk 6", i);
                packet.ReadBit("Unk 7", i);
                packet.ReadBit("Unk 8", i);
                packet.ReadBit("Unk 9", i);
                packet.ReadBit("Unk 10", i);
                packet.ReadBit("Unk 11", i);
                packet.ReadBit("Unk 12", i);
                packet.ReadBit("Unk 13", i);
                packet.ReadBit("Unk 14", i);
                packet.ReadBit("Unk 15", i);
                packet.ReadBit("Unk 16", i);
                packet.ReadBit("Unk 17", i);
                packet.ReadBit("Unk 18", i);
                packet.ReadBit("Unk 19", i);
                packet.ReadBit("Unk 20", i);
                packet.ReadBit("Unk 21", i);
                strlen[i] = packet.ReadBits("String length", 7, i);
                packet.ReadBit("Unk 22", i);
                packet.ReadBit("Unk 23", i);
                packet.ReadBit("Unk 24", i);
                packet.ReadBit("Unk 25", i);
            }

            for (var i = 0; i < count; ++i)
            {
                packet.ReadInt16("Unk 25", i);
                packet.ReadInt16("Frame height", i);
                packet.ReadByte("Unk 26", i);
                packet.ReadInt16("Frame width", i);
                packet.ReadByte("Unk 27", i);
                packet.ReadInt16("Unk 28", i);
                packet.ReadByte("Unk 29", i);
                packet.ReadByte("Unk 27", i);
                packet.ReadByte("Unk 31", i);
                packet.ReadWoWString("Name", strlen[i], i);
                packet.ReadInt16("Unk 32", i);
            }
        }
        public static void HandleCUFProfiles(Packet packet)
        {
            var count = packet.ReadUInt32("Count");

            for (int i = 0; i < count; ++i)
            {
                var strlen = packet.ReadBits(7);

                packet.ReadBit("KeepGroupsTogether", i);
                packet.ReadBit("DisplayPets", i);
                packet.ReadBit("DisplayMainTankAndAssist", i);
                packet.ReadBit("DisplayHealPrediction", i);
                packet.ReadBit("DisplayAggroHighlight", i);
                packet.ReadBit("DisplayOnlyDispellableDebuffs", i);
                packet.ReadBit("DisplayPowerBar", i);
                packet.ReadBit("DisplayBorder", i);
                packet.ReadBit("UseClassColors", i);
                packet.ReadBit("HorizontalGroups", i);
                packet.ReadBit("DisplayNonBossDebuffs", i);
                packet.ReadBit("DynamicPosition", i);
                packet.ReadBit("Locked", i);
                packet.ReadBit("Shown", i);
                packet.ReadBit("AutoActivate2Players", i);
                packet.ReadBit("AutoActivate3Players", i);
                packet.ReadBit("AutoActivate5Players", i);
                packet.ReadBit("AutoActivate10Players", i);
                packet.ReadBit("AutoActivate15Players", i);
                packet.ReadBit("AutoActivate25Players", i);
                packet.ReadBit("AutoActivate40Players", i);
                packet.ReadBit("AutoActivateSpec1", i);
                packet.ReadBit("AutoActivateSpec2", i);
                packet.ReadBit("AutoActivatePvP", i);
                packet.ReadBit("AutoActivatePvE", i);

                packet.ReadInt16("FrameHeight", i);
                packet.ReadInt16("FrameWidth", i);

                packet.ReadByte("SortBy", i);
                packet.ReadByte("HealthText", i);
                packet.ReadByte("TopPoint", i);
                packet.ReadByte("BottomPoint", i);
                packet.ReadByte("LeftPoint", i);

                packet.ReadInt16("TopOffset", i);
                packet.ReadInt16("BottomOffset", i);
                packet.ReadInt16("LeftOffset", i);

                packet.ReadWoWString("Name", strlen, i);
            }
        }
        public static void HandleInspectHonorStatsResponse(Packet packet)
        {
            var guid = new byte[8];

            // Might be swapped, unsure
            packet.ReadInt16("Yesterday Honorable Kills");
            packet.ReadByte("Lifetime Max Rank");
            packet.ReadInt32("Life Time Kills");
            packet.ReadInt16("Today Honorable Kills");

            packet.StartBitStream(guid, 4, 3, 5, 7, 6, 0, 2, 1);
            packet.ParseBitStream(guid, 3, 0, 5, 2, 6, 7, 4, 1);

            packet.WriteGuid("Guid", guid);
        }
        public static void HandleChallengeModeAllMapStats(Packet packet)
        {
            var bits10 = 0;
            bits10 = (int)packet.ReadBits(19);

            var bits30 = new uint[bits10];
            for (var i = 0; i < bits10; ++i)
            {
                bits30[i] = packet.ReadBits(23);
            }

            for (var i = 0; i < bits10; ++i)
            {
                packet.ReadInt32("Int14", i);
                packet.ReadInt32("Int15", i);

                for (var j = 0; j < bits30[i]; ++j)
                {
                    packet.ReadInt16("Int16", i, j);
                }

                packet.ReadInt32("Int17", i);
                packet.ReadInt32("Int18", i);
            }
        }
Example #12
0
        public static void HandleGMTicketCaseStatus(Packet packet)
        {
            if (ClientVersion.RemovedInVersion(ClientVersionBuild.V6_2_2_20444))
            {
                packet.ReadTime("OldestTicketTime");
                packet.ReadTime("UpdateTime");
            }

            var int24 = packet.ReadInt32("CasesCount");
            for (int i = 0; i < int24; i++)
            {
                packet.ReadInt32("CaseID", i);
                packet.ReadInt32("CaseOpened", i);
                packet.ReadInt32("CaseStatus", i);
                packet.ReadInt16("CfgRealmID", i);
                packet.ReadInt64("CharacterID", i);
                packet.ReadInt32("WaitTimeOverrideMinutes", i);

                packet.ResetBitReader();
                var bits12 = packet.ReadBits(11);
                var bits262 = packet.ReadBits(10);

                packet.ReadWoWString("Url", bits12, i);
                packet.ReadWoWString("WaitTimeOverrideMessage", bits262, i);
            }
        }
Example #13
0
 public static void ReadPetSpellCooldownData(Packet packet, params object[] idx)
 {
     packet.ReadInt32("SpellID", idx);
     packet.ReadInt32("Duration", idx);
     packet.ReadInt32("CategoryDuration", idx);
     packet.ReadSingle("ModRate", idx);
     packet.ReadInt16("Category", idx);
 }
        public static void HandleInitWorldStates(Packet packet)
        {
            packet.ReadInt32<MapId>("Map ID");
            packet.ReadInt32<ZoneId>("Zone Id");
            CurrentAreaId = packet.ReadInt32<AreaId>("Area Id");

            var numFields = packet.ReadInt16("Field Count");
            for (var i = 0; i < numFields; i++)
                ReadWorldStateBlock(packet, i);
        }
        public static void HandleInitWorldStates(Packet packet)
        {
            packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map ID");
            packet.ReadInt32("Zone ID");
            packet.ReadInt32("Area ID");

            var numFields = packet.ReadInt16("Field Count");
            for (var i = 0; i < numFields; i++)
                ReadWorldStateBlock(ref packet);
        }
        public static void HandleInitWorldStates(Packet packet)
        {
            packet.ReadEntry<Int32>(StoreNameType.Map, "Map ID");
            packet.ReadEntry<Int32>(StoreNameType.Zone, "Zone Id");
            CurrentAreaId = packet.ReadEntry<Int32>(StoreNameType.Area, "Area Id");

            var numFields = packet.ReadInt16("Field Count");
            for (var i = 0; i < numFields; i++)
                ReadWorldStateBlock(ref packet, i);
        }
Example #17
0
        public static void HandleUpdateObject(Packet packet)
        {
            var count = packet.ReadUInt32("NumObjUpdates");
            uint map = packet.ReadUInt16<MapId>("MapID");
            packet.ResetBitReader();
            var bit552 = packet.ReadBit("HasDestroyObjects");
            if (bit552)
            {
                packet.ReadInt16("Int0");
                var int8 = packet.ReadUInt32("DestroyObjectsCount");
                for (var i = 0; i < int8; i++)
                    packet.ReadPackedGuid128("Object GUID", i);
            }
            packet.ReadUInt32("Data size");

            for (var i = 0; i < count; i++)
            {
                var type = packet.ReadByte();
                var typeString = ((UpdateTypeCataclysm)type).ToString();

                packet.AddValue("UpdateType", typeString, i);
                switch (typeString)
                {
                    case "Values":
                        {
                            var guid = packet.ReadPackedGuid128("Object Guid", i);

                            WoWObject obj;
                            var updates = CoreParsers.UpdateHandler.ReadValuesUpdateBlock(packet, guid.GetObjectType(), i, false);

                            if (Storage.Objects.TryGetValue(guid, out obj))
                            {
                                if (obj.ChangedUpdateFieldsList == null)
                                    obj.ChangedUpdateFieldsList = new List<Dictionary<int, UpdateField>>();
                                obj.ChangedUpdateFieldsList.Add(updates);
                            }

                            break;
                        }
                    case "CreateObject1":
                    case "CreateObject2": // Might != CreateObject1 on Cata
                        {
                            var guid = packet.ReadPackedGuid128("Object Guid", i);
                            ReadCreateObjectBlock(packet, guid, map, i);
                            break;
                        }
                }
            }
        }
        public static void HandleInitWorldStates(Packet packet)
        {
            packet.ReadEntry<Int32>(StoreNameType.Map, "Map ID");
            packet.ReadEntry<Int32>(StoreNameType.Zone, "Zone Id");
            CurrentAreaId = packet.ReadEntry<Int32>(StoreNameType.Area, "Area Id");

            var numFields = packet.ReadInt16("Field Count");
            //packet.ReadByte("UnkB");
            /*for (var i = 0; i < numFields; i++)
            {
                var val = packet.ReadByte();
                packet.WriteLine("Field: {0} - Value: {1}", i, val);
            }*/
            packet.ReadToEnd();
        }
        public static void HandleChallengeModeMapStatsUpdate(Packet packet)
        {
            var bits40 = 0;

            packet.ReadInt32("Int14");
            packet.ReadInt32("Int18");
            packet.ReadInt32("Int1C");
            packet.ReadInt32("Int10");
            bits40 = (int)packet.ReadBits(23);

            for (var i = 0; i < bits40; ++i)
            {
                packet.ReadInt16("IntEA", i);
            }
        }
 public static void HandleChallengeModeallMapStats(Packet packet)
 {
     var count = packet.ReadBits("Count", 19); // 16
     var unk68 = new UInt32[count];
     for (var i = 0; i < count; i++)
         unk68[i] = packet.ReadBits(23);
     for (var i = 0; i < count; i++)
     {
         packet.ReadPackedTime("Time", i);
         packet.ReadInt32("unk32", i); // 32
         packet.ReadInt32("unk20", i); // 20
         packet.ReadInt32("unk28", i); // 28
         for (var j = 0; j < unk68[i]; j++)
             packet.ReadInt16("unk72", i, j);
         packet.ReadInt32("unk24", i); // 24
     }
 }
        public static void HandleBattlePetJournal(Packet packet)
        {
            packet.ReadInt16("TrapLevel");

            var slotsCount = packet.ReadInt32("SlotsCount");
            var petsCount = packet.ReadInt32("PetsCount");

            for (var i = 0; i < slotsCount; i++)
                ReadClientPetBattleSlot(packet, i);

            for (var i = 0; i < petsCount; i++)
                ReadClientBattlePet(packet, i);

            packet.ResetBitReader();

            packet.ReadBit("HasJournalLock");
        }
        public static void HandleVoiceRosterUpdate(Packet packet)
        {
            packet.ReadInt64("Voice Channel ID");
            packet.ReadInt16("Channel ID");
            packet.ReadByte("Channel Type"); // 0: channel, 2: party
            packet.ReadCString("Channel Name");

            var key = Encoding.UTF8.GetString(packet.ReadBytes(16));
            packet.Writer.WriteLine("Encryption Key: " + key);

            packet.ReadUInt32("Voice Server IP");
            packet.ReadByte("Voice Server Port");

            var count = packet.ReadByte("Player Count");

            packet.ReadGuid("Leader GUID");

            var leaderFlags1 = packet.ReadByte();
            packet.Writer.WriteLine("Leader Flags 1: 0x" + leaderFlags1.ToString("X2"));

            var leaderFlags2 = packet.ReadByte();
            packet.Writer.WriteLine("Leader Flags 2: 0x" + leaderFlags2.ToString("X2"));

            for (var i = 0; i < count - 1; i++)
            {
                packet.ReadGuid("Player GUID");

                packet.ReadByte("Index");

                var flags1 = packet.ReadByte();
                packet.Writer.WriteLine("Flags 1: 0x" + flags1.ToString("X2"));

                var flags2 = packet.ReadByte();
                packet.Writer.WriteLine("Flags 2: 0x" + flags2.ToString("X2"));
            }
        }
Example #23
0
        public static void HandleSpellMultistrikeEffect(Packet packet)
        {
            packet.ReadPackedGuid128("Caster");
            packet.ReadPackedGuid128("Target");
            packet.ReadInt32("SpellID");

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V6_2_0_20173))
                packet.ReadInt32("SpellXSpellVisualID");

            packet.ReadInt16("ProcCount");
            packet.ReadInt16("ProcNum");
        }
Example #24
0
 public static void HandleLearnTalents(Packet packet)
 {
     var talentCount = packet.ReadInt32("TalentCount");
     for (int i = 0; i < talentCount; i++)
         packet.ReadInt16("Talents");
 }
Example #25
0
        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 ReadMonsterSplineFilter(Packet packet, params object[] indexes)
        {
            var count = packet.ReadUInt32("MonsterSplineFilterKey", indexes);
            packet.ReadSingle("BaseSpeed", indexes);
            packet.ReadUInt16("StartOffset", indexes);
            packet.ReadSingle("DistToPrevFilterKey", indexes);

            for (int i = 0; i < count; i++)
            {
                packet.ReadInt16("IDx", indexes, i);
                packet.ReadUInt16("Speed", indexes, i);
            }

            packet.ReadUInt16("AddedToStart", indexes);

            packet.ResetBitReader();
            packet.ReadBits("FilterFlags", 2, indexes);
        }
 public static void HandleSetMovementAnimKit(Packet packet)
 {
     packet.ReadPackedGuid128("Unit");
     packet.ReadInt16("AnimKitID");
 }
        public static void HandlePhaseShift(Packet packet)
        {
            packet.ReadPackedGuid128("Client");

            // PhaseShiftData
            packet.ReadInt32("PhaseShiftFlags");
            var count = packet.ReadInt32("PhaseShiftCount");
            packet.ReadPackedGuid128("PersonalGUID");
            for (var i = 0; i < count; ++i)
            {
                packet.ReadInt16("PhaseFlags", i);
                packet.ReadInt16("Id", i);
            }

            var preloadMapIDCount = packet.ReadInt32("PreloadMapIDsCount") / 2;
            for (var i = 0; i < preloadMapIDCount; ++i)
                packet.ReadInt16<MapId>("PreloadMapID", i);

            var uiWorldMapAreaIDSwapsCount = packet.ReadInt32("UiWorldMapAreaIDSwap") / 2;
            for (var i = 0; i < uiWorldMapAreaIDSwapsCount; ++i)
                packet.ReadInt16<MapId>("UiWorldMapAreaIDSwaps", i);

            var visibleMapIDsCount = packet.ReadInt32("VisibleMapIDsCount") / 2;
            for (var i = 0; i < visibleMapIDsCount; ++i)
                packet.ReadInt16<MapId>("VisibleMapID", i);
        }
        public static void HandleMoveSetCompoundState(Packet packet)
        {
            packet.ReadPackedGuid128("MoverGUID");

            var moveStateChangeCount = packet.ReadInt32("MoveStateChangeCount");
            for (int i = 0; i < moveStateChangeCount; i++)
            {
                packet.ReadInt16("MessageID");
                packet.ReadInt32("SequenceIndex");

                packet.ResetBitReader();

                var bit12 = packet.ReadBit("HasSpeed");
                var bit32 = packet.ReadBit("HasKnockBack");
                var bit40 = packet.ReadBit("HasVehicle");
                var bit56 = packet.ReadBit("HasCollisionHeight");
                var bit104 = packet.ReadBit("HasMovementForce");
                var bit128 = packet.ReadBit("HasMoverGUID");

                if (bit12)
                    packet.ReadSingle("Speed");

                if (bit32)
                {
                    packet.ReadSingle("HorzSpeed");
                    packet.ReadVector2("InitVertSpeed");
                    packet.ReadSingle("InitVertSpeed");
                }

                if (bit40)
                    packet.ReadInt32("VehicleRecID");

                if (bit56)
                {
                    packet.ReadSingle("Height");
                    packet.ReadSingle("Scale");
                    packet.ReadBits("UpdateCollisionHeightReason", 2);
                }

                if (bit104)
                    ReadMovementForce(packet);

                if (bit128)
                    packet.ReadPackedGuid128("MoverGUID");
            }
        }
Example #30
0
        public static void HandlePhaseShift406(Packet packet)
        {
            packet.ReadGuid("GUID");
            var i = 0;
            int count = packet.ReadInt32("Count");
            for (var j = 0; j < count / 2; ++j)
                packet.ReadEntryWithName<Int16>(StoreNameType.Map, "Unk", i, j);

            i++;
            count = packet.ReadInt32();
            for (var j = 0; j < count / 2; ++j)
                packet.ReadEntryWithName<Int16>(StoreNameType.Map, "Terrain Swap 1", i, j);

            i++;
            count = packet.ReadInt32();
            var phaseMask = 0;
            for (var j = 0; j < count / 2; ++j)
                phaseMask = packet.ReadInt16("Phases", ++i, j);

            i++;
            count = packet.ReadInt32();
            for (var j = 0; j < count / 2; ++j)
                packet.ReadEntryWithName<Int16>(StoreNameType.Map, "Terrain Swap 2", i, j);

            packet.ReadUInt32("Flag"); // can be 0, 4 or 8, 8 = normal world, others are unknown

            //CurrentPhaseMask = phaseMask;
            packet.AddSniffData(StoreNameType.Phase, phaseMask, "PHASEMASK 406");
        }