[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
+16
View File
@@ -5693,6 +5693,21 @@ XS(XS_Client_DiaWind) {
XSRETURN_EMPTY;
}
XS(XS_Client_ReadBookByName);
XS(XS_Client_ReadBookByName) {
dXSARGS;
if (items != 3)
Perl_croak(aTHX_ "Usage: Client::ReadBookByName(THIS, string book_name, uint8 book_type)"); // @categories Script Utility
{
Client *THIS;
std::string book_name(SvPV_nolen(ST(1)));
uint8 book_type = (uint8) SvUV(ST(2));
VALIDATE_THIS_IS_CLIENT;
THIS->ReadBookByName(book_name, book_type);
}
XSRETURN_EMPTY;
}
XS(XS_Client_UntrainDiscBySpellID); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_UntrainDiscBySpellID) {
dXSARGS;
@@ -6078,6 +6093,7 @@ XS(boot_Client) {
newXSproto(strcpy(buf, "UpdateWho"), XS_Client_UpdateWho, file, "$;$");
newXSproto(strcpy(buf, "UseDiscipline"), XS_Client_UseDiscipline, file, "$$$");
newXSproto(strcpy(buf, "WorldKick"), XS_Client_WorldKick, file, "$");
newXSproto(strcpy(buf, "ReadBookByName"), XS_Client_ReadBookByName, file, "$$$");
XSRETURN_YES;
}