[Quest API] Add GetHealScale() and GetSpellScale() to Perl and Lua. (#1515)

This commit is contained in:
Kinglykrab
2021-09-03 20:47:33 -04:00
committed by GitHub
parent e1df72d64d
commit 119018cf41
3 changed files with 53 additions and 1 deletions
+36
View File
@@ -1812,6 +1812,40 @@ XS(XS_NPC_GetFirstSlotByItemID) {
XSRETURN(1);
}
XS(XS_NPC_GetHealScale);
XS(XS_NPC_GetHealScale) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: NPC::GetHealScale(THIS)"); // @categories Stats and Attributes
{
NPC *THIS;
float healscale;
dXSTARG;
VALIDATE_THIS_IS_NPC;
healscale = THIS->GetHealScale();
XSprePUSH;
PUSHn((double) healscale);
}
XSRETURN(1);
}
XS(XS_NPC_GetSpellScale);
XS(XS_NPC_GetSpellScale) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: NPC::GetSpellScale(THIS)"); // @categories Stats and Attributes
{
NPC *THIS;
float spellscale;
dXSTARG;
VALIDATE_THIS_IS_NPC;
spellscale = THIS->GetSpellScale();
XSprePUSH;
PUSHn((double) spellscale);
}
XSRETURN(1);
}
#ifdef __cplusplus
extern "C"
#endif
@@ -1934,6 +1968,8 @@ XS(boot_NPC) {
newXSproto(strcpy(buf, "CountItem"), XS_NPC_CountItem, file, "$$");
newXSproto(strcpy(buf, "GetItemIDBySlot"), XS_NPC_GetItemIDBySlot, file, "$$");
newXSproto(strcpy(buf, "GetFirstSlotByItemID"), XS_NPC_GetFirstSlotByItemID, file, "$$");
newXSproto(strcpy(buf, "GetHealScale"), XS_NPC_GetHealScale, file, "$");
newXSproto(strcpy(buf, "GetSpellScale"), XS_NPC_GetSpellScale, file, "$");
XSRETURN_YES;
}