Jump to content
  • 0

[Script command][Equip Arrows]


Nuckelavee

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   8
  • Joined:  03/24/12
  • Last Seen:  

Hi again, im trying to modify the "equip" script command so it can also equip arrows since it only shows "Item cannot be equipped!" when an arrow id is given. i tried to modify this part of the script code but so far ive not been able to:

BUILDIN_FUNC(equip) {
	unsigned short nameid = 0;
	TBL_PC *sd;
	struct item_data *item_data;

	if (!(sd = script_rid2sd(st)))
		return SCRIPT_CMD_SUCCESS;

	nameid = script_getnum(st,2);
	if ((item_data = itemdb_exists(nameid))) {
		int i;

		ARR_FIND( 0, MAX_INVENTORY, i, sd->status.inventory[i].nameid == nameid );
		if (i < MAX_INVENTORY) {
			pc_equipitem(sd,i,item_data->equip);
			script_pushint(st,1);
			return SCRIPT_CMD_SUCCESS;
		}
	}

	ShowError("buildin_equip: Item %hu cannot be equipped\n",nameid);
	script_pushint(st,0);
	return SCRIPT_CMD_FAILURE;
}

i hope someone is able to lend me a hand with this!, thanks in advance!. /no1

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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