From cd85a8524ab668fc946b522d543c515025ff10d7 Mon Sep 17 00:00:00 2001 From: Fryguy Date: Sun, 7 Jan 2024 16:22:37 -0500 Subject: [PATCH] [Bug Fix] Target Locked Pet Taunt (#3894) * [Bug Fix] Target Locked pet taunt Target locked pets shouldn't taunt * Update mob.h --------- Co-authored-by: Kinglykrab --- zone/mob.h | 16 ++++++++-------- zone/special_attacks.cpp | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/zone/mob.h b/zone/mob.h index 78dcd97c2..2d160330f 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -1053,14 +1053,14 @@ public: Mob* GetUltimateOwner(); void SetPetID(uint16 NewPetID); inline uint16 GetPetID() const { return petid; } - inline PetType GetPetType() const { return typeofpet; } - void SetPetType(PetType p) { typeofpet = p; } + inline PetType GetPetType() const { return type_of_pet; } + void SetPetType(PetType p) { type_of_pet = p; } inline int16 GetPetPower() const { return (petpower < 0) ? 0 : petpower; } void SetPetPower(int16 p) { if (p < 0) petpower = 0; else petpower = p; } - bool IsFamiliar() const { return(typeofpet == petFamiliar); } - bool IsAnimation() const { return(typeofpet == petAnimation); } - bool IsCharmed() const { return(typeofpet == petCharmed); } - bool IsTargetLockPet() const { return(typeofpet == petTargetLock); } + bool IsFamiliar() const { return type_of_pet == petFamiliar; } + bool IsAnimation() const { return type_of_pet == petAnimation; } + bool IsCharmed() const { return type_of_pet == petCharmed; } + bool IsTargetLockPet() const { return type_of_pet == petTargetLock; } inline uint32 GetPetTargetLockID() { return pet_targetlock_id; }; inline void SetPetTargetLockID(uint32 value) { pet_targetlock_id = value; }; void SetOwnerID(uint16 NewOwnerID); @@ -1252,7 +1252,7 @@ public: bool CheckWillAggro(Mob *mob); void InstillDoubt(Mob *who); - bool Charmed() const { return typeofpet == petCharmed; } + bool Charmed() const { return type_of_pet == petCharmed; } static uint32 GetLevelHP(uint8 tlevel); uint32 GetZoneID() const; //for perl uint16 GetInstanceVersion() const; //for perl @@ -1531,7 +1531,7 @@ protected: StatBonuses aabonuses; uint16 petid; uint16 ownerid; - PetType typeofpet; + PetType type_of_pet; int16 petpower; uint32 follow_id; uint32 follow_dist; diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 932ec99ea..20957f1bf 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -1812,7 +1812,9 @@ void NPC::DoClassAttacks(Mob *target) { HasOwner() && target->IsNPC() && target->GetBodyType() != BT_Undead && - taunt_time + taunt_time && + type_of_pet && + type_of_pet != petTargetLock ) { GetOwner()->MessageString(Chat::PetResponse, PET_TAUNTING); Taunt(target->CastToNPC(), false);