[Quest API] Add client->ReadBookByName(book_name, book_type) to Perl/Lua.

- Add $client->ReadBookByName(booK_name, book_type) to Perl.
- Add client:ReadBookByName(booK_name, book_type) to Lua.
- Allows server operators to put books in to their database and read from their database instead of storing the values in a script, also allows them to read pre-existing books using a script.
This commit is contained in:
Kinglykrab
2021-10-02 13:09:30 -04:00
committed by GitHub
parent ff46a854f9
commit 93acf50bb4
5 changed files with 51 additions and 0 deletions
+6
View File
@@ -2229,6 +2229,11 @@ void Lua_Client::UntrainDiscBySpellID(uint16 spell_id, bool update_client) {
self->UntrainDiscBySpellID(spell_id, update_client);
}
void Lua_Client::ReadBookByName(std::string book_name, uint8 book_type) {
Lua_Safe_Call_Void();
self->ReadBookByName(book_name, book_type);
}
void Lua_Client::SummonBaggedItems(uint32 bag_item_id, luabind::adl::object bag_items_table) {
Lua_Safe_Call_Void();
if (luabind::type(bag_items_table) != LUA_TTABLE) {
@@ -2627,6 +2632,7 @@ luabind::scope lua_register_client() {
.def("CountItem", (int(Lua_Client::*)(uint32))&Lua_Client::CountItem)
.def("RemoveItem", (void(Lua_Client::*)(uint32))&Lua_Client::RemoveItem)
.def("RemoveItem", (void(Lua_Client::*)(uint32,uint32))&Lua_Client::RemoveItem)
.def("ReadBookByName", (void(Lua_Client::*)(std::string,uint8))&Lua_Client::ReadBookByName)
.def("SetGMStatus", (void(Lua_Client::*)(int32))&Lua_Client::SetGMStatus)
.def("UntrainDiscBySpellID", (void(Lua_Client::*)(uint16))&Lua_Client::UntrainDiscBySpellID)
.def("UntrainDiscBySpellID", (void(Lua_Client::*)(uint16,bool))&Lua_Client::UntrainDiscBySpellID)