diff --git a/common/emu_oplist.h b/common/emu_oplist.h index cf6f4ca28..e695c94a9 100644 --- a/common/emu_oplist.h +++ b/common/emu_oplist.h @@ -355,6 +355,7 @@ N(OP_OpenTributeMaster), N(OP_PDeletePetition), N(OP_PetBuffWindow), N(OP_PetCommands), +N(OP_PetCommandState), N(OP_PetHoTT), N(OP_Petition), N(OP_PetitionBug), diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index 3730e1d14..c84c4073a 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -1116,6 +1116,11 @@ struct PetCommand_Struct { /*004*/ uint32 target; }; +struct PetCommandState_Struct { +/*00*/ uint32 button_id; +/*04*/ uint32 state; +}; + /* ** Delete Spawn ** Length: 4 Bytes diff --git a/zone/client.cpp b/zone/client.cpp index 2321797e3..3b2b5fd23 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -8935,3 +8935,12 @@ void Client::ProcessAggroMeter() } } +void Client::SetPetCommandState(int button, int state) +{ + auto app = new EQApplicationPacket(OP_PetCommandState, sizeof(PetCommandState_Struct)); + auto pcs = (PetCommandState_Struct *)app->pBuffer; + pcs->button_id = button; + pcs->state = state; + FastQueuePacket(&app); +} + diff --git a/zone/client.h b/zone/client.h index f47ac2b31..19dc4c05b 100644 --- a/zone/client.h +++ b/zone/client.h @@ -352,6 +352,8 @@ public: inline InspectMessage_Struct& GetInspectMessage() { return m_inspect_message; } inline const InspectMessage_Struct& GetInspectMessage() const { return m_inspect_message; } + void SetPetCommandState(int button, int state); + bool CheckAccess(int16 iDBLevel, int16 iDefaultLevel); void CheckQuests(const char* zonename, const char* message, uint32 npc_id, uint32 item_id, Mob* other); diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 3ed19d37a..b8661e79e 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -10202,6 +10202,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) mypet->SetHeld(true); } mypet->SetGHeld(false); + SetPetCommandState(PET_BUTTON_GHOLD, 0); } break; } @@ -10210,6 +10211,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) mypet->Say_StringID(MT_PetResponse, PET_ON_HOLD); mypet->SetHeld(true); mypet->SetGHeld(false); + SetPetCommandState(PET_BUTTON_GHOLD, 0); } break; } @@ -10230,6 +10232,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) mypet->SetGHeld(true); } mypet->SetHeld(false); + SetPetCommandState(PET_BUTTON_HOLD, 0); } break; } @@ -10238,6 +10241,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) mypet->Say_StringID(MT_PetResponse, PET_ON_HOLD); mypet->SetGHeld(true); mypet->SetHeld(false); + SetPetCommandState(PET_BUTTON_HOLD, 0); } break; }