[Quest API] Add Pet Owner Methods to Perl/Lua (#4115)

* [Quest API] Add Pet Owner Methods to Perl/Lua

- Add `$mob->IsPetOwnerBot()`.
- Add `$mob->IsPetOwnerClient()`.
- Add `$mob->IsPetOwnerNPC()`.

- Add `mob:IsPetOwnerBot()`.
- Add `mob:IsPetOwnerClient()`.
- Add `mob:IsPetOwnerNPC()`.

- Allows operators to use these short hands instead of doing a `GetOwner() && GetOwner()->IsClient()`.

* Update npc.cpp
This commit is contained in:
Alex King
2024-02-25 00:38:34 -05:00
committed by GitHub
parent eb3664a444
commit 35fe38cd09
6 changed files with 60 additions and 7 deletions
+7 -4
View File
@@ -1076,10 +1076,12 @@ public:
inline int16 GetTempPetCount() const { return count_TempPet; }
inline void SetTempPetCount(int16 i) { count_TempPet = i; }
bool HasPetAffinity() { if (aabonuses.GivePetGroupTarget || itembonuses.GivePetGroupTarget || spellbonuses.GivePetGroupTarget) return true; return false; }
inline bool IsPetOwnerBot() const { return pet_owner_bot; }
inline void SetPetOwnerBot(bool b) { pet_owner_bot = b; }
inline bool IsPetOwnerClient() const { return pet_owner_client; }
inline void SetPetOwnerClient(bool value) { pet_owner_client = value; }
inline void SetPetOwnerClient(bool b) { pet_owner_client = b; }
inline bool IsPetOwnerNPC() const { return pet_owner_npc; }
inline void SetPetOwnerNPC(bool value) { pet_owner_npc = value; }
inline void SetPetOwnerNPC(bool b) { pet_owner_npc = b; }
inline bool IsTempPet() const { return _IsTempPet; }
inline void SetTempPet(bool value) { _IsTempPet = value; }
inline bool IsHorse() { return is_horse; }
@@ -1838,8 +1840,9 @@ protected:
bool hasTempPet;
bool _IsTempPet;
int16 count_TempPet;
bool pet_owner_client; //Flags regular and pets as belonging to a client
bool pet_owner_npc; //Flags regular and pets as belonging to a npc
bool pet_owner_bot; // Flags pets as belonging to a Bot
bool pet_owner_client; // Flags pets as belonging to a Client
bool pet_owner_npc; // Flags pets as belonging to an NPC
uint32 pet_targetlock_id;
glm::vec3 m_TargetRing;