Jump to content
  • 0

npc that exchanges multiple items for an item


Tassadar

Question


  • Group:  Members
  • Topic Count:  52
  • Topics Per Day:  0.02
  • Content Count:  107
  • Reputation:   5
  • Joined:  07/21/16
  • Last Seen:  

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.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  52
  • Topics Per Day:  0.02
  • Content Count:  107
  • Reputation:   5
  • Joined:  07/21/16
  • Last Seen:  

Tks Haruka Mayumi you helped me a lot. Thank you so.

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