Buying amount limitation on NST_MARKET trader

thor1009

New member
Messages
42
Points
0
Hi everyone,

I have encountered a problem when trying to make a NST_MARKET trader.

Some items have a limited amount to be purchased at one time, for example, the itemID 12636, amount cannot exceed 10, otherwise it shows

'Cannot purchase item, You exceeded the weight.'
 
Is there anyway to modify this limit?
Thanks in advance.
 
 
That really , that you will be out of weight......

You can modify it via source to allow all items to behave like you told.

Or modify item_db and reduce the weight of the item.

But I have no idea why you want items to exceed the weight limit.

 
Last edited by a moderator:
That really , that you will be out of weight......

You can modify it via source to allow all items to behave like you told.

Or modify item_db and reduce the weight of the item.

But I have no idea why you want items to exceed the weight limit.
I might not explain that problem clearly.

It's not exceeding weight limit, it just show that message.

The Malangdo special can (ID 12636) has weight 0 in the database

I can purchase 10 cans for 5 times to get 50 cans.

But when I try to purchase 50 cans, it shows that error message.

This happens only for NST_MARKET type trader, for normal shop script, there is no such limitation.

 
show me your script for the NPC_MARKET shop , maybe you have not the restock correckt , since its a SHOP with autorefill

 
That really , that you will be out of weight......

You can modify it via source to allow all items to behave like you told.

Or modify item_db and reduce the weight of the item.

But I have no idea why you want items to exceed the weight limit.
You are here for so long and you still wonder about weird questions / requests? Thats cute.
default_heh.gif


 
That really , that you will be out of weight......

You can modify it via source to allow all items to behave like you told.

Or modify item_db and reduce the weight of the item.

But I have no idea why you want items to exceed the weight limit.
You are here for so long and you still wonder about weird questions / requests? Thats cute.
default_heh.gif
My bad to be lazy to not show some screenshots, so it leads to so many misunderstandings.

This is NOT a WEIRD question/request, please read my reply to him. And here are some screenshots in case the problem is still unclear.

problem1.jpg

problem2.jpg

As you can see.

I cannot buy 10 Anger of Seagod at once, but I can buy 3 Anger of Seagod for 5 times.

I have enough zeny, enough weight for it. The weight in database is double-checked, it is really 0.

Here it is the simple script for this NST_MARKET trader.- trader Market -,{OnInit: setarray .sellitem[0],12405,607,6489,6423,6417; setarray .sellprice[0],50000,300000,1000000,1500000,5000000; setarray .sellamount[0],200,100,50,40,20; tradertype(NST_MARKET); for(.@i = 0; .@i < getarraysize(.sellitem); ++.@i) sellitem .sellitem[.@i],.sellprice[.@i],.sellamount[.@i]; end;OnMyResupply: for(.@i = 0; .@i < getarraysize(.sellitem); ++.@i) { if( shopcount(.sellitem[.@i]) < 1 + .sellamount[.@i]/2 ) sellitem .sellitem[.@i],.sellprice[.@i],.sellamount[.@i]; } end;}
show me your script for the NPC_MARKET shop , maybe you have not the restock correckt , since its a SHOP with autorefill
Yes, it is shown.

Since there is nothing related to the one-time purchase limit in the script, and in the item database there is also no such setting.

I think it might be some client-side limitation, just like the buying store item list. So this is why I post it here.

By the way, I am using 2015-05-13 client.

 
Last edited by a moderator:
I found some behavier about item weight and shoptype.

If charactor have weight == 0 , max_weight == 4000

and itemid = 501 (Red_Potion) weight 7 (70)

I can buy stuff about 80 ea (max_weight/itemid) not 571 ea for real weight ( max_weight/item_weight )

But anyone can fix it. goto clif.c line round 18240 in function clif_npc_market_open

 

Code:
/* NPC Market (by Ind after an extensive debugging of the packet, only possible thanks to Yommy <3) */
void clif_npc_market_open(struct map_session_data *sd, struct npc_data *nd) {
#if PACKETVER >= 20131223
	struct npc_item_list *shop;
	unsigned short shop_size, i, c;

	nullpo_retv(sd);
	nullpo_retv(nd);
	shop = nd->u.scr.shop->item;
	shop_size = nd->u.scr.shop->items;
	npcmarket_open.PacketType = npcmarketopenType;

	for(i = 0, c = 0; i < shop_size; i++) {
		struct item_data *id = NULL;
		if (shop[i].nameid && (id = itemdb->exists(shop[i].nameid)) != NULL) {
			npcmarket_open.list[c].nameid = shop[i].nameid;
			npcmarket_open.list[c].price  = shop[i].value;
			npcmarket_open.list[c].qty    = shop[i].qty;
			npcmarket_open.list[c].type   = itemtype(id->type);
			// npcmarket_open.list[c].view   = ( id->view_id > 0 ) ? id->view_id : id->nameid; << comment old one
			npcmarket_open.list[c].view   = itemdb_weight(id->nameid); << add new one 
			c++;
		}
	}

	npcmarket_open.PacketLength = 4 + ( sizeof(npcmarket_open.list[0]) * c );

	clif->send(&npcmarket_open,npcmarket_open.PacketLength,&sd->bl,SELF);
#endif
}
 
Back
Top