Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-07-2009, 01:54 AM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default 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);
zone/inventory.cpp
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)
uint32 Client::GetAugmentIDAt(sint16 slot_id) {
	const ItemInst* inst = m_inv[slot_id];
	sint16 i;
	if (inst)
		for (i = 0; i < 5; i++)
			if (inst->GetAugmentItemID(i))
				return inst->GetAugmentItemID(i);

	// None found
	return INVALID_ID;
}
These will become lines 223-234

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 */
XS(XS_Client_GetAugmentIDAt)
{
	dXSARGS;
	if (items != 2)
		Perl_croak(aTHX_ "Usage: Client::GetAugmentIDAt(THIS, slot_id)");
	{
		Client *		THIS;
		uint32		RETVAL;
		dXSTARG;
		sint16		slot_id = (sint16)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 == NULL)
			Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");

		RETVAL = THIS->GetAugmentIDAt(slot_id);
		XSprePUSH; PUSHu((UV)RETVAL);
	}
	XSRETURN(1);
}
becoming lines 2659-2684

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, "$$");
below it add

Code:
newXSproto(strcpy(buf, "GetAugmentIDAt"), XS_Client_GetAugmentIDAt, file, "$$");
this will be line 3725


now for the check_hasitem.pl

I just defined
Code:
my $augid1;
and above each if statment add
Code:
$augid1=$client->GetAugmentIDAt($slot1);
and change the if to
Code:
if($itemid1==$itmchk || $augid1==$itmchk)
I'll post a the full quest file on PEQ since I believe it's their file or something :P

http://www.projecteq.net/phpBB2/view...?p=32013#32013
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:50 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3