Jump to content
AnnieRuru

inventoryselect

Recommended Posts

Credit to Epoque for the idea

 

Download : 1.4
plugin

 

while reading the description,

  Quote

*inventoryselect();
Opens a prompt window which display a configurable list of items which may be selected (as shown in the screenshots).

allow list all the items in your inventory, or only show part of it

with version 1.2 onwards, now can list out only certain types of items

for example inventoryselect(ITF_WEAPON|ITF_ARMOR) only shows equipments available in your inventory

and inventoryselect(ITF_CARD) only shows card available in your inventory

 

no, don't do stuffs like adding item temporary, player can find ways to dup item

 

tested with

  Reveal hidden contents

screen2019Hercules038.jpg

 

  Reveal hidden contents

 

Edited by AnnieRuru

Share this post


Link to post
Share on other sites

ok 1 more try

 

1.3 - plugin

- add ITF_ALL flag for 2nd argument expansion

- allow to use any array of your choice to only show items only allow on that array

 

and of course this time I setup my own test server on google cloud with centos myself, hopefully in this future no more error like above shows up

Share this post


Link to post
Share on other sites

1.4 - plugin

- fix sample 3 always throw "Target argument is not a variable!" by changing script_isstringtype into script_isstring

- add script->reportdata whenever necessary

Share this post


Link to post
Share on other sites
  On 11/14/2020 at 10:40 PM, astralprojection said:

is it possible also to modify
callshop .shop_npc_name$,2; to just show a specific type of item to be sold?

well yes, almost same concept here
this is rip from clif.c

/// Presents list of items, that can be sold to an NPC shop (ZC_PC_SELL_ITEMLIST).
/// 00c7 <packet len>.W { <index>.W <price>.L <overcharge price>.L }*
static void clif_selllist(struct map_session_data *sd)
{
	int c = 0, val;

	nullpo_retv(sd);

	int fd = sd->fd;
	WFIFOHEAD(fd, sd->status.inventorySize * 10 + 4);
	WFIFOW(fd,0)=0xc7;
	for (int i = 0; i < sd->status.inventorySize; i++)
	{
		if( sd->status.inventory[i].nameid > 0 && sd->inventory_data[i] )
		{
			if( !itemdb_cansell(&sd->status.inventory[i], pc_get_group_level(sd)) )
				continue;

			if (sd->status.inventory[i].favorite != 0)
				continue; // Cannot Sell Favorite item

			if( sd->status.inventory[i].expire_time )
				continue; // Cannot Sell Rental Items

			if( sd->status.inventory[i].bound && !pc_can_give_bound_items(sd))
				continue; // Don't allow sale of bound items

			val=sd->inventory_data[i]->value_sell;
			if( val < 0 )
				continue;
			WFIFOW(fd,4+c*10)=i+2;
			WFIFOL(fd,6+c*10)=val;
			WFIFOL(fd,10+c*10)=pc->modifysellvalue(sd,val);
			c++;
		}
	}
	WFIFOW(fd,2)=c*10+4;
	WFIFOSET(fd,WFIFOW(fd,2));
}

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.