Skip to content

Commit

Permalink
Fix 4.4.1 SMSG_GOSSIP_MESSAGE
Browse files Browse the repository at this point in the history
  • Loading branch information
funjoker committed Nov 5, 2024
1 parent b88f571 commit 9132658
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions WowPacketParserModule.V4_4_0_54481/Parsers/NpcHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,20 @@ public static GossipMessageOption ReadGossipOptionsData(uint menuId, WowGuid npc
bool hasSpellId = packet.ReadBit();
bool hasOverrideIconId = packet.ReadBit();

uint failureDescriptionLength = 0;
if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_4_1_57294))
failureDescriptionLength = packet.ReadBits(8);

uint rewardsCount = packet.ReadUInt32();
for (uint i = 0; i < rewardsCount; ++i)
{
packet.ResetBitReader();
packet.ReadBits("Type", 1, idx, "TreasureItem", i);
packet.ReadInt32("ID", idx, "TreasureItem", i);
packet.ReadInt32("Quantity", idx, "TreasureItem", i);

if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_4_1_57294))
packet.ReadByte("ItemContext", idx, "TreasureItem", i);
}

gossipOption.OptionText = gossipMessageOption.Text = packet.ReadWoWString("Text", textLen, idx);
Expand All @@ -73,6 +80,9 @@ public static GossipMessageOption ReadGossipOptionsData(uint menuId, WowGuid npc
if (hasOverrideIconId)
gossipOption.OverrideIconID = packet.ReadInt32("OverrideIconID", idx);

if (failureDescriptionLength > 1)
packet.ReadDynamicString("FailureDescription", failureDescriptionLength);

gossipOption.FillBroadcastTextIDs();

if (Settings.TargetedDatabase < TargetedDatabase.Shadowlands)
Expand Down Expand Up @@ -119,6 +129,9 @@ public static void HandleNpcGossip(Packet packet)
int menuId = packet.ReadInt32("GossipID");
packetGossip.MenuId = (uint)menuId;

if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_4_1_57294))
packet.ReadInt32("LfgDungeonsID");

int friendshipFactionID = packet.ReadInt32("FriendshipFactionID");
CoreParsers.NpcHandler.AddGossipAddon(packetGossip.MenuId, friendshipFactionID, 0, guid, packet.TimeSpan);

Expand Down

0 comments on commit 9132658

Please sign in to comment.