Add IsTaunting() to Perl/Lua.

This commit is contained in:
Alex
2020-05-14 23:55:55 -04:00
parent 5f0d3e9026
commit ee55755c85
3 changed files with 32 additions and 0 deletions
+25
View File
@@ -991,6 +991,30 @@ XS(XS_NPC_SetTaunting) {
XSRETURN_EMPTY;
}
XS(XS_NPC_IsTaunting); /* prototype to pass -Wmissing-prototypes */
XS(XS_NPC_IsTaunting) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: NPC::IsTaunting(THIS)");
{
NPC *THIS;
bool RETVAL;
if (sv_derived_from(ST(0), "NPC")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(NPC *, tmp);
} else
Perl_croak(aTHX_ "THIS is not of type NPC");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->IsTaunting();
ST(0) = boolSV(RETVAL);
sv_2mortal(ST(0));
}
XSRETURN(1);
}
XS(XS_NPC_PickPocket); /* prototype to pass -Wmissing-prototypes */
XS(XS_NPC_PickPocket) {
dXSARGS;
@@ -2528,6 +2552,7 @@ XS(boot_NPC) {
newXSproto(strcpy(buf, "SetPetSpellID"), XS_NPC_SetPetSpellID, file, "$$");
newXSproto(strcpy(buf, "GetMaxDamage"), XS_NPC_GetMaxDamage, file, "$$");
newXSproto(strcpy(buf, "SetTaunting"), XS_NPC_SetTaunting, file, "$$");
newXSproto(strcpy(buf, "IsTaunting"), XS_NPC_IsTaunting, file, "$");
newXSproto(strcpy(buf, "PickPocket"), XS_NPC_PickPocket, file, "$$");
newXSproto(strcpy(buf, "StartSwarmTimer"), XS_NPC_StartSwarmTimer, file, "$$");
newXSproto(strcpy(buf, "DoClassAttacks"), XS_NPC_DoClassAttacks, file, "$$");