[Zones] Add Max Level Check to Zones. (#2714)

* [Zones] Add Max Level Check to Zones.

# Perl
- Add `$client->CanEnterZone(zone_short_name)`.
- Add `$client->CanEnterZone(zone_short_name, instance_version)`.

# Lua
- Add `client:CanEnterZone(zone_short_name)`.
- Add `client:CanEnterZone(zone_short_name, instance_version)`.

# Notes
- Allows operators to limit zones to a maximum level.
- Allows operators to see if a player can enter a zone before sending them.
- Keeps players from entering via `#peqzone` and `#zone` as well if they do not meet the requirements or are not high enough status to bypass the requirements.

* Cleanup.
This commit is contained in:
Alex King
2023-01-10 20:47:37 -05:00
committed by GitHub
parent 4c8b65ecc6
commit 0d23ffe5e5
13 changed files with 458 additions and 420 deletions
+12
View File
@@ -2799,6 +2799,16 @@ void Perl_Client_SetEXPEnabled(Client* self, bool is_exp_enabled)
self->SetEXPEnabled(is_exp_enabled);
}
bool Perl_Client_CanEnterZone(Client* self, std::string zone_short_name)
{
return self->CanEnterZone(zone_short_name);
}
bool Perl_Client_CanEnterZone(Client* self, std::string zone_short_name, int16 instance_version)
{
return self->CanEnterZone(zone_short_name, instance_version);
}
#ifdef BOTS
int Perl_Client_GetBotRequiredLevel(Client* self)
@@ -2924,6 +2934,8 @@ void perl_register_client()
package.add("CalcPriceMod", (float(*)(Client*))&Perl_Client_CalcPriceMod);
package.add("CalcPriceMod", (float(*)(Client*, Mob*))&Perl_Client_CalcPriceMod);
package.add("CalcPriceMod", (float(*)(Client*, Mob*, bool))&Perl_Client_CalcPriceMod);
package.add("CanEnterZone", (bool(*)(Client*, std::string))&Perl_Client_CanEnterZone);
package.add("CanEnterZone", (bool(*)(Client*, std::string, int16))&Perl_Client_CanEnterZone);
package.add("CanHaveSkill", &Perl_Client_CanHaveSkill);
package.add("CashReward", &Perl_Client_CashReward);
package.add("ChangeLastName", &Perl_Client_ChangeLastName);