Jump to content
  • 0

R>@cartdropall


Hanashi

Question


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  113
  • Reputation:   40
  • Joined:  10/23/13
  • Last Seen:  

same function as @dropall  but it drops all item in cart

Edited by AshiHanna
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   345
  • Joined:  02/26/12
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  113
  • Reputation:   40
  • Joined:  10/23/13
  • Last Seen:  

thanks it works fine  /thx

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