[Pets] Add Pet Constants and Methods (#4987)

* [Pets] Add Pet Constants and Methods

* Remove GetID

* GetPetTypeName()

* Cleanup
This commit is contained in:
Alex King
2025-08-17 01:00:31 -04:00
committed by GitHub
parent 207ee2daa0
commit a4e47d9180
28 changed files with 1209 additions and 742 deletions
+18 -15
View File
@@ -6415,17 +6415,17 @@ void Client::SuspendMinion(int value)
// TODO: These pet command states need to be synced ...
// Will just fix them for now
if (m_ClientVersionBit & EQ::versions::maskUFAndLater) {
SetPetCommandState(PET_BUTTON_SIT, 0);
SetPetCommandState(PET_BUTTON_STOP, 0);
SetPetCommandState(PET_BUTTON_REGROUP, 0);
SetPetCommandState(PET_BUTTON_FOLLOW, 1);
SetPetCommandState(PET_BUTTON_GUARD, 0);
SetPetCommandState(PetButton::Sit, PetButtonState::Off);
SetPetCommandState(PetButton::Stop, PetButtonState::Off);
SetPetCommandState(PetButton::Regroup, PetButtonState::Off);
SetPetCommandState(PetButton::Follow, PetButtonState::On);
SetPetCommandState(PetButton::Guard, PetButtonState::Off);
// Taunt saved on client side for logging on with pet
// In our db for when we zone.
SetPetCommandState(PET_BUTTON_HOLD, 0);
SetPetCommandState(PET_BUTTON_GHOLD, 0);
SetPetCommandState(PET_BUTTON_FOCUS, 0);
SetPetCommandState(PET_BUTTON_SPELLHOLD, 0);
SetPetCommandState(PetButton::Hold, PetButtonState::Off);
SetPetCommandState(PetButton::GreaterHold, PetButtonState::Off);
SetPetCommandState(PetButton::Focus, PetButtonState::Off);
SetPetCommandState(PetButton::SpellHold, PetButtonState::Off);
}
}
else
@@ -6906,9 +6906,9 @@ void Client::CheckLDoNHail(NPC* n)
auto pet = GetPet();
if (pet) {
if (pet->GetPetType() == petCharmed) {
if (pet->GetPetType() == PetType::Charmed) {
pet->BuffFadeByEffect(SE_Charm);
} else if (pet->GetPetType() == petNPCFollow) {
} else if (pet->GetPetType() == PetType::Follow) {
pet->SetOwnerID(0);
} else {
pet->Depop();
@@ -9450,12 +9450,15 @@ void Client::ProcessAggroMeter()
}
}
void Client::SetPetCommandState(int button, int state)
void Client::SetPetCommandState(uint8 button, uint8 state)
{
auto app = new EQApplicationPacket(OP_PetCommandState, sizeof(PetCommandState_Struct));
auto pcs = (PetCommandState_Struct *)app->pBuffer;
pcs->button_id = button;
pcs->state = state;
auto s = (PetCommandState_Struct*) app->pBuffer;
s->button_id = button;
s->state = state;
FastQueuePacket(&app);
}