Client::GetAugmentID
So on PEQ at least, some keyed doors are handled by perl (no idea if AX does the same) but mainly this applies to VP, I know a few people used their augments on PEQ and were sad they couldn't get back into VP, so I decided to look into it and try to fix check_hasitem.pl to check for the augment, which I realized with our current set of tools we can't do, so I had to do crap etc etc
this is still not a good idea to use it as an augment (what if you die!) All of these files are from rev478 zone/client.h line 618 is the define for GetItemIDAt so I just added this below it at line 619 Code:
uint32 GetAugmentIDAt(sint16 slot_id); right below the Client::GetItemIDAt function I added the new function GetItemIDAt is lines 214-221 below it add Code:
// Returns an augment's ID that's in an item (returns INVALID_ID if not found) Only problem I can see with this is that it checks through all the augslots, but should only return the first, might want to change it to accept slot_id, and augslot_id and then would just have the perl script change each slot That should take care of the functions, now for the perl crap zone/perl_client.cpp on line 2633 it starts the XS(XS_Client_GetItemIDAt) function (lines 2633-2657) below it I added Code:
XS(XS_Client_GetAugmentIDAt); /* prototype to pass -Wmissing-prototypes */ the following lines are what they should be at after adding the above on line 3724 is the GetItemIDAt thing Code:
newXSproto(strcpy(buf, "GetItemIDAt"), XS_Client_GetItemIDAt, file, "$$"); Code:
newXSproto(strcpy(buf, "GetAugmentIDAt"), XS_Client_GetAugmentIDAt, file, "$$"); now for the check_hasitem.pl I just defined Code:
my $augid1; Code:
$augid1=$client->GetAugmentIDAt($slot1); Code:
if($itemid1==$itmchk || $augid1==$itmchk) http://www.projecteq.net/phpBB2/view...?p=32013#32013 |
so I decided to change this up a little to make it work less stupidly :D
the line numbers are still based on what I previously said zone/client.h line 619 Code:
uint32 GetAugmentIDAt(sint16 slot_id, uint8 augslot); lines 232-233 Code:
// Returns an augment's ID that's in an item (returns INVALID_ID if not found) lines 2659-2685 Code:
XS(XS_Client_GetAugmentIDAt); /* prototype to pass -Wmissing-prototypes */ Code:
newXSproto(strcpy(buf, "GetAugmentIDAt"), XS_Client_GetAugmentIDAt, file, "$$$"); in a quest file if you wanted to check every augslot for an item you'd just run something like this Code:
for($i=0; $i<5; $i++) { |
Would you mind creating a unified diff of the current version of your code?
|
Code:
Index: EQEmuServer/zone/perl_client.cpp Code:
Index: EQEmuServer/zone/inventory.cpp Code:
Index: EQEmuServer/zone/client.h |
Excellent, this and your updated plugin will be live on the Grand Creation with the reboot. If testing there goes well, I'll commit to SVN.
|
my only concern with it would be an increased server load since I did double the complexity for each basically :P
at least the function should stay, gives people more options, whether or not the plugin is used, oh well, thought I'd give it a try at fixing it :P and note, I would still not recommend using the VP aug as an aug until we get the keyring working correctly for all doors |
This was committed in Rev 499.
The server load is negligible since this is only being called by the check_hasitem Perl plugin. |
All times are GMT -4. The time now is 11:26 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.