Jump to content
  • 0

npc that exchanges multiple items for an item


Question

Posted

Good night.

How do I make a npc exchange multiple materials for a specific item?

I looked for several npcs .. I even used a letter changer .. but it does not do what I need. I need npc to pay different amounts of different items. He will trade the item for the amount shown on the front.
I think npc would need to use a setarray. Depending on the item it would trade for the item I want. 7179. The problem is that for npc to work it would trade 5 items 9002 for 1 7179. 5 items 9027 for 3 7179.

and I do not know how I should make it work.

5 - 9002 -> 1: 7179
5 - 9027 -> 3: 7179
5 - 9010 -> 5: 7179
1 - 9024 -> 7: 7179
1 - 9024 -> 7: 7179

could anyone give me a light on it?

Thank you.

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

Something like this?. just refine it on your own. its a rush work.
PS. i also think that Euphy Quest Shop will do the trick

prontera,155,179,3	script	YUMI	94,{

for(.@i=0;.@i<getarraysize(.Exchange);.@i+=4){
	mes (++.@x)+". "+.Exchange[.@i+1]+"x "+getitemname(.Exchange[.@i])+" = "+.Exchange[.@i+3]+"x "+getitemname(.Exchange[.@i+2]);
	set .@menu$,.@menu$+getitemname(.Exchange[.@i])+":";
}

set .@choice,select(.@menu$)-1;
next;
if(countitem(.Exchange[.@choice*4])<.Exchange[.@choice*4+1]){
	mes "not enough material";
	end;
}
	mes "exchange done";
	delitem .Exchange[.@choice*4],.Exchange[.@choice*4+1];
	getitem .Exchange[.@choice*4+2],.Exchange[.@choice*4+3];
end;

OnInit:
	//<arg 1: Material;>, <arg 2: Material Amount;>, <arg 3:Prize;>, <arg 4: Prize amount;>,{Repeat}
	setarray .Exchange[0],909,5,7179,1,
						914,3,7179,5;
end;

}
Edited by Haruka Mayumi
  • Love 1

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