[Quest API] Add Zone Flag Methods to Perl/Lua. (#2574)

* [Quest API] Add Zone Flag Methods to Perl/Lua.

# Perl
- Add `$client->GetPEQZoneFlags()`.
- Add `$client->GetZoneFlags()`.

# Lua
- Add `client:GetPEQZoneFlags()`.
- Add `client:GetZoneFlags()`.

# Notes
- Allows operators to get a list of all PEQ/zone flags to be looped through or listed out easily without having to have a list of individual zone IDs to check or otherwise.

* Update zoning.cpp

* Repositories and cleanup.
This commit is contained in:
Alex King
2022-11-26 11:13:46 -05:00
committed by GitHub
parent b91d879662
commit dced08cf97
6 changed files with 107 additions and 39 deletions
+26
View File
@@ -2708,6 +2708,30 @@ void Perl_Client_SetSpellDurationRaid(Client* self, int spell_id, int duration,
}
#endif
perl::array Perl_Client_GetPEQZoneFlags(Client* self)
{
perl::array a;
auto l = self->GetPEQZoneFlags();
for (const auto& f : l) {
a.push_back(f);
}
return a;
}
perl::array Perl_Client_GetZoneFlags(Client* self)
{
perl::array a;
auto l = self->GetZoneFlags();
for (const auto& f : l) {
a.push_back(f);
}
return a;
}
#ifdef BOTS
int Perl_Client_GetBotRequiredLevel(Client* self)
@@ -3011,6 +3035,8 @@ void perl_register_client()
package.add("GetThirst", &Perl_Client_GetThirst);
package.add("GetTotalSecondsPlayed", &Perl_Client_GetTotalSecondsPlayed);
package.add("GetWeight", &Perl_Client_GetWeight);
package.add("GetPEQZoneFlags", &Perl_Client_GetPEQZoneFlags);
package.add("GetZoneFlags", &Perl_Client_GetZoneFlags);
package.add("GoFish", &Perl_Client_GoFish);
package.add("GrantAlternateAdvancementAbility", (bool(*)(Client*, int, int))&Perl_Client_GrantAlternateAdvancementAbility);
package.add("GrantAlternateAdvancementAbility", (bool(*)(Client*, int, int, bool))&Perl_Client_GrantAlternateAdvancementAbility);