From 968127c414e2413dc43b3ca9ec5b26b51a252605 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Thu, 2 Oct 2014 22:08:12 -0400 Subject: [PATCH] Exported to PERL $client->SendSpellAnim(targetid, spellid) This function sends the spell graphic of a spell without actually having to cast the spell. --- changelog.txt | 4 ++++ zone/client.h | 1 + zone/perl_client.cpp | 28 ++++++++++++++++++++++++++++ zone/spells.cpp | 16 ++++++++++++++++ 4 files changed, 49 insertions(+) diff --git a/changelog.txt b/changelog.txt index 81233fcd7..693393bac 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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 diff --git a/zone/client.h b/zone/client.h index 235861396..d600b51c5 100644 --- a/zone/client.h +++ b/zone/client.h @@ -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); diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 04becfdc8..a33e9a8b9 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -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; } diff --git a/zone/spells.cpp b/zone/spells.cpp index fb3cba454..913ea0f26 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -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); +}