New Perl/Lua buff functionality.

- Client::FindMemmedSpellBySlot(slot)
	This allows you to find memmed spells by a specific slot.
	Example: https://i.imgur.com/06OFT3c.png
	Perl Example: https://pastebin.com/BCr6KqSS

- Client::MemmedCount()
	This will find the number of memmed spells the client has.
	Example: https://i.imgur.com/cY26DEl.png
	Perl Example: https://pastebin.com/T3ahSUgi
This commit is contained in:
Kinglykrab
2019-06-16 12:50:32 -04:00
parent 7d1362732d
commit 9356b5dc7f
5 changed files with 86 additions and 0 deletions
+53
View File
@@ -2404,6 +2404,57 @@ XS(XS_Client_UnmemSpellAll) {
XSRETURN_EMPTY;
}
XS(XS_Client_FindMemmedSpellBySlot); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_FindMemmedSpellBySlot) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Client::FindMemmedSpellBySlot(THIS, int slot)");
{
Client *THIS;
uint16 RETVAL;
dXSTARG;
int slot = SvIV(ST(1));
if (sv_derived_from(ST(0), "Client")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Client *, tmp);
} else
Perl_croak(aTHX_ "THIS is not of type Client");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->FindMemmedSpellBySlot(slot);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
XS(XS_Client_MemmedCount); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_MemmedCount) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Client::MemmedCount(THIS)");
{
Client *THIS;
uint32 RETVAL;
dXSTARG;
if (sv_derived_from(ST(0), "Client")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Client *, tmp);
} else
Perl_croak(aTHX_ "THIS is not of type Client");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->MemmedCount();
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
XS(XS_Client_ScribeSpell); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_ScribeSpell) {
dXSARGS;
@@ -6478,6 +6529,8 @@ XS(boot_Client) {
newXSproto(strcpy(buf, "UnmemSpell"), XS_Client_UnmemSpell, file, "$$;$");
newXSproto(strcpy(buf, "UnmemSpellAll"), XS_Client_UnmemSpellAll, file, "$;$");
newXSproto(strcpy(buf, "UnmemSpellBySpellID"), XS_Client_UnmemSpellBySpellID, file, "$$");
newXSproto(strcpy(buf, "FindMemmedSpellBySlot"), XS_Client_FindMemmedSpellBySlot, file, "$$");
newXSproto(strcpy(buf, "MemmedCount"), XS_Client_MemmedCount, file, "$");
newXSproto(strcpy(buf, "UnscribeSpell"), XS_Client_UnscribeSpell, file, "$$;$");
newXSproto(strcpy(buf, "UnscribeSpellAll"), XS_Client_UnscribeSpellAll, file, "$;$");
newXSproto(strcpy(buf, "UntrainDisc"), XS_Client_UntrainDisc, file, "$$;$");