im not really into NPC scripting, But try this...
turbo_room,79,86,8 script Badge Exchanger 686,{
if( @ba < 1 || @bb < 1 || @bc < 1){
if(getgmlevel() >= @gml){
mes "Invalid Rate in 'OnInit:'"
mes "Minimum Rate is 1."
close;
}else{
mes "Error Occured: Please report to Administrator.";
close;
}
}
mes "^C45AEC** Badge Exchanger **^000000";
mes "Here is how much 1 BubblyRO Coin is worth:";
mes "^FF0000Bravery Badge^000000: 1 piece";
mes "^0000FFValor Badge^000000: 1 piece";
mes "^706b00War Badge^000000: 1 piece";
next;
switch(select("^FF0000Bravery Badge -> BubblyRO Coins^000000","^0000FFValor Badge -> BubblyRO Coins^000000","^706b00War Badge -> BubblyRO Coins^000000","Nevermind")){
mes "^C45AEC** Badge Exchanger **^000000";
mes "Here is how much BubblyRO Coin is worth:";
case 1:
mes "^C45AEC** Badge Exchanger **^000000";
mes "How many Bravery Badge would you like to give up?";
next;
input @amount;
if (@amount <= 0) goto L_No;
if (countitem(7828) < @amount) goto L_No;
delitem 7728,@amount;
getitem 30091,@ba * @amount;
goto L_Thanks;
break;
case 2:
next;
mes "^99CCCCBubblyRO Coin^000000: 15 Skulls";
next;
mes "^C45AEC** Poi-Poi **^000000";
mes "How many skulls would you like to give up?";
input @amount;
if (@amount <= 0) goto L_No;
if (countitem(30110) < @amount) goto L_No;
delitem 30110,@amount;
getitem 30091,@bb * @amount;
goto L_Thanks;
break;
case 3:
next;
mes "^99CCCCBubblyRO Coin^000000: 5 War Badges";
next;
mes "^C45AEC** Badge Exchanger **^000000";
mes "How many war badges would you like to give up?";
input @amount;
if (@amount <= 0) goto L_No;
if (countitem(7773) < @amount) goto L_No;
delitem 7773,@amount;
getitem 30091,@bc * @amount;
goto L_Thanks;
break;
case 4:
close;
break;
}
L_Thanks:
mes "^C45AEC** Badge Exchanger **^000000";
mes "Pleasure doing business with you.";
close2;
cutin "", 255;
close;
L_No:
next;
mes "^C45AEC** Badge Exchanger **^000000";
mes "Okay~ Bye!";
close2;
cutin "", 255;
close;
OnInit:
waitingroom "Exchange your badges here...",0;
set @gml,98;
// exchange rate in piece(s)
set .@ba,1;
set .@bb,1;
set .@bc,1;
end;
}