Jump to content
  • 0

@storeall


letstry

Question


  • Group:  Members
  • Topic Count:  87
  • Topics Per Day:  0.02
  • Content Count:  219
  • Reputation:   0
  • Joined:  05/03/12
  • Last Seen:  

Hi guys I would like to ask for some help to modify @storeall which will include cart.

I've tried modifying it but it still doesn't read the cart.

Here's my current @storeall mod.

Thanks!

ACMD_FUNC(storeall)
{
	int i;
	nullpo_retr(-1, sd);

	if (sd->state.storage_flag != 1)
  	{	//Open storage.
		if( storage_storageopen(sd) == 1 ) {
			clif_displaymessage(fd, "You can't open the storage currently.");
			return -1;
		}
	}
        // Cart
	for (i = 0; i < MAX_CART; i++) {
		if (sd->status.cart[i].amount) {
			if(sd->status.cart[i].equip != 0)
				pc_unequipitem(sd, i, 3);
			storage_storageadd(sd,  i, sd->status.cart[i].amount);
		}
	}
        // Inventory
	for (i = 0; i < MAX_INVENTORY; i++) {
		if (sd->status.inventory[i].amount) {
			if(sd->status.inventory[i].equip != 0)
				pc_unequipitem(sd, i, 3);
			storage_storageadd(sd,  i, sd->status.inventory[i].amount);
		}
	}

	storage_storageclose(sd);

	clif_displaymessage(fd, "It is done");
	return 0;
}
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   45
  • Joined:  08/14/12
  • Last Seen:  

storage_storageadd() gets items from your inventory, not the cart.

 

There is a storage_storageaddfromcart() function, which you would use instead.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  87
  • Topics Per Day:  0.02
  • Content Count:  219
  • Reputation:   0
  • Joined:  05/03/12
  • Last Seen:  

Thanks!

Link to comment
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
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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...