Untested (because I'm at work)
prontera,158,173,4 script Coin Exchanger 88,{
mes .npc$;
mes "What would you like to do?";
switch(select("Info:Trade for Coin")) {
case 1: // Get Info
next;
mes .npc$;
for (set .@a, 0; .@a < getarraysize(.coin_id); set .@a, .@a + 1) {
mes "1 " + getitename(.coin_id[.@a]) + " = " + .coin_trade_amount[.@a] + " " + getitemname(.coin_trade_coin[.@a]) + "s";
}
close;
case 2: // Trade Coin
next;
mes "Please select which coin you would like...";
// Build Menu
for (set .@a, 0; .@a < getarraysize(.coin_id); set .@a, .@a + 1) {
set .@menu$, .@menu$ + (.@menu$ == "" ? "" : ":") + getitemname(.coin_id[.@a]);
}
set .@coin_choice, select(.@menu$) - 1;
if (countitem(.coin_trade_coin[.@coin_choice]) < .coin_trade_amount[.@coin_choice]) {
mes "You do not have enough items...";
close;
}
mes "Ok! Let me do a little magic...";
next;
mes "and.... Here you go...";
delitem .coin_trade_coin[.@coin_choice], .coin_trade_amount[.@coin_choice];
getitem .coin_id[.@coin_choice], 1;
mes "Enjoy!";
close;
}
OnInit:
set .npc$, "[Coin Exchanger]";
setarray .coin_id[0],silver,gold,plat,mithril;
setarray .coin_trade_amount[0],5,4,3,2;
setarray .coin_trade_coin[0],bronze,silver,gold,plat;
end;
}