mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-25 08:30:13 +00:00
Add Tier 2 utility commands: helm/cloak toggles, follow, and assist
Display Toggle Commands: - Add /helm, /helmet, /showhelm to toggle helm visibility - Add /cloak, /showcloak to toggle cloak visibility - Track visibility state with helmVisible_ and cloakVisible_ flags - Show confirmation messages: "Helm/Cloak is now visible/hidden" - Use CMSG_SHOWING_HELM (0x2B9) and CMSG_SHOWING_CLOAK (0x2BA) Follow Command: - Add /follow and /f to follow current target - Works with both players and NPCs - Show "Now following [Name]" confirmation message - Track follow target with followTargetGuid_ for future movement logic Assist Command: - Add /assist to target what your current target is targeting - Read target's target from UNIT_FIELD_TARGET update fields (offset 6-7) - Reconstruct 64-bit target GUID from two 32-bit field values - Automatically switch your target to assist target - Show helpful messages: "[Name] has no target" when appropriate - Essential for combat coordination in groups Implementation: - Add ShowingHelmPacket and ShowingCloakPacket builders - Add toggleHelm() and toggleCloak() methods with state management - Add followTarget() for setting follow target - Add assistTarget() with smart target field reading - Use Entity::getFields() to access protected update fields - Handle missing targets and invalid states gracefully - All commands provide chat feedback - Support multiple aliases for user convenience
This commit is contained in:
parent
ec32286b0d
commit
acef7ccbec
6 changed files with 198 additions and 0 deletions
|
|
@ -227,6 +227,14 @@ public:
|
|||
// Stand state
|
||||
void setStandState(uint8_t state); // 0=stand, 1=sit, 2=sit_chair, 3=sleep, 4=sit_low_chair, 5=sit_medium_chair, 6=sit_high_chair, 7=dead, 8=kneel, 9=submerged
|
||||
|
||||
// Display toggles
|
||||
void toggleHelm();
|
||||
void toggleCloak();
|
||||
|
||||
// Follow/Assist
|
||||
void followTarget();
|
||||
void assistTarget();
|
||||
|
||||
// ---- Phase 1: Name queries ----
|
||||
void queryPlayerName(uint64_t guid);
|
||||
void queryCreatureInfo(uint32_t entry, uint64_t guid);
|
||||
|
|
@ -626,6 +634,13 @@ private:
|
|||
// ---- Logout state ----
|
||||
bool loggingOut_ = false;
|
||||
|
||||
// ---- Display state ----
|
||||
bool helmVisible_ = true;
|
||||
bool cloakVisible_ = true;
|
||||
|
||||
// ---- Follow state ----
|
||||
uint64_t followTargetGuid_ = 0;
|
||||
|
||||
// ---- Online item tracking ----
|
||||
struct OnlineItemInfo {
|
||||
uint32_t entry = 0;
|
||||
|
|
|
|||
|
|
@ -81,6 +81,10 @@ enum class Opcode : uint16_t {
|
|||
// ---- Stand State ----
|
||||
CMSG_STAND_STATE_CHANGE = 0x101,
|
||||
|
||||
// ---- Display Toggles ----
|
||||
CMSG_SHOWING_HELM = 0x2B9,
|
||||
CMSG_SHOWING_CLOAK = 0x2BA,
|
||||
|
||||
// ---- Random Roll ----
|
||||
MSG_RANDOM_ROLL = 0x1FB,
|
||||
|
||||
|
|
|
|||
|
|
@ -786,6 +786,22 @@ public:
|
|||
static network::Packet build(uint8_t state);
|
||||
};
|
||||
|
||||
// ============================================================
|
||||
// Display Toggles
|
||||
// ============================================================
|
||||
|
||||
/** CMSG_SHOWING_HELM packet builder */
|
||||
class ShowingHelmPacket {
|
||||
public:
|
||||
static network::Packet build(bool show);
|
||||
};
|
||||
|
||||
/** CMSG_SHOWING_CLOAK packet builder */
|
||||
class ShowingCloakPacket {
|
||||
public:
|
||||
static network::Packet build(bool show);
|
||||
};
|
||||
|
||||
// ============================================================
|
||||
// Random Roll
|
||||
// ============================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue