[API] Perl functions to set invulnerable to and modify environmental damage. (#2044)

* invulnerable

* modifier

* fix

* fix

* fix

* [API] Perl functions to set invulnerable to and modify environmental damage.

* [API] Perl and Lua functions to set invulnerable to and modify environmental damage.

credit to kinglykrab for lua
This commit is contained in:
KayenEQ
2022-03-08 19:50:46 -05:00
committed by GitHub
parent 5b6f1d38be
commit dbe0591b09
6 changed files with 113 additions and 0 deletions
+65
View File
@@ -5996,6 +5996,67 @@ XS(XS_Client_UnscribeSpellBySpellID) {
XSRETURN_EMPTY;
}
XS(XS_Client_GetEnvironmentDamageModifier); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_GetEnvironmentDamageModifier) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Client::GetEnvironmentDamageModifier(THIS)"); // @categories Script Utility
{
Client* THIS;
int32 RETVAL;
dXSTARG;
VALIDATE_THIS_IS_CLIENT;
RETVAL = THIS->GetEnvironmentDamageModifier();
XSprePUSH;
PUSHi((IV)RETVAL);
}
XSRETURN(1);
}
XS(XS_Client_SetEnvironmentDamageModifier); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_SetEnvironmentDamageModifier) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Client::SetEnvironmentDamageModifier(THIS, int32 modifier)"); // @categories Script Utility
{
Client* THIS;
int32 modifier = (int32)SvIV(ST(1));
VALIDATE_THIS_IS_CLIENT;
THIS->SetEnvironmentDamageModifier(modifier);
}
XSRETURN_EMPTY;
}
XS(XS_Client_GetInvulnerableEnvironmentDamage); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_GetInvulnerableEnvironmentDamage) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Client::InvulnerableEnvironmentDamage(THIS)"); // @categories Script Utility
{
Client* THIS;
bool RETVAL;
VALIDATE_THIS_IS_CLIENT;
RETVAL = THIS->GetInvulnerableEnvironmentDamage();
ST(0) = boolSV(RETVAL);
sv_2mortal(ST(0));
}
XSRETURN(1);
}
XS(XS_Client_SetInvulnerableEnvironmentDamage); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_SetInvulnerableEnvironmentDamage) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage:Client::SetInvulnerableEnvironmentDamage(THIS, bool invulnerable)"); // @categories Script Utility
{
Client *THIS;
bool invul = (bool)SvTRUE(ST(1));
VALIDATE_THIS_IS_CLIENT;
THIS->SetInvulnerableEnvironmentDamage(invul);
}
XSRETURN_EMPTY;
}
#ifdef __cplusplus
extern "C"
#endif
@@ -6104,6 +6165,7 @@ XS(boot_Client) {
newXSproto(strcpy(buf, "GetDiscSlotBySpellID"), XS_Client_GetDiscSlotBySpellID, file, "$$");
newXSproto(strcpy(buf, "GetDisciplineTimer"), XS_Client_GetDisciplineTimer, file, "$$");
newXSproto(strcpy(buf, "GetDuelTarget"), XS_Client_GetDuelTarget, file, "$");
newXSproto(strcpy(buf, "GetEnvironmentDamageModifier"), XS_Client_GetEnvironmentDamageModifier, file, "$");
newXSproto(strcpy(buf, "GetEXP"), XS_Client_GetEXP, file, "$");
newXSproto(strcpy(buf, "GetEXPModifier"), XS_Client_GetEXPModifier, file, "$$");
newXSproto(strcpy(buf, "GetEbonCrystals"), XS_Client_GetEbonCrystals, file, "$");
@@ -6127,6 +6189,7 @@ XS(boot_Client) {
newXSproto(strcpy(buf, "GetInstanceID"), XS_Client_GetInstanceID, file, "$$");
newXSproto(strcpy(buf, "GetInstrumentMod"), XS_Client_GetInstrumentMod, file, "$$");
newXSproto(strcpy(buf, "GetInventory"), XS_Client_GetInventory, file, "$");
newXSproto(strcpy(buf, "GetInvulnerableEnvironmentDamage"), XS_Client_GetInvulnerableEnvironmentDamage, file, "$");
newXSproto(strcpy(buf, "GetItemAt"), XS_Client_GetItemAt, file, "$$");
newXSproto(strcpy(buf, "GetItemIDAt"), XS_Client_GetItemIDAt, file, "$$");
newXSproto(strcpy(buf, "GetItemInInventory"), XS_Client_GetItemInInventory, file, "$$");
@@ -6272,6 +6335,7 @@ XS(boot_Client) {
newXSproto(strcpy(buf, "SetEXPModifier"), XS_Client_SetEXPModifier, file, "$$$");
newXSproto(strcpy(buf, "SetEbonCrystals"), XS_Client_SetEbonCrystals, file, "$$");
newXSproto(strcpy(buf, "SetEndurance"), XS_Client_SetEndurance, file, "$$");
newXSproto(strcpy(buf, "SetEnvironmentDamageModifier"), XS_Client_SetEnvironmentDamageModifier, file, "$$");
newXSproto(strcpy(buf, "SetFactionLevel"), XS_Client_SetFactionLevel, file, "$$$$$$");
newXSproto(strcpy(buf, "SetFactionLevel2"), XS_Client_SetFactionLevel2, file, "$$$$$$$");
newXSproto(strcpy(buf, "SetFeigned"), XS_Client_SetFeigned, file, "$$");
@@ -6281,6 +6345,7 @@ XS(boot_Client) {
newXSproto(strcpy(buf, "SetHorseId"), XS_Client_SetHorseId, file, "$$");
newXSproto(strcpy(buf, "SetHunger"), XS_Client_SetHunger, file, "$$");
newXSproto(strcpy(buf, "SetIPExemption"), XS_Client_SetIPExemption, file, "$$");
newXSproto(strcpy(buf, "SetInvulnerableEnvironmentDamage"), XS_Client_SetInvulnerableEnvironmentDamage, file, "$$");
newXSproto(strcpy(buf, "SetLanguageSkill"), XS_Client_SetLanguageSkill, file, "$$$");
newXSproto(strcpy(buf, "SetMaterial"), XS_Client_SetMaterial, file, "$$$");
newXSproto(strcpy(buf, "SetPVP"), XS_Client_SetPVP, file, "$$");