Jump to content
  • 0

NPC menu for equipped item


Kawacito

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.01
  • Content Count:  33
  • Reputation:   2
  • Joined:  04/16/21
  • Last Seen:  

What I am looking to create is very basic but unfortunately I cannot solve the problem, what I need to create is an NPC that gives me a list of the items that I have equipped and a menu for each item that I have equipped to perform other functions. In my case through an npc that allows the battle teams to evolve with a specific item, when speaking to the npc I get the option of which equipped item I want to evolve, example:


[NPC] You have equipped:
*Devil Hat
*Devil Armor
Which do you want to evolve?

menu:
Devil's Hat
Devil Armor

basically it is that the npc gives me the name of the item that I have equipped and gives me the option to select which one I want to select for future actions

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  132
  • Reputation:   53
  • Joined:  06/02/12
  • Last Seen:  

Hi

Spoiler
prontera,150,150,4	script	Person	485,{
	disable_items;
	mes "[Person]";
	mes "I can evolve equipments.";
	mes "Do you want to evolve something?";
	next;

	setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW;
	for(.@i = 1; .@i<getarraysize(.@indices); ++.@i) {
		if(getequipisequiped(.@indices[.@i])) {
			.@menu$ = .@menu$ + F_getpositionname(.@indices[.@i]) + "-[" + getequipname(.@indices[.@i]) + "]";
			.@equipped = 1;
		}
		.@menu$ = .@menu$ + ":";
	}
	if (.@equipped == 0) {
		mes "[Person]";
		mes "What?";
		close;
	}

	.@part = .@indices[select(.@menu$)];
	.@item = getequipid(.@part);
	//You can now use various commands with .@part and .@item

	//You can check more info about the item, like refine
	.@refine = getequiprefinerycnt(.@part);

	mes "[Person]";
	mes "That's a nice " + getitemname(.@item) + ".";
	mes "It's at refine " + .@refine + ".";

	//Command examples:
	//successremovecards .@part;
	//successrefitem .@part;
	//downrefitem .@part;
	//unequip .@part;
	//breakequip .@part;
	//delequip .@part;
	//getitem
	
	close;
}

 

 

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