Jump to content
  • 0

@storecard


Fenril

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  10
  • Reputation:   0
  • Joined:  11/26/13
  • Last Seen:  

Hi everyone,

Based on the src mod "storeit" ( @Akinari ), I would like to add a command that stores all inventory cards, including those present in inventory equipment, except those equipped.

Currently, the command "storecard" stores the cards present in inventory equipment only...

ACMD_FUNC(storecard) {

	int i;
	nullpo_retr(-1, sd);

	if (sd->npc_id)
	{
		clif_displaymessage(fd, "You cannot be talking to an NPC and use this command.");
		return -1;
	}

	if (sd->state.storage_flag != 1)
  	{	//Open storage.
		switch (storage_storageopen(sd)) {
		case 2: //Try again
			clif_displaymessage(fd, "Run this command again..");
			return 0;
		case 1: //Failure
			clif_displaymessage(fd, "You can't open the storage currently.");
			return -1;
		}
	}
	for (i = 0; i < MAX_INVENTORY; i++) {
		if (sd->inventory.u.items_inventory[i].amount) {
			if(sd->inventory.u.items_inventory[i].equip == 0)
				storage_storageadd(sd, &sd->storage, i, sd->inventory.u.items_inventory[i].amount && sd->inventory.u.items_inventory[i].card[0]);
		}
	}
	storage_storageclose(sd);

	clif_displaymessage(fd, "All cards stored");
	return 0;

}

Thanks for reply.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  10
  • Reputation:   0
  • Joined:  11/26/13
  • Last Seen:  

Nobody ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  5
  • Reputation:   1
  • Joined:  11/24/19
  • Last Seen:  

Hi

try adding an extra innerly nested if statement

if(sd->inventory.u.items_inventory[i].card[0] || sd->inventory.u.items_inventory[i].type == 6){
	storage_storageadd(sd, &sd->storage, i, sd->inventory.u.items_inventory[i].amount);
}

although i think this may send to storage blacksmith forged weapons

if you test it please let me know wether it works

byes

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