[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
@@ -2593,6 +2593,16 @@ bool Lua_Client::HasRecipeLearned(uint32 recipe_id) {
return self->HasRecipeLearned(recipe_id);
}
bool Lua_Client::SendGMCommand(std::string message) {
Lua_Safe_Call_Bool();
return self->SendGMCommand(message);
}
bool Lua_Client::SendGMCommand(std::string message, bool ignore_status) {
Lua_Safe_Call_Bool();
return self->SendGMCommand(message, ignore_status);
}
luabind::scope lua_register_client() {
return luabind::class_<Lua_Client, Lua_Mob>("Client")
.def(luabind::constructor<>())
@@ -2913,6 +2923,8 @@ luabind::scope lua_register_client() {
.def("ScribeSpells", (uint16(Lua_Client::*)(uint8,uint8))&Lua_Client::ScribeSpells)
.def("SendColoredText", (void(Lua_Client::*)(uint32, std::string))&Lua_Client::SendColoredText)
.def("SendItemScale", (void(Lua_Client::*)(Lua_ItemInst))&Lua_Client::SendItemScale)
.def("SendGMCommand", (bool(Lua_Client::*)(std::string))&Lua_Client::SendGMCommand)
.def("SendGMCommand", (bool(Lua_Client::*)(std::string,bool))&Lua_Client::SendGMCommand)
.def("SendMarqueeMessage", (void(Lua_Client::*)(uint32, uint32, uint32, uint32, uint32, std::string))&Lua_Client::SendMarqueeMessage)
.def("SendOPTranslocateConfirm", (void(Lua_Client::*)(Lua_Mob,int))&Lua_Client::SendOPTranslocateConfirm)
.def("SendPEQZoneFlagInfo", (void(Lua_Client::*)(Lua_Client))&Lua_Client::SendPEQZoneFlagInfo)