mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 16:10:14 +00:00
Add quest opcodes, fix gossip select packet, and NPC combat animations
Fix CMSG_GOSSIP_SELECT_OPTION missing menuId field (was causing ByteBufferException). Add 12 quest opcodes and clickable quest items in gossip dialog. NPC attack/death animation callbacks now work for both single-player and server-spawned creatures, and SMSG_ATTACKERSTATEUPDATE triggers NPC swing animations.
This commit is contained in:
parent
a20dc947e2
commit
8b98888dd2
7 changed files with 84 additions and 8 deletions
|
|
@ -1808,9 +1808,10 @@ network::Packet GossipHelloPacket::build(uint64_t npcGuid) {
|
|||
return packet;
|
||||
}
|
||||
|
||||
network::Packet GossipSelectOptionPacket::build(uint64_t npcGuid, uint32_t optionId, const std::string& code) {
|
||||
network::Packet GossipSelectOptionPacket::build(uint64_t npcGuid, uint32_t menuId, uint32_t optionId, const std::string& code) {
|
||||
network::Packet packet(static_cast<uint16_t>(Opcode::CMSG_GOSSIP_SELECT_OPTION));
|
||||
packet.writeUInt64(npcGuid);
|
||||
packet.writeUInt32(menuId);
|
||||
packet.writeUInt32(optionId);
|
||||
if (!code.empty()) {
|
||||
packet.writeString(code);
|
||||
|
|
@ -1818,6 +1819,22 @@ network::Packet GossipSelectOptionPacket::build(uint64_t npcGuid, uint32_t optio
|
|||
return packet;
|
||||
}
|
||||
|
||||
network::Packet QuestgiverQueryQuestPacket::build(uint64_t npcGuid, uint32_t questId) {
|
||||
network::Packet packet(static_cast<uint16_t>(Opcode::CMSG_QUESTGIVER_QUERY_QUEST));
|
||||
packet.writeUInt64(npcGuid);
|
||||
packet.writeUInt32(questId);
|
||||
packet.writeUInt8(1); // isDialogContinued = 1 (from gossip)
|
||||
return packet;
|
||||
}
|
||||
|
||||
network::Packet QuestgiverAcceptQuestPacket::build(uint64_t npcGuid, uint32_t questId) {
|
||||
network::Packet packet(static_cast<uint16_t>(Opcode::CMSG_QUESTGIVER_ACCEPT_QUEST));
|
||||
packet.writeUInt64(npcGuid);
|
||||
packet.writeUInt32(questId);
|
||||
packet.writeUInt32(0); // unused
|
||||
return packet;
|
||||
}
|
||||
|
||||
bool GossipMessageParser::parse(network::Packet& packet, GossipMessageData& data) {
|
||||
data.npcGuid = packet.readUInt64();
|
||||
data.menuId = packet.readUInt32();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue