Exported to PERL $client->SendSpellAnim(targetid, spellid)

This function sends the spell graphic of a spell without actually having to cast the spell.
This commit is contained in:
KayenEQ 2014-10-02 22:08:12 -04:00
parent 272180ff0f
commit 968127c414
4 changed files with 49 additions and 0 deletions

View File

@ -1,5 +1,9 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 10/02/2014 ==
Kayen: Exported to PERL $client->SendSpellAnim(targetid, spellid)
This function sends the spell graphic of a spell without actually having to cast the spell.
== 10/02/2014 ==
Uleat: First round of Ti/6.2 translators added - needed for re-enumeration

View File

@ -1155,6 +1155,7 @@ public:
const char* GetClassPlural(Client* client);
void SendWebLink(const char* website);
void SendMarqueeMessage(uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, std::string msg);
void SendSpellAnim(uint16 targetid, uint16 spell_id);
void DuplicateLoreMessage(uint32 ItemID);
void GarbleMessage(char *, uint8);

View File

@ -6046,6 +6046,32 @@ XS(XS_Client_SendColoredText)
XSRETURN_EMPTY;
}
XS(XS_Client_SendSpellAnim); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_SendSpellAnim)
{
dXSARGS;
if (items != 3)
Perl_croak(aTHX_ "Usage: SendSpellAnim(uint16 spell_id, uint32 seq)");
{
Client * THIS;
uint16 targetid = (uint16)SvUV(ST(1));
uint16 spell_id = (uint16)SvUV(ST(2));
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 == NULL)
Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");
THIS->SendSpellAnim(targetid,spell_id);
}
XSRETURN_EMPTY;
}
#ifdef __cplusplus
extern "C"
#endif
@ -6286,6 +6312,8 @@ XS(boot_Client)
newXSproto(strcpy(buf, "ExpeditionMessage"), XS_Client_ExpeditionMessage, file, "$$$");
newXSproto(strcpy(buf, "SendMarqueeMessage"), XS_Client_SendMarqueeMessage, file, "$$$$$$$");
newXSproto(strcpy(buf, "SendColoredText"), XS_Client_SendColoredText, file, "$$$");
newXSproto(strcpy(buf, "SendSpellAnim"), XS_Client_SendSpellAnim, file, "$$$");
XSRETURN_YES;
}

View File

@ -5329,3 +5329,19 @@ void NPC::UninitializeBuffSlots()
safe_delete_array(buffs);
}
void Client::SendSpellAnim(uint16 targetid, uint16 spell_id)
{
if (!targetid || !IsValidSpell(spell_id))
return;
EQApplicationPacket app(OP_Action, sizeof(Action_Struct));
Action_Struct* a = (Action_Struct*)app.pBuffer;
a->target = targetid;
a->source = this->GetID();
a->type = 231;
a->spell = spell_id;
a->sequence = 231;
app.priority = 1;
entity_list.QueueCloseClients(this, &app);
}