Jump to content
  • 0

Item to specific item exchanger


Question

Posted

Hi i would like to request a npc that can exchange an item to another item with specific amount, for example 
- 250 GC = Old Blue Box 
- 500 GC = Box of 10 Oridecon or Box of 10 Elunium 
- 750 GC= Old Purple Box and 2,500 GC = Old Card Album

hopefully someone can make this

thank you in advance.

20 answers to this question

Recommended Posts

  • 0
Posted
3 hours ago, Hijirikawa said:

You can just use Euphy's Quest shop and add those items with required item as GC.

thank you for that but i don't need a quest npc just a normal npc that can exchange those items with GC

  • 0
Posted (edited)
1 hour ago, Quesooo said:

thank you for that but i don't need a quest npc just a normal npc that can exchange those items with GC

 

5 Minutes scripting....

Untested tho:

prontera,150,180,4	script	GC Exchanger	100,{

mes .n$;
mes "I can exchange your "+getitemname(.exc_id)+"s for other items.";
mes "Please select from the list what you want.";
mes "( ) = Price per Exchange";
next;
for ( set .@m,0; .@m < getarraysize(.item); set .@m,.@m + 1)
	set .@g_menu$,.@g_menu$ + "- "+getitemname(.item[.@m])+" ("+.cost[.@m]+")" + ( (.item[.@m+1] != 0)?":":"");
set .@g,select(.@g_menu$) - 1;
mes .n$;
mes "You have chosen "+getitemname(.item[.@g])+" for the price of "+.cost[.@m]+" "+getitemname(.exc_id)+"s".";
mes "Is that correct?";
if(select("- Yes:- No") - 1) close;
next;
mes .n$;
if(countitem(.exc_id) < .cost[.@g]) {
	mes "I'm sorry, but you don't have enough "+getitemname(.exc_id)+", please come back when you have enough.";
	close;
}
getitem .item[.@g],1;
delitem .exc_id,.cost[.@g];
mes "Exchange complete.";
close;

OnInit:
set .n$,"["+strnpcinfo(0)+"]";
//= Items: Old Blue Box, Oridecon Box (10pcs), Elunium Box (10pcs), Old Purple Box, Old Card Album
setarray .item[0],603,13890,13889,618,616;
setarray .cost[0],250,500,500,750,2500;
set .exc_id,7517; // Gold Coin
end;
}
Edited by llchrisll
  • Love 1
  • 0
Posted (edited)
-	itemshop	-1,7517,603:250,13890:500,13889:500,618:750,616:2500

Utilizes the itemshop and does the same thing that you want it to do, exchange gold coins for certain items.

Edited by Hijirikawa
  • 0
Posted
3 hours ago, llchrisll said:

 

5 Minutes scripting....

Untested tho:


prontera,150,180,4	script	GC Exchanger	100,{

mes .n$;
mes "I can exchange your "+getitemname(.exc_id)+"s for other items.";
mes "Please select from the list what you want.";
mes "( ) = Price per Exchange";
next;
for ( set .@m,0; .@m < getarraysize(.item); set .@m,.@m + 1)
	set .@g_menu$,.@g_menu$ + "- "+getitemname(.item[.@m])+" ("+.cost[.@m]+")" + ( (.item[.@m+1] != 0)?":":"");
set .@g,select(.@g_menu$) - 1;
mes .n$;
mes "You have chosen "+getitemname(.item[.@g])+" for the price of "+.cost[.@m]+" "+getitemname(.exc_id)+"s".";
mes "Is that correct?";
if(select("- Yes:- No") - 1) close;
next;
mes .n$;
if(countitem(.exc_id) < .cost[.@g]) {
	mes "I'm sorry, but you don't have enough "+getitemname(.exc_id)+", please come back when you have enough.";
	close;
}
getitem .item[.@g],1;
delitem .exc_id,.cost[.@g];
mes "Exchange complete.";
close;

OnInit:
set .n$,"["+strnpcinfo(0)+"]";
//= Items: Old Blue Box, Oridecon Box (10pcs), Elunium Box (10pcs), Old Purple Box, Old Card Album
setarray .item[0],603,13890,13889,618,616;
setarray .cost[0],250,500,500,750,2500;
set .exc_id,7517; // Gold Coin
end;
}

Thank you  so much for this.

i got an error

 

image.png.e938bb22396300c642dcac0ef53c8ea0.png

  • 0
Posted
mes "You have chosen "+getitemname(.item[.@g])+" for the price of "+.cost[.@m]+" "+getitemname(.exc_id)+"s".";

to

mes "You have chosen "+getitemname(.item[.@g])+" for the price of "+.cost[.@m]+" "+getitemname(.exc_id)+"s.";

 

  • Love 1
  • 0
Posted
8 minutes ago, Hijirikawa said:

mes "You have chosen "+getitemname(.item[.@g])+" for the price of "+.cost[.@m]+" "+getitemname(.exc_id)+"s".";

to


mes "You have chosen "+getitemname(.item[.@g])+" for the price of "+.cost[.@m]+" "+getitemname(.exc_id)+"s.";

 

Thank you for this. the npc is now showing but i got an error again

image.png.26c856a082296609a00877b03f6e688c.png

  • 0
Posted
prontera,150,180,4	script	GC Exchanger	100,{

mes .n$;
mes "I can exchange your "+getitemname(.exc_id)+"s for other items.";
mes "Please select from the list what you want.";
mes "( ) = Price per Exchange";
next;
for ( set .@m,0; .@m < getarraysize(.item); set .@m,.@m + 1)
	set .@g_menu$,.@g_menu$ + "- "+getitemname(.item[.@m])+" ("+.cost[.@m]+")" + ( (.item[.@m+1] != 0)?":":"");
set .@g,select(.@g_menu$) - 1;
mes .n$;
mes "You have chosen "+getitemname(.item[.@g])+" for the price of "+.cost[.@m]+" "+getitemname(.exc_id)+"s.";
mes "Is that correct?";
if(select("- Yes:- No") - 1) close;
next;
mes .n$;
if(countitem(.exc_id) < .cost[.@g]) {
	mes "I'm sorry, but you don't have enough "+getitemname(.exc_id)+", please come back when you have enough.";
	close;
}
getitem .item[.@g],1;
delitem .exc_id,.cost[.@g];
mes "Exchange complete.";
close;

OnInit:
set .n$,"["+strnpcinfo(0)+"]";
//= Items: Old Blue Box, Oridecon Box (10pcs), Elunium Box (10pcs), Old Purple Box, Old Card Album
setarray .item[0],603,13890,13889,618,616;
setarray .cost[0],250,500,500,750,2500;
set .exc_id,7517; // Gold Coin
end;
}

 

  • MVP 1
  • 0
Posted
4 minutes ago, Hijirikawa said:

prontera,150,180,4	script	GC Exchanger	100,{

mes .n$;
mes "I can exchange your "+getitemname(.exc_id)+"s for other items.";
mes "Please select from the list what you want.";
mes "( ) = Price per Exchange";
next;
for ( set .@m,0; .@m < getarraysize(.item); set .@m,.@m + 1)
	set .@g_menu$,.@g_menu$ + "- "+getitemname(.item[.@m])+" ("+.cost[.@m]+")" + ( (.item[.@m+1] != 0)?":":"");
set .@g,select(.@g_menu$) - 1;
mes .n$;
mes "You have chosen "+getitemname(.item[.@g])+" for the price of "+.cost[.@m]+" "+getitemname(.exc_id)+"s.";
mes "Is that correct?";
if(select("- Yes:- No") - 1) close;
next;
mes .n$;
if(countitem(.exc_id) < .cost[.@g]) {
	mes "I'm sorry, but you don't have enough "+getitemname(.exc_id)+", please come back when you have enough.";
	close;
}
getitem .item[.@g],1;
delitem .exc_id,.cost[.@g];
mes "Exchange complete.";
close;

OnInit:
set .n$,"["+strnpcinfo(0)+"]";
//= Items: Old Blue Box, Oridecon Box (10pcs), Elunium Box (10pcs), Old Purple Box, Old Card Album
setarray .item[0],603,13890,13889,618,616;
setarray .cost[0],250,500,500,750,2500;
set .exc_id,7517; // Gold Coin
end;
}

 

Thank you so much its working like a charm awesome 

  • 0
Posted

last thing when i talk to npc and exchange the GC to 250 old blue box. the npc didn't show how many GC you have on the first menu and how many GC will be exchange for those OBB

image.png.3a0619ee3dad2952c49a959b226f11a0.png

i have a total of 1000 GC on my bag

  • 0
Posted (edited)
6 minutes ago, Quesooo said:

last thing when i talk to npc and exchange the GC to 250 old blue box. the npc didn't show how many GC you have on the first menu and how many GC will be exchange for those OBB

image.png.3a0619ee3dad2952c49a959b226f11a0.png

i have a total of 1000 GC on my bag

Try this:

prontera,150,180,4	script	Exchanger	4_F_BRZ_WOMAN,{

	mes .n$;
	mes "I can exchange your "+getitemname(.exc_id)+"s for other items.";
	mes "Please select from the list what you want.";
	mes " ";
	mes "Currency: "+ getitemname(.exc_id);
	next;
	for( .@m = 0; .@m < getarraysize(.item); .@m ++ )
		.@g_menu$ = .@g_menu$ + "- "+ getitemname(.item[.@m]) +" ("+ .cost[.@m] +") "+ ( (.item[.@m+1] != 0)?":":"");
		.@g = select(.@g_menu$) - 1;
	mes .n$;
	mes "You have chosen "+ getitemname(.item[.@g]) +" for the price of "+ .cost[.@g] +" "+ getitemname(.exc_id) +"s";
	mes "Is that correct?";
	next;
	if( select("- Yes:- No" ) - 1) close;
		mes .n$;
	if( countitem(.exc_id) < .cost[.@g] ) {
		mes "I'm sorry, but you don't have enough "+getitemname(.exc_id)+", please come back when you have enough.";
		close;
	}
	getitem .item[.@g],1;
	delitem .exc_id,.cost[.@g];
	mes "Exchange complete.";
	close;

OnInit:
	.n$ = "[ "+ strnpcinfo(0) +" ]";
	.exc_id = 501;
	setarray .item[0],603,13890,13889,618,616;
	setarray .cost[0],1,1,1,1,1;
	end;
}

 

Edited by Royr
  • MVP 1
  • 0
Posted
11 minutes ago, Royr said:

Try this:


prontera,150,180,4	script	Exchanger	4_F_BRZ_WOMAN,{

	mes .n$;
	mes "I can exchange your "+getitemname(.exc_id)+"s for other items.";
	mes "Please select from the list what you want.";
	mes " ";
	mes "Currency: "+ getitemname(.exc_id);
	next;
	for( .@m = 0; .@m < getarraysize(.item); .@m ++ )
		.@g_menu$ = .@g_menu$ + "- "+ getitemname(.item[.@m]) +" ("+ .cost[.@m] +") "+ ( (.item[.@m+1] != 0)?":":"");
		.@g = select(.@g_menu$) - 1;
	mes .n$;
	mes "You have chosen "+ getitemname(.item[.@g]) +" for the price of "+ .cost[.@g] +" "+ getitemname(.exc_id) +"s";
	mes "Is that correct?";
	next;
	if( select("- Yes:- No" ) - 1) close;
		mes .n$;
	if( countitem(.exc_id) < .cost[.@g] ) {
		mes "I'm sorry, but you don't have enough "+getitemname(.exc_id)+", please come back when you have enough.";
		close;
	}
	getitem .item[.@g],1;
	delitem .exc_id,.cost[.@g];
	mes "Exchange complete.";
	close;

OnInit:
	.n$ = "[ "+ strnpcinfo(0) +" ]";
	.exc_id = 501;
	setarray .item[0],603,13890,13889,618,616;
	setarray .cost[0],1,1,1,1,1;
	end;
}

 

awesome thank you its working perfectly

  • 0
Posted
21 minutes ago, llchrisll said:

What small typos can cause issues xD. Sorry about that. Was tired also when I quickly wrote it.
Thanks guys for fixing it.
Regards,
Chris

thank you so much too

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