mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-30 13:47:57 +00:00
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:
@@ -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, "$$;$");
|
||||
|
||||
Reference in New Issue
Block a user