mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[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:
+10
-3
@@ -2162,7 +2162,9 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns)
|
||||
}
|
||||
}
|
||||
|
||||
if (swarm_owner->IsNPC()) {
|
||||
if (swarm_owner->IsBot()) {
|
||||
SetPetOwnerBot(true);
|
||||
} else if (swarm_owner->IsNPC()) {
|
||||
SetPetOwnerNPC(true);
|
||||
}
|
||||
} else if (GetOwnerID()) {
|
||||
@@ -2179,8 +2181,13 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (entity_list.GetNPCByID(GetOwnerID())) {
|
||||
SetPetOwnerNPC(true);
|
||||
Mob* owner = entity_list.GetMob(GetOwnerID());
|
||||
if (owner) {
|
||||
if (owner->IsBot()) {
|
||||
SetPetOwnerBot(true);
|
||||
} else if (owner->IsNPC()) {
|
||||
SetPetOwnerNPC(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user