Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 43 additions & 3 deletions WowPacketParserModule.V10_0_0_46181/Parsers/CraftingHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,26 +83,60 @@ public static void ReadCraftingOrderItem(Packet packet, params object[] indexes)
packet.ReadByte("DataSlotIndex", indexes);
}

public static void ReadCraftingOrderCustomer(Packet packet, params object[] indexes)
{
packet.ReadPackedGuid128("CustomerGUID", indexes);
packet.ReadPackedGuid128("CustomerAccountGUID", indexes);
}

public static void ReadCraftingOrderNpcCustomer(Packet packet, params object[] indexes)
{
packet.ReadInt64("NpcCraftingOrderCustomerID", indexes);
packet.ReadInt32("NpcCraftingOrderSetFlags", indexes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where did you get this name from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mix of both RE & guessed, you can delete it, the dev don't remember exactly but have did these flags name if that can help you

enum NpcCraftingOrderSetFlags : uint32
{
    CraftingOrderFlagAllowMultiple = 0x01,
    CraftingOrderFlagAllowDuplicate = 0x02
};

}

public static void ReadCraftingOrderData(Packet packet, params object[] indexes)
{
packet.ReadInt32("field_0", indexes);
packet.ReadUInt64("OrderID", indexes);
packet.ReadInt32("SkillLineAbilityID", indexes);
packet.ReadByte("OrderState", indexes);

if (ClientVersion.AddedInVersion(ClientVersionBuild.V11_1_5_60392))
packet.ReadInt32("OrderState", indexes);
else
packet.ReadByte("OrderState", indexes);

packet.ReadByte("OrderType", indexes);
packet.ReadByte("MinQuality", indexes);
packet.ReadTime64("ExpirationTime", indexes);
packet.ReadTime64("ClaimEndTime", indexes);
packet.ReadUInt64("TipAmount", indexes);
packet.ReadUInt64("ConsortiumCut", indexes);
packet.ReadUInt32("Flags", indexes);
packet.ReadPackedGuid128("CustomerGUID", indexes);
packet.ReadPackedGuid128("CustomerAccountGUID", indexes);

if (ClientVersion.RemovedInVersion(ClientVersionBuild.V11_0_2_55959))
ReadCraftingOrderCustomer(packet, indexes, "Customer");

packet.ReadPackedGuid128("CrafterGUID", indexes);
packet.ReadPackedGuid128("PersonalCrafterGUID", indexes);

if (ClientVersion.AddedInVersion(ClientVersionBuild.V11_0_2_55959))
{
packet.ReadInt32("NpcCraftingOrderSetID", indexes);
packet.ReadInt32("NpcTreasureID", indexes);
}

var reagentsCount = packet.ReadUInt32();
var customerNotesLength = packet.ReadBits(10);

var hasCustomer = false;
var hasNpcCraftingData = false;
if (ClientVersion.AddedInVersion(ClientVersionBuild.V11_0_2_55959))
{
hasCustomer = packet.ReadBit();
hasNpcCraftingData = packet.ReadBit();
}

var hasOutputItem = packet.ReadBit();
var hasOutputItemData = packet.ReadBit();

Expand All @@ -113,6 +147,12 @@ public static void ReadCraftingOrderData(Packet packet, params object[] indexes)

packet.ReadWoWString("CustomerNotes", customerNotesLength, indexes);

if (hasCustomer)
ReadCraftingOrderCustomer(packet, indexes, "Customer");

if (hasNpcCraftingData)
ReadCraftingOrderNpcCustomer(packet, indexes, "NpcCustomer");

if (hasOutputItem)
ReadCraftingOrderItem(packet, indexes, "OutputItem");

Expand Down