[Quest API] Add SendGMCommand() to Perl/Lua. (#2527)

* [Quest API] Add SendGMCommand() to Perl/Lua.

# Perl
- Add `$client->SendGMCommand(message)` to Perl.
- Add `$client->SendGMCommand(message, ignore_status)` to Perl.

# Lua
- Add `client:SendGMCommand(message)` to Lua.
- Add `client:SendGMCommand(message, ignore_status)` to Lua.

# Notes
- `ignore_status` allows you to have players use GM commands that they are not the required status level for through the Quest API.
- `ignore_status` is default false, so if you don't send it, it checks and makes sure the player can use the command you're sending before allowing it.

* Typo.

* Formatting.
This commit is contained in:
Kinglykrab
2022-11-14 16:47:02 -05:00
committed by GitHub
parent 36887203d3
commit f668949c24
7 changed files with 41 additions and 8 deletions
+12
View File
@@ -2487,6 +2487,16 @@ bool Perl_Client_HasRecipeLearned(Client* self, uint32 recipe_id) // @categories
return self->HasRecipeLearned(recipe_id);
}
bool Perl_Client_SendGMCommand(Client* self, std::string message) // @categories Script Utility
{
return self->SendGMCommand(message);
}
bool Perl_Client_SendGMCommand(Client* self, std::string message, bool ignore_status) // @categories Script Utility
{
return self->SendGMCommand(message, ignore_status);
}
void perl_register_client()
{
perl::interpreter perl(PERL_GET_THX);
@@ -2805,6 +2815,8 @@ void perl_register_client()
package.add("ScribeSpell", (void(*)(Client*, uint16, int, bool))&Perl_Client_ScribeSpell);
package.add("ScribeSpells", &Perl_Client_ScribeSpells);
package.add("SendColoredText", &Perl_Client_SendColoredText);
package.add("SendGMCommand", (bool(*)(Client*, std::string))&Perl_Client_SendGMCommand);
package.add("SendGMCommand", (bool(*)(Client*, std::string, bool))&Perl_Client_SendGMCommand);
package.add("SendMarqueeMessage", &Perl_Client_SendMarqueeMessage);
package.add("SendOPTranslocateConfirm", &Perl_Client_SendOPTranslocateConfirm);
package.add("SendPEQZoneFlagInfo", &Perl_Client_SendPEQZoneFlagInfo);