Jump to content
  • 0

Temporary Item Array


GodKnows Jhomz

Question


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  333
  • Reputation:   67
  • Joined:  09/05/12
  • Last Seen:  

Can anyone help me how to make an npc with temporary array.
The npc should be like this:

Talk to npc then selection of Add Item or Close.
After clicking Add Item, it will ask for Item ID then Item Amount.
Then it will show the item name and amount after clicking next.
( After next it will show the current item list and it will show the same menu (Add Item or Close) )
After clicking Add Item again, it will do the same then after adding item id and amount it will show the list again including the latest item added and the same menu.
When you click close, it will clear the array.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

izlude,128,124,0	script	dumb menu A	4_F_01,{
	mes "what do you want to do";
	while (true) {
		next;
		if (select( "^FF0000Add an item^000000", "Close" ) == 2)
			end;
		mes "Input Item ID :";
		input .@tmp_item;
		if (getitemname(.@tmp_item) == "null") {
			mes "Invalid item ID " + .@tmp_item;
			continue;
		}
		mes "Input Amount :";
		input .@tmp_amount;
		if (.@tmp_amount == 0) {
			mes "Invalid amount.";
			continue;
		}
		.@item_id[ .@size ] = .@tmp_item;
		.@amount[ .@size ] = .@tmp_amount;
		.@size++;

		mes "Item list :";
		for ( .@i = 0; .@i < .@size; .@i++ )
			mes (.@i+1) + "/ x" + .@amount[.@i] + " ^ff0000" + getitemname(.@item_id[.@i]) + "^000000";
	}
}

 

  • MVP 2
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...