Jump to content
  • 0

how to create NPC that has menu that only show your equipment in inventory


Question

1 answer to this question

Recommended Posts

  • 0
Posted

You can use getinventorylist and filter all items that aren't equipment or currently equipped equipment.

prontera,150,150,6	script	Demo	85,{
	disable_items;
	getinventorylist;
	for(.@i = 0; .@i < @inventorylist_count; .@i++) {
		.@item_type = getiteminfo(@inventorylist_id[.@i], ITEMINFO_TYPE);

		if ((.@item_type == IT_ARMOR || .@item_type == IT_WEAPON || .@item_type == IT_SHADOWGEAR) && !@inventorylist_equip[.@i]) {
			.@item_ref = getarraysize(.@equipment_id_list);
			.@equipment_id_list[.@item_ref] = @inventorylist_id[.@i];
			.@menu_labels$[.@item_ref] = getitemname(@inventorylist_id[.@i]);
		}
	}

	.@selected_item_ref = select(implode(.@menu_labels$, ":") - 1;
	next;
	mes "You selected: " + getitemname(.@equipment_id_list[.@selected_item_ref]) + ".";
	close;
}

 

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