Add OP_PetCommandState for ghold/hold

This commit is contained in:
Michael Cook (mackal) 2017-05-04 00:27:42 -04:00
parent b3d8bcab4a
commit 9229ca4f79
5 changed files with 21 additions and 0 deletions

View File

@ -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),

View File

@ -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

View File

@ -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);
}

View File

@ -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);

View File

@ -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;
}