Jump to content
  • 0

R>@cartdropall


Question

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

Note: The command works the same like @storeall one, but instead of storing item to storage, you will store items to cart (if you can cart only and have free slot and weight in cart)

 

add to src/custom/atcommand.inc next code function:

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

	if ( !pc_iscarton(sd) ) {
		clif_displaymessage(fd, "Sorry, but you don't have a cart.");
		return 1;
	}

	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);
			pc_putitemtocart(sd, i, sd->status.inventory[i].amount);
		}
	}

	clif_displaymessage(fd, "All items from inventory stored at cart."); // All items stored.
	return 0;
}

Then, add to src/custom/atcommand_def.inc next code function:

ACMD_DEF(cartstoreall),

Recompile, and have fun. I did few tests related to cart sizes / weight / cart overflow, and everything works fine, no errors, no problems, no item drop to the ground -> just errors if something wrong with cart will be shown to the player.

 

P.S. if you experience any issues with adding atcommand, you can try to use this diff patch.

Edited by Anacondaqq

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...