From d119ed058bba19fe17f534c13eef1bbcfca4c100 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 13 Sep 2013 15:20:45 -0400 Subject: [PATCH] Add /pet hold on and /pet hold off support for UF/RoF --- changelog.txt | 3 +++ common/patches/RoF.cpp | 6 ++++++ common/patches/Underfoot.cpp | 6 ++++++ zone/client_packet.cpp | 16 ++++++++++++++++ zone/pets.h | 2 ++ 5 files changed, 33 insertions(+) diff --git a/changelog.txt b/changelog.txt index ef2d9c6d5..cf180b003 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 09/13/2013 == +demonstar55: Add support for /pet hold on and /pet hold off (UF and RoF) + == 08/29/2013 == KLS: Removed Common Profiler and Zone Profiler. They're well past outdated status and are just code bloat. KLS: Fix for reported issue on forums with skills that could potentially be trained before a player achieved the level to train. diff --git a/common/patches/RoF.cpp b/common/patches/RoF.cpp index 905600821..fbfbcc94b 100644 --- a/common/patches/RoF.cpp +++ b/common/patches/RoF.cpp @@ -4051,6 +4051,12 @@ DECODE(OP_PetCommands) case 0x0f: emu->command = 0x0c; // Hold break; + case 0x10: + emu->command = 0x1b; // Hold on + break; + case 0x11: + emu->command = 0x1c; // Hold off + break; case 0x1c: emu->command = 0x01; // Back break; diff --git a/common/patches/Underfoot.cpp b/common/patches/Underfoot.cpp index 2a8b57aa5..ddfe24347 100644 --- a/common/patches/Underfoot.cpp +++ b/common/patches/Underfoot.cpp @@ -3366,6 +3366,12 @@ DECODE(OP_PetCommands) case 0x0f: emu->command = 0x0c; // Hold break; + case 0x10: + emu->command = 0x1b; // Hold on + break; + case 0x11: + emu->command = 0x1c; // Hold off + break; case 0x1c: emu->command = 0x01; // Back break; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 11dfc7be8..94a95cd9b 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -7169,6 +7169,22 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) } break; } + case PET_HOLD_ON: { + if (GetAA(aaPetDiscipline) && mypet->IsNPC() && !mypet->IsHeld()) { + if (mypet->IsFeared()) + break; //could be exploited like PET_BACKOFF + + mypet->Say_StringID(MT_PetResponse, PET_ON_HOLD); + mypet->WipeHateList(); + mypet->SetHeld(true); + } + break; + } + case PET_HOLD_OFF: { + if (GetAA(aaPetDiscipline) && mypet->IsNPC() && mypet->IsHeld()) + mypet->SetHeld(false); + break; + } case PET_NOCAST: { if(GetAA(aaAdvancedPetDiscipline) == 2 && mypet->IsNPC()) { if (mypet->IsFeared()) diff --git a/zone/pets.h b/zone/pets.h index 0bf868b53..14e5cb722 100644 --- a/zone/pets.h +++ b/zone/pets.h @@ -19,6 +19,8 @@ #define PET_FOCUS 19 #define PET_FOCUS_ON 25 #define PET_FOCUS_OFF 26 + #define PET_HOLD_ON 27 + #define PET_HOLD_OFF 28 class Pet : public NPC { public: