Add message(color, message) and whisper(message) to Perl/Lua.

- Add quest::message(color, message) to Perl.
- Add eq.message(color, message) to Lua.
- Add quest::whisper(message) to Perl.
- Add eq.whisper(message) to Lua.

These methods allow you to use implied client references. The whisper method also converts a widely used plugin in Perl to a Perl and Lua method that works on both Clients and NPCs.
This commit is contained in:
Kinglykrab
2021-01-23 10:46:36 -05:00
parent 0f5a7e1317
commit 19ae461e36
4 changed files with 55 additions and 0 deletions
+25
View File
@@ -2793,6 +2793,29 @@ XS(XS__we) {
XSRETURN_EMPTY;
}
XS(XS__message);
XS(XS__message) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: quest::message(int color, string message)");
int color = (int) SvIV(ST(0));
char *message = (char *) SvPV_nolen(ST(1));
quest_manager.message(color, message);
XSRETURN_EMPTY;
}
XS(XS__whisper);
XS(XS__whisper) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: quest::whisper(string message)");
char *message = (char *) SvPV_nolen(ST(0));
quest_manager.whisper(message);
XSRETURN_EMPTY;
}
XS(XS__getlevel);
XS(XS__getlevel) {
dXSARGS;
@@ -6569,6 +6592,7 @@ EXTERN_C XS(boot_quest) {
newXS(strcpy(buf, "log"), XS__log, file);
newXS(strcpy(buf, "log_combat"), XS__log_combat, file);
newXS(strcpy(buf, "me"), XS__me, file);
newXS(strcpy(buf, "message"), XS__message, file);
newXS(strcpy(buf, "modifynpcstat"), XS__ModifyNPCStat, file);
newXS(strcpy(buf, "movegrp"), XS__movegrp, file);
newXS(strcpy(buf, "movepc"), XS__movepc, file);
@@ -6665,6 +6689,7 @@ EXTERN_C XS(boot_quest) {
newXS(strcpy(buf, "voicetell"), XS__voicetell, file);
newXS(strcpy(buf, "we"), XS__we, file);
newXS(strcpy(buf, "wearchange"), XS__wearchange, file);
newXS(strcpy(buf, "whisper"), XS__whisper, file);
newXS(strcpy(buf, "write"), XS__write, file);
newXS(strcpy(buf, "ze"), XS__ze, file);
newXS(strcpy(buf, "zone"), XS__zone, file);