Fix vanilla spell cast and use-item packet formats for Turtle/Classic

SpellCastTargets target mask is uint16 in vanilla 1.12.x, not uint32
like WotLK. The 2 extra bytes corrupted every spell packet. Also add
classic CMSG_USE_ITEM builder (bag+slot+spellIndex+targets only, no
spellId/itemGuid/glyphIndex/castFlags fields that WotLK added).
This commit is contained in:
Kelsi 2026-02-14 21:29:44 -08:00
parent eb931ce0fc
commit 0d4eff65d0
3 changed files with 27 additions and 5 deletions

View file

@ -50,6 +50,11 @@ public:
return CastSpellPacket::build(spellId, targetGuid, castCount);
}
/** Build CMSG_USE_ITEM (WotLK default: bag + slot + castCount + spellId + itemGuid + glyphIndex + castFlags + targets) */
virtual network::Packet buildUseItem(uint8_t bagIndex, uint8_t slotIndex, uint64_t itemGuid) {
return UseItemPacket::build(bagIndex, slotIndex, itemGuid);
}
// --- Character Enumeration ---
/** Parse SMSG_CHAR_ENUM */
@ -238,6 +243,7 @@ public:
const MovementInfo& info,
uint64_t playerGuid = 0) override;
network::Packet buildCastSpell(uint32_t spellId, uint64_t targetGuid, uint8_t castCount) override;
network::Packet buildUseItem(uint8_t bagIndex, uint8_t slotIndex, uint64_t itemGuid) override;
bool parseCastFailed(network::Packet& packet, CastFailedData& data) override;
bool parseMessageChat(network::Packet& packet, MessageChatData& data) override;
bool parseGameObjectQueryResponse(network::Packet& packet, GameObjectQueryResponseData& data) override;