Jump to content
  • 0

How do i change the exchange ratio?


Zxcv

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  11/26/16
  • Last Seen:  

Now it accept 1 coin for 1 Rok Ppoint


/***
 ** Script Request (Cash Trader NPC)
 ** Link: http://rathena.org/board/topic/57101-request-cash-trader/
 ** By Slim
 ***/


prt_in,34,116,4    script    RoK Point Trader    894,{

//,677
set .@coinid,671;
mes "[^0000FFCash Trader^000000]";
mes "Hi ^ff8800"+strcharinfo(0)+"^000000,";
mes "What can i do for you?";
mes "The Exchange ratio is 10:1";
mes "Your RoK Point: [^ff0000"+#ROK_POINTS+"^000000]";
switch(select("Cancel:Chaos coins to RoK points:RoK points to Chaos coins"))
{

case 1: break;
case 2:
next;
mes "[^0000FFCash Trader^000000]";
mes "Please input the amount of coins that you want to exchange.";
mes "Note: Put ^0000ff0^000000 to exit.";

L_inpcoin:
input @hcoins;
set @hhcoins,@hcoins;
if(@hhcoins == 0) { break; }
if(countitem(.@coinid) < @hhcoins) { mes "* ^ff0000Please input a valid amount^000000"; mes "(Put ^0000ff0^000000 to exit)."; goto L_inpcoin; }
next;
delitem .@coinid,@hhcoins;
set #ROK_POINTS,#ROK_POINTS+@hhcoins;
mes "[^0000FFCash Trader^000000]";
mes "You've exchanged (^ff0000"+@hhcoins+"^000000) "+getitemname(.@coinid)+"(s). Total RoK Points: [^0000ff"+#ROK_POINTS+"^000000]";
dispbottom "[Cash Trader] You've exchanged ("+@hhcoins+") "+getitemname(.@coinid)+"(s). Total RoK Points: ["+#ROK_POINTS+"]";
break;
case 3:
next;
mes "[^0000FFCash Trader^000000]";
mes "Please input the amount of RoK that you want to exchange.";
mes "Note: Put ^0000ff0^000000 to exit.";

L_inpcash:
input @hcash;
set @hhcash,@hcash;
if(@hhcash == 0) { break; }
if(#ROK_POINTS < @hhcash) { mes "* ^ff0000Please input a valid amount^000000"; mes "(Put ^0000ff0^000000 to exit)."; goto L_inpcash; }

//I know they weight 0 but just in case you change its weight
if (!checkweight(.@coinid,@hhcash)) { mes "* ^ff0000You're overweight please store some items.^000000"; dispbottom "[Cash Trader] You're overweight please store some items."; break; }
next;
set #ROK_POINTS,#ROK_POINTS - @hhcash;
getitem .@coinid,@hhcash;
mes "[^0000FFCash Trader^000000]";
mes "You've exchanged (^ff0000"+@hhcash+"^000000) RoK Points to "+getitemname(.@coinid)+"(s). Total RoK Points: [^0000ff"+#ROK_POINTS+"^000000]";
dispbottom "[Cash Trader] You've exchanged ("+@hhcash+") RoK Points to "+getitemname(.@coinid)+"(s). Total RoK Points: ["+#ROK_POINTS+"]";
break;a
}

close;

OnInit:
    waitingroom "RoK Exchanger",0;
    end;

}

 

Edited by Emistry
Please use CODEBOX.
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  191
  • Reputation:   24
  • Joined:  07/19/14
  • Last Seen:  

@Zxcv try to add amount or value here 

set @hhcoins,@hcoins;
Link to comment
Share on other sites

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.

×
×
  • Create New...