Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #17  
Old 10-19-2016, 10:47 PM
Darkscis
Sarnak
 
Join Date: Mar 2015
Posts: 62
Default

$client->SummonItem technically can be passed a slot_id, it's just unlisted on the Perl Ultimate reference page and defaults to 30 (cursor). What you would have to do in the case of a "right click auto loot" instead of a left click on cursor is determine what slot the loot landed in, and then Nuke->SummonItem.

Code:
XS(XS_Client_SummonItem)
{
	dXSARGS;
	if (items < 2 || items > 10)
		Perl_croak(aTHX_ "Usage: Client::SummonItem(THIS, item_id, charges=0, attune=0, aug1=0, aug2=0, aug3=0, aug4=0, aug5=0, slot_id=30)");
	{
		Client *		THIS;
		uint32		item_id = (uint32)SvUV(ST(1));
		int16		charges = -1;
		bool		attune = false;
		uint32		aug1 = 0;
		uint32		aug2 = 0;
		uint32		aug3 = 0;
		uint32		aug4 = 0;
		uint32		aug5 = 0;
		uint16		slot_id = 30;

		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.");

		if (items > 2) {
			charges = (int16)SvIV(ST(2));
		}
		if (items > 3) {
			attune = (bool)SvTRUE(ST(3));
		}
		if (items > 4) {
			aug1 = (uint32)SvUV(ST(4));
		}
		if (items > 5) {
			aug2 = (uint32)SvUV(ST(5));
		}
		if (items > 6) {
			aug3 = (uint32)SvUV(ST(6));
		}
		if (items > 7) {
			aug4 = (uint32)SvUV(ST(7));
		}
		if (items > 8) {
			aug5 = (uint32)SvUV(ST(8));
		}
		if (items > 9) {
			slot_id = (uint16)SvUV(ST(9));
		}

		THIS->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attune, slot_id);
	}
	XSRETURN_EMPTY;
}
Disclaimer: I have not actually used it in this way so experiment at your own peril
Reply With Quote
 


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 02:15 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