Jump to content
gyroguevarra

R> Cash points exchanger to pods

Recommended Posts

prontera,156,170,5	script	Cash Exchanger	439,{

// Pods Item ID and each Pods Costs
setarray .Pods[1],7179;
setarray .Cash[1],2000;

set @Menu$,"";
for( set [email protected],1; [email protected] < getarraysize( .Pods ); set [email protected],[email protected]+1 ){
	set @Menu$,@Menu$ + getitemname( .Pods[[email protected]] )+":";
	}
while( 1 ){
	mes "What do you want to do today?";
	next;
	switch( select( "Pod(s) to Cash:Cash to Pod(s)" ) ){
	Case 1:
			mes "Very well. Here is the list on how much each Pod is worth:";
			for( set [email protected],1; [email protected] < getarraysize( .Pods ); set [email protected],[email protected]+1 ){
				mes "^0000FF"+getitemname( .Pods[[email protected]] )+" ^FF0000"+.Cash[[email protected]]+"^000000 Cash Points.";
				}
			next;
			set [email protected],select( @Menu$ );
			mes "Select the Amount of Pod you want to trade into Cash Points.";
			mes "You have "+countitem( .Pods[[email protected]] )+" "+getitemname( .Pods[[email protected]] )+".";
			input @Amount,0,countitem( .Pods[[email protected]] );
			if( @Amount < 1 ){
			mes "You cancelled.";
			}else{
			set #CASHPOINTS,#CASHPOINTS + ( @Amount * .Cash[[email protected]] );
			delitem .Pods[[email protected]],@Amount;
			mes "Done, you have traded "[email protected]+" "+getitemname(.Pods[[email protected]])+" into "+( @Amount * .Cash[[email protected]] )+" Cash Points.";
			}
			dispbottom "Total Cash Points: "+#CASHPOINTS;
			close;
			break;
	Case 2:
			mes "Very well. Here is the list on how much each Pod is worth:";
			for( set [email protected],1; [email protected] < getarraysize( .Pods ); set [email protected],[email protected]+1 ){
				mes "^0000FF"+getitemname( .Pods[[email protected]] )+" ^FF0000"+.Cash[[email protected]]+"^000000 Cash Points.";
				}
			next;
			set [email protected],select( @Menu$ );
			mes "Select the Amount of Cash Points you want to trade into "+getitemname( .Pods[[email protected]] )+".";
			mes "You can get maximum of "+#CASHPOINTS/.Cash[[email protected]]+" "+getitemname( .Pods[[email protected]] )+".";
			input @Amount,0,#CASHPOINTS/.Cash[[email protected]];
			if( @Amount < 1 ){
			mes "You cancelled.";
			}else{
			set #CASHPOINTS,#CASHPOINTS - ( @Amount * .Cash[[email protected]] );
			getitem .Pods[[email protected]],@Amount;
			mes "Done, you have traded "+( @Amount * .Cash[[email protected]] )+" Cash Points into "[email protected]+" of "+getitemname(.Pods[[email protected]])+" .";
			}
			dispbottom "Total Cash Points: "+#CASHPOINTS;
			close;
			break;
		}
	}
close;
}

Emistry's Original Script From http://rathena.org/board/topic/70305-cash-exhchange-to-coin/#entry152495

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
Reply to this topic...

×   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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.