Add Tier 7 commands: combat and trade

Combat Commands:
- /duel - Challenge target to a duel (CMSG_DUEL_PROPOSED 0x166)
- /trade - Open trade window with target (CMSG_INITIATE_TRADE 0x116)
- /startattack - Begin auto-attacking target
- /stopattack - Stop auto-attacking
- /stopcasting - Cancel current spell cast

New opcodes:
- CMSG_DUEL_PROPOSED (0x166) for initiating duels
- CMSG_INITIATE_TRADE (0x116) for starting trades

Packet builders:
- DuelProposedPacket - sends duel challenge to target GUID
- InitiateTradePacket - sends trade request to target GUID
- AttackSwingPacket, AttackStopPacket, CancelCastPacket reused from existing

Game handler methods:
- proposeDuel(targetGuid) - challenge target to duel
- initiateTrade(targetGuid) - open trade with target
- stopCasting() - cancel current spell cast (uses existing casting state)

All commands include validation for target selection and world state.
Removed duplicate packet class definitions from previous phases.
This commit is contained in:
kelsi davis 2026-02-07 13:36:50 -08:00
parent d5b734a591
commit bca3f64af6
6 changed files with 201 additions and 38 deletions

View file

@ -917,6 +917,40 @@ public:
static network::Packet build();
};
// ============================================================
// Combat and Trade
// ============================================================
/** CMSG_DUEL_PROPOSED packet builder */
class DuelProposedPacket {
public:
static network::Packet build(uint64_t targetGuid);
};
/** CMSG_INITIATE_TRADE packet builder */
class InitiateTradePacket {
public:
static network::Packet build(uint64_t targetGuid);
};
/** CMSG_ATTACKSWING packet builder */
class AttackSwingPacket {
public:
static network::Packet build(uint64_t targetGuid);
};
/** CMSG_ATTACKSTOP packet builder */
class AttackStopPacket {
public:
static network::Packet build();
};
/** CMSG_CANCEL_CAST packet builder */
class CancelCastPacket {
public:
static network::Packet build(uint32_t spellId);
};
// ============================================================
// Random Roll
// ============================================================
@ -1074,18 +1108,6 @@ public:
static bool parse(network::Packet& packet, MonsterMoveData& data);
};
/** CMSG_ATTACKSWING packet builder */
class AttackSwingPacket {
public:
static network::Packet build(uint64_t targetGuid);
};
/** CMSG_ATTACKSTOP packet builder */
class AttackStopPacket {
public:
static network::Packet build();
};
/** SMSG_ATTACKSTART data */
struct AttackStartData {
uint64_t attackerGuid = 0;
@ -1223,12 +1245,6 @@ public:
static network::Packet build(uint32_t spellId, uint64_t targetGuid, uint8_t castCount);
};
/** CMSG_CANCEL_CAST packet builder */
class CancelCastPacket {
public:
static network::Packet build(uint32_t spellId);
};
/** CMSG_CANCEL_AURA packet builder */
class CancelAuraPacket {
public: