mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Quest API] Add NPC List Filter Methods to Perl/Lua (#4493)
* [Quest API] Add GetNPCsByNPCIDs to Perl/Lua * Push * Update entity.cpp * Separate methods.
This commit is contained in:
@@ -739,6 +739,44 @@ void Perl_EntityList_MassGroupBuff(EntityList* self, Mob* caster, Mob* center, u
|
||||
self->MassGroupBuff(caster, center, spell_id, affect_caster);
|
||||
}
|
||||
|
||||
perl::array Perl_EntityList_GetNPCsByExcludedIDs(EntityList* self, perl::array npc_ids)
|
||||
{
|
||||
std::vector<uint32> ids;
|
||||
|
||||
for (int i = 0; i < npc_ids.size(); i++) {
|
||||
ids.emplace_back(npc_ids[i]);
|
||||
}
|
||||
|
||||
const auto& l = self->GetExcludedNPCsByIDs(ids);
|
||||
|
||||
perl::array npcs;
|
||||
|
||||
for (const auto& e : l) {
|
||||
npcs.push_back(e);
|
||||
}
|
||||
|
||||
return npcs;
|
||||
}
|
||||
|
||||
perl::array Perl_EntityList_GetNPCsByIDs(EntityList* self, perl::array npc_ids)
|
||||
{
|
||||
std::vector<uint32> ids;
|
||||
|
||||
for (int i = 0; i < npc_ids.size(); i++) {
|
||||
ids.emplace_back(npc_ids[i]);
|
||||
}
|
||||
|
||||
const auto& l = self->GetNPCsByIDs(ids);
|
||||
|
||||
perl::array npcs;
|
||||
|
||||
for (const auto& e : l) {
|
||||
npcs.push_back(e);
|
||||
}
|
||||
|
||||
return npcs;
|
||||
}
|
||||
|
||||
void perl_register_entitylist()
|
||||
{
|
||||
perl::interpreter perl(PERL_GET_THX);
|
||||
@@ -804,6 +842,8 @@ void perl_register_entitylist()
|
||||
package.add("GetNPCByNPCTypeID", &Perl_EntityList_GetNPCByNPCTypeID);
|
||||
package.add("GetNPCBySpawnID", &Perl_EntityList_GetNPCBySpawnID);
|
||||
package.add("GetNPCList", &Perl_EntityList_GetNPCList);
|
||||
package.add("GetNPCsByExcludedIDs", &Perl_EntityList_GetNPCsByExcludedIDs);
|
||||
package.add("GetNPCsByIDs", &Perl_EntityList_GetNPCsByIDs);
|
||||
package.add("GetObjectByDBID", &Perl_EntityList_GetObjectByDBID);
|
||||
package.add("GetObjectByID", &Perl_EntityList_GetObjectByID);
|
||||
package.add("GetObjectList", &Perl_EntityList_GetObjectList);
|
||||
|
||||
Reference in New Issue
Block a user