Skip to content

Commit 4e5dc01

Browse files
committed
Add 12.0 transmog handlers
1 parent 3401a42 commit 4e5dc01

File tree

5 files changed

+128
-9
lines changed

5 files changed

+128
-9
lines changed
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
using WowPacketParser.Enums;
2+
using WowPacketParser.Misc;
3+
using WowPacketParser.Parsing;
4+
5+
namespace WowPacketParserModule.V12_0_0_65390.Parsers
6+
{
7+
public static class TransmogrificationHandler
8+
{
9+
public static void ReadTransmogOutfitDataInfo(Packet packet, params object[] indexes)
10+
{
11+
packet.ResetBitReader();
12+
packet.ReadByte("SetType", indexes);
13+
packet.ReadUInt32("Icon", indexes);
14+
var nameLength = packet.ReadBits(8);
15+
packet.ReadBit("SituationsEnabled", indexes);
16+
packet.ReadWoWString("Name", nameLength, indexes);
17+
}
18+
19+
public static void ReadTransmogOutfitSituationInfo(Packet packet, params object[] indexes)
20+
{
21+
packet.ReadUInt32("SituationID", indexes);
22+
packet.ReadUInt32("SpecID", indexes);
23+
packet.ReadUInt32("LoadoutID", indexes);
24+
packet.ReadUInt32("EquipmentSetID", indexes);
25+
}
26+
27+
public static void ReadTransmogOutfitSlotData(Packet packet, params object[] indexes)
28+
{
29+
packet.ReadSByte("Slot", indexes);
30+
packet.ReadByte("SlotOption", indexes);
31+
packet.ReadUInt32("ItemModifiedAppearanceID", indexes);
32+
packet.ReadByte("AppearanceDisplayType", indexes);
33+
packet.ReadUInt32("SpellItemEnchantmentID", indexes);
34+
packet.ReadByte("IllusionDisplayType", indexes);
35+
packet.ReadUInt32("Flags", indexes);
36+
}
37+
38+
[Parser(Opcode.CMSG_TRANSMOG_OUTFIT_NEW)]
39+
public static void HandleTransmogOutfitNew(Packet packet)
40+
{
41+
packet.ReadPackedGuid128("Npc");
42+
packet.ReadByte("Source");
43+
ReadTransmogOutfitDataInfo(packet, "Info");
44+
}
45+
46+
[Parser(Opcode.SMSG_TRANSMOG_OUTFIT_NEW_ENTRY_ADDED)]
47+
public static void HandleTransmogOutfitNewEntryAdded(Packet packet)
48+
{
49+
packet.ReadUInt32("TransmogOutfitID");
50+
}
51+
52+
[Parser(Opcode.CMSG_TRANSMOG_OUTFIT_UPDATE_INFO)]
53+
public static void HandleTransmogOutfitUpdateInfo(Packet packet)
54+
{
55+
packet.ReadUInt32("TransmogOutfitID");
56+
packet.ReadPackedGuid128("Npc");
57+
ReadTransmogOutfitDataInfo(packet, "Info");
58+
}
59+
60+
[Parser(Opcode.SMSG_TRANSMOG_OUTFIT_INFO_UPDATED)]
61+
public static void HandleTransmogOutfitInfoUpdated(Packet packet)
62+
{
63+
packet.ReadUInt32("TransmogOutfitID");
64+
ReadTransmogOutfitDataInfo(packet, "OutfitInfo");
65+
}
66+
67+
[Parser(Opcode.CMSG_TRANSMOG_OUTFIT_UPDATE_SITUATIONS)]
68+
public static void HandleTransmogOutfitUpdateSituations(Packet packet)
69+
{
70+
packet.ReadUInt32("OutfitID");
71+
packet.ReadPackedGuid128("Npc");
72+
var situationsCount = packet.ReadUInt32();
73+
74+
for (var i = 0u; i < situationsCount; ++i)
75+
ReadTransmogOutfitSituationInfo(packet, "Situations", i);
76+
77+
packet.ResetBitReader();
78+
packet.ReadBit("SituationsEnabled");
79+
}
80+
81+
[Parser(Opcode.SMSG_TRANSMOG_OUTFIT_SITUATIONS_UPDATED)]
82+
public static void HandleTransmogOutfitSituationsUpdated(Packet packet)
83+
{
84+
packet.ReadUInt32("TransmogOutfitID");
85+
var situationsCount = packet.ReadUInt32();
86+
87+
for (var i = 0u; i < situationsCount; ++i)
88+
ReadTransmogOutfitSituationInfo(packet, "Situations", i);
89+
90+
packet.ResetBitReader();
91+
packet.ReadBit("SituationsEnabled");
92+
}
93+
94+
[Parser(Opcode.CMSG_TRANSMOG_OUTFIT_UPDATE_SLOTS)]
95+
public static void HandleTransmogOutfitUpdateSlots(Packet packet)
96+
{
97+
packet.ReadUInt32("OutfitID");
98+
var slotCount = packet.ReadUInt32();
99+
packet.ReadPackedGuid128("Npc");
100+
packet.ReadUInt64("Cost");
101+
102+
for (var i = 0u; i < slotCount; ++i)
103+
ReadTransmogOutfitSlotData(packet, "Slots", i);
104+
105+
packet.ResetBitReader();
106+
packet.ReadBit("UseAvailableDiscount");
107+
}
108+
109+
[Parser(Opcode.SMSG_TRANSMOG_OUTFIT_SLOTS_UPDATED)]
110+
public static void HandleTransmogOutfitSlotsUpdated(Packet packet)
111+
{
112+
packet.ReadUInt32("TransmogOutfitID");
113+
var slotCount = packet.ReadUInt32();
114+
115+
for (var i = 0u; i < slotCount; ++i)
116+
ReadTransmogOutfitSlotData(packet, "Slots", i);
117+
}
118+
}
119+
}

WowPacketParserModule.V12_0_0_65390/Parsers/UpdateFieldsHandler1200.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,8 @@ public static IVisibleItem ReadCreateVisibleItem(Packet packet, params object[]
742742
data.ConditionalItemAppearanceID = packet.ReadInt32("ConditionalItemAppearanceID", indexes);
743743
data.ItemAppearanceModID = packet.ReadUInt16("ItemAppearanceModID", indexes);
744744
data.ItemVisual = packet.ReadUInt16("ItemVisual", indexes);
745-
data.Field_10 = packet.ReadBit("Field_10", indexes);
746-
data.Field_11 = packet.ReadBit("Field_11", indexes);
745+
data.HasTransmog = packet.ReadBit("HasTransmog", indexes);
746+
data.HasIllusion = packet.ReadBit("HasIllusion", indexes);
747747
return data;
748748
}
749749

@@ -759,11 +759,11 @@ public static IVisibleItem ReadUpdateVisibleItem(Packet packet, params object[]
759759
{
760760
if (changesMask[1])
761761
{
762-
data.Field_10 = packet.ReadBit("Field_10", indexes);
762+
data.HasTransmog = packet.ReadBit("HasTransmog", indexes);
763763
}
764764
if (changesMask[2])
765765
{
766-
data.Field_11 = packet.ReadBit("Field_11", indexes);
766+
data.HasIllusion = packet.ReadBit("HasIllusion", indexes);
767767
}
768768
}
769769
packet.ResetBitReader();

WowPacketParserModule.V12_0_0_65390/Parsers/UpdateFieldsHandler1201.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ public static IVisibleItem ReadCreateVisibleItem(Packet packet, params object[]
743743
data.ItemAppearanceModID = packet.ReadUInt16("ItemAppearanceModID", indexes);
744744
data.ItemVisual = packet.ReadUInt16("ItemVisual", indexes);
745745
data.ItemModifiedAppearanceID = packet.ReadUInt32("ItemModifiedAppearanceID", indexes);
746-
data.Field_18 = packet.ReadByte("Field_18", indexes);
746+
data.TransmogSlotOption = packet.ReadByte("TransmogSlotOption", indexes);
747747
data.HasTransmog = packet.ReadBit("HasTransmog", indexes);
748748
data.HasIllusion = packet.ReadBit("HasIllusion", indexes);
749749
return data;
@@ -797,7 +797,7 @@ public static IVisibleItem ReadUpdateVisibleItem(Packet packet, params object[]
797797
}
798798
if (changesMask[9])
799799
{
800-
data.Field_18 = packet.ReadByte("Field_18", indexes);
800+
data.TransmogSlotOption = packet.ReadByte("TransmogSlotOption", indexes);
801801
}
802802
}
803803
return data;

WowPacketParserModule.V12_0_0_65390/UpdateFields/V12_0_0_65390/VisibleItem.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public class VisibleItem : IMutableVisibleItem
1616
public System.Nullable<int> ConditionalItemAppearanceID { get; set; }
1717
public System.Nullable<ushort> ItemAppearanceModID { get; set; }
1818
public System.Nullable<ushort> ItemVisual { get; set; }
19-
public System.Nullable<bool> Field_10 { get; set; }
20-
public System.Nullable<bool> Field_11 { get; set; }
19+
public System.Nullable<bool> HasTransmog { get; set; }
20+
public System.Nullable<bool> HasIllusion { get; set; }
2121
}
2222
}
2323

WowPacketParserModule.V12_0_0_65390/UpdateFields/V12_0_1_65818/VisibleItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class VisibleItem : IMutableVisibleItem
1717
public System.Nullable<ushort> ItemAppearanceModID { get; set; }
1818
public System.Nullable<ushort> ItemVisual { get; set; }
1919
public System.Nullable<uint> ItemModifiedAppearanceID { get; set; }
20-
public System.Nullable<byte> Field_18 { get; set; }
20+
public System.Nullable<byte> TransmogSlotOption { get; set; }
2121
public System.Nullable<bool> HasTransmog { get; set; }
2222
public System.Nullable<bool> HasIllusion { get; set; }
2323
}

0 commit comments

Comments
 (0)