Identified the Target Ring fields for RoF/RoF2 and added a perl accessor for the last target ring position received from the client.

Usage: $client->GetTargetRingX(), $client->GetTargetRingY(), $client->GetTargetRingZ()
This commit is contained in:
SecretsOTheP 2015-03-29 01:35:24 -04:00
parent 4dcb679c53
commit b6cc070633
6 changed files with 100 additions and 2 deletions

View File

@ -1,5 +1,9 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 03/29/2015 ==
Secrets: Identified the Target Ring fields for RoF/RoF2.
Secrets: Added a perl accessor for the last target ring position received from the client. Usage: $client->GetTargetRingX(), $client->GetTargetRingY(), $client->GetTargetRingZ()
== 03/12/2015 ==
Akkadius: [eqemu_update.pl V7] Add Option 9) LUA Modules - Download latest LUA Modules (Required for Lua)

View File

@ -4236,6 +4236,10 @@ namespace RoF
//IN(inventoryslot);
IN(target_id);
IN(y_pos);
IN(x_pos);
IN(z_pos);
FINISH_DIRECT_DECODE();
}

View File

@ -4380,6 +4380,9 @@ namespace RoF2
emu->inventoryslot = RoF2ToServerSlot(eq->inventoryslot);
//IN(inventoryslot);
IN(target_id);
IN(y_pos);
IN(x_pos);
IN(z_pos);
FINISH_DIRECT_DECODE();
}

View File

@ -658,7 +658,10 @@ struct CastSpell_Struct
/*04*/ uint32 spell_id;
/*08*/ ItemSlotStruct inventoryslot; // slot for clicky item, Seen unknown of 131 = normal cast
/*20*/ uint32 target_id;
/*24*/ uint32 cs_unknown[5];
/*24*/ uint32 cs_unknown[2];
/*32*/ float y_pos;
/*36*/ float x_pos;
/*40*/ float z_pos;
/*44*/
};

View File

@ -647,7 +647,10 @@ struct CastSpell_Struct
/*04*/ uint32 spell_id;
/*08*/ ItemSlotStruct inventoryslot; // slot for clicky item, Seen unknown of 131 = normal cast
/*20*/ uint32 target_id;
/*24*/ uint32 cs_unknown[5];
/*24*/ uint32 cs_unknown[2];
/*32*/ float y_pos;
/*36*/ float x_pos;
/*40*/ float z_pos;
/*44*/
};

View File

@ -6110,6 +6110,84 @@ XS(XS_Client_SendSpellAnim)
XSRETURN_EMPTY;
}
XS(XS_Client_GetTargetRingX); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_GetTargetRingX)
{
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Client::GetTargetRingX(THIS)");
{
Client * THIS;
float 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->GetTargetRingX();
XSprePUSH; PUSHn((double)RETVAL);
}
XSRETURN(1);
}
XS(XS_Client_GetTargetRingY); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_GetTargetRingY)
{
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Client::GetTargetRingY(THIS)");
{
Client * THIS;
float 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->GetTargetRingY();
XSprePUSH; PUSHn((double)RETVAL);
}
XSRETURN(1);
}
XS(XS_Client_GetTargetRingZ); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_GetTargetRingZ)
{
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Client::GetTargetRingZ(THIS)");
{
Client * THIS;
float 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->GetTargetRingZ();
XSprePUSH; PUSHn((double)RETVAL);
}
XSRETURN(1);
}
#ifdef __cplusplus
extern "C"
#endif
@ -6351,6 +6429,9 @@ XS(boot_Client)
newXSproto(strcpy(buf, "SendMarqueeMessage"), XS_Client_SendMarqueeMessage, file, "$$$$$$$");
newXSproto(strcpy(buf, "SendColoredText"), XS_Client_SendColoredText, file, "$$$");
newXSproto(strcpy(buf, "SendSpellAnim"), XS_Client_SendSpellAnim, file, "$$$");
newXSproto(strcpy(buf, "GetTargetRingX"), XS_Client_GetTargetRingX, file, "$$");
newXSproto(strcpy(buf, "GetTargetRingY"), XS_Client_GetTargetRingY, file, "$$");
newXSproto(strcpy(buf, "GetTargetRingZ"), XS_Client_GetTargetRingZ, file, "$$");
XSRETURN_YES;
}