mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 15:58:36 +00:00
[Quest API] Add Hatelist Count Methods to Perl/Lua (#4106)
# Perl - Add `$mob->GetHateListCount()`.# Perl - Add `$mob->GetHateListCount()`. - Add `$mob->GetHateListBotCount()`. - Add `$mob->GetHateListClientCount()`. - Add `$mob->GetHateListNPCCount()`. # Lua - Add `mob:GetHateListCount()`. - Add `mob:GetHateListBotCount()`. - Add `mob:GetHateListClientCount()`. - Add `mob:GetHateListNPCCount()`. # Notes - Allows operators to more easily get a total entity count of a Mob's hate list, can do an overall count, or specifically bots, clients, or NPCs.
This commit is contained in:
+27
-1
@@ -683,7 +683,33 @@ int64 HateList::GetEntHateAmount(Mob *in_entity, bool damage)
|
||||
}
|
||||
|
||||
bool HateList::IsHateListEmpty() {
|
||||
return(list.size() == 0);
|
||||
return list.empty();
|
||||
}
|
||||
|
||||
uint32 HateList::GetHateListCount(HateListCountType count_type)
|
||||
{
|
||||
if (count_type == HateListCountType::All) {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
for (const auto& e : list) {
|
||||
Mob* m = e->entity_on_hatelist;
|
||||
|
||||
if (
|
||||
m &&
|
||||
(
|
||||
(count_type == HateListCountType::Bot && m->IsBot()) ||
|
||||
(count_type == HateListCountType::Client && m->IsClient()) ||
|
||||
(count_type == HateListCountType::NPC && m->IsNPC())
|
||||
)
|
||||
) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
void HateList::PrintHateListToClient(Client *c)
|
||||
|
||||
Reference in New Issue
Block a user