Hi, Help! I want my Coin in inventory can sell to NPC that has a limit to sell for everyday maximum limit is 10 . Please Help
prontera,170,160,2 script Zeny Coin Trader 109,{
if ( #coin_exchange_limit && #coin_exchange_limit < .today_date && #coin_exchange_limit > .daily_max ) {
}
mes "Zeny Coin Trader";
mes "Hi " + strcharinfo(0) + ", nice to meet you )";
next;
mes "Zeny Coin Trader";
mes ".";
mes "I can BUY and SELL";
mes "Lucent Official Coin";
next;
mes "Zeny Coin Trader";
mes "I can Only buy or sell coins";
mes "for Maximum of 10";
next;
while( 1 ) {
switch( select("I want to SELL Lucent Official Coin:I want to BUY Lucent Official Coin") ) {
case 1:
mes "Zeny Coin Trader";
mes "Are you Sure, Your going to sell your coins?";
switch(select("Yes! I have a lot of Coins!")) {
mes "Ok Here You go";
Case 1:
next;
if ( !countitem(674) ) {
mes "Zeny Coin Trader";
mes "I can buy that for 1,000,000 Zeny.";
mes "Tell me How Many Lucent Coin You will SELL?.";
next;
mes "You didnt have Lucent Official Coin.";
}else{
mes "You have "+countitem(674)+" Lucent Official Coin.";
input @Amount,0,countitem(674);
next;
if ( !@Amount || (( .Rates * @Amount ) + Zeny ) > 1000000000 ) {
mes "You didnt have Lucent Official Coin.";
}
else {
delitem 674,@Amount;
mes "Converted "+@Amount+" of Lucent Official Coin into Zeny.";
mes "Gained Total of "+( .Rates * @Amount )+" of Zeny.";
set Zeny,Zeny + ( .Rates * @Amount );
}
}
}
next;
close;
case 2:
if ( .daily_max && #coin_exchange_limit >= .daily_max ) {
mes "You cant exchange anymore for today.";
}
else if ( Zeny < .Rate ) {
mes "You didnt have enough Zeny.";
}
else {
mes "You have "+Zeny+" Zeny.";
mes "How many Lucent Official Coin you want ?";
set .@max,( Zeny / .Rate );
if ( .daily_max )
if ( .@max > ( .daily_max - #coin_exchange_limit ) )
mes "You can get maximum of "+( Zeny / .Rate )+" Lucent Official Coin.";
input @Amount,0,.@max;
if ( !@Amount ) {
mes "Deal Cancelled.";
}
else {
set Zeny,Zeny - ( @Amount * .Rate );
mes "Converted "+( @Amount * .Rate )+" Zeny into "+@Amount+" Lucent Official Coin.";
getitem 674,@Amount;
set #coin_exchange_limit,#coin_exchange_limit + @Amount;
}
}
next;
break;
}
}
close;
OnInit:
// 1 Lucent Official Coin = How Many Zeny ?
set .daily_max,10;
set .Rates,1000000;
set .Rate,1500000;
OnClock0000:
set .today_date,atoi( gettimestr( "%Y%m%d",10 ) );
end;
}
|
Btw. Thanks To Emistry. For Helping 10 limit on Buying Coin , Now. I want to make a limit on Selling Coin SORRY BAD ENGLISH--