- script CashExchange 478,{
mes "[ ^336699Cash Exchanger^000000 ]";
mes "Exchange Cash Coint -> Cash Point";
mes "And Cashpoint -> Cash Coin";
next;
menu
"- Cash Point-> Cash Coin",L_Cash,
"- Cash Coin -> Cash Point",L_CashCoin,
"- Nothing",L_No;
L_Cash:
mes "[ ^336699Cash Exchanger^000000 ]";
mes "You have Cash points ^ff0000"+#CASHPOINTS+"^000000 p.";
mes "Cash Coin 2ea : 1 Cash Point";
mes "How many do you want to exchange?";
set @camount,0;
input @camount;
if (@camount < 0) goto L_NoCash;
if (#cashpoints < @camount) goto L_NoCash;
set #cashpoints,(#cashpoints - (1* @camount));
getitem 29130,2*@camount;
dispbottom "Now you have Cash points "+#CASHPOINTS+" p.";
close;
L_NoCash:
mes "[ ^336699Cash Exchanger^000000 ]";
mes "^336699=================^000000";
mes "You have ^ff0000Cash Point^000000 not enough.";
close;
L_CashCoin:
mes "[ ^336699Cash Exchanger^000000 ]";
mes "Now You have Cash points ^ff0000"+#CASHPOINTS+"^000000 p.";
mes "1 Cash Point = Cash Coin 2ea";
mes "How many do you want to exchange?";
set @pamount,0;
input @pamount;
if (@pamount < 0) goto L_NoCashCoin;
if (countitem(29130) < 2*@pamount) goto L_NoCashCoin;
set #cashpoints,(#cashpoints + (1* @pamount));
delitem 29130,2*@pamount;
dispbottom "Now You have Cash points "+#CASHPOINTS+" p.";
close;
L_NoCashCoin:
mes "^336699=================^000000";
mes "You have ^ff0000Cash Coin^000000 not enough.";
close;
L_No:
mes "[ ^336699Server Exchanger^000000 ]";
mes "Bye";
close;
OnInit:
waitingroom "Cash Exchange",0;
end;
}