Jump to content
  • 0

Question

Posted

I would like to limit only the maximum deposit when using the Bank Agent i could not find any related to this so i decided to post it up here is the raw script.

//===== rAthena Script ======================================= 
//= Banker Script 
//===== By: ================================================== 
//= Syrus22 (1.0)
//===== Current Version: ===================================== 
//= 2.0
//===== Compatible With: ===================================== 
//= rAthena Project
//===== Description: ========================================= 
//= An account wide Banker to store Zeny
//===== Additional Comments: ================================= 
//= Syrus22 - There's an optional transaction fee at the top of
//= the script. To use it simply change the first set command
//= to set the cost variable to whatever you want the fee to be.
//= Version 2.0: Optimized and brought the script up to standard. [Jguy]
//============================================================ 

prontera,132,217,5	script	Banker	109,{
	set @cost,500;
	mes "[Banker]";
	mes "Welcome to the First Bank of Prontera. How can I help you today?";
	next;
	switch(select("I'd like to make a deposit.:I'd like to make a withdrawal.:What's my current balance?:Cancel")) {
	case 1:
		mes "[Banker]";
		mes "Very well... How much would you like to deposit? The maximum you can deposit at once is 999,999 Zeny.";
		next;
		if (@cost > 0) {
			mes "[Banker]";
			mes "Oh, and do realize there is a " +@cost + " Zeny charge on all transactions!";
			next;
		}
		input @deposit;
		if (@deposit < 1) {
			mes "Make sure you ask me to deposit a real amount.";
			close;
		}
		else if (@deposit > Zeny) {
			mes "It does not appear like you have the amount of zeny you're trying to deposit!";
			close;
		}
		else if (@deposit > (Zeny - @cost)) {
			mes "You need " + @cost + " Zeny to cover the transaction fee!";
			close;
		}
		else {
			set Zeny,Zeny - @deposit;
			set Zeny,Zeny - @cost;
			set #bankstorage,#bankstorage + @deposit;
			mes "[Banker]";
			mes "Thank you very much... Your zeny is in good hands.";
			close;
		}
	case 2:
		mes "[Banker]";
		mes "Very well... How much would you like to withdraw? The maximum you can withdraw at one time is 999,999 Zeny";
		next;
		if (@cost > 0) {
			mes "[Banker]";
			mes "Oh, and do realize there is a " +@cost + " Zeny charge on all transactions!";
			next;
		}
		input @withdrawl;
		if (@withdrawl < 1) {
			mes "Please don't play games. I need a real amount to withdraw.";
			close;
		}
		else if (@withdrawl > #bankstorage) {
			mes "You only have ^00FF00" + callfunc("F_InsertComma",#bankstorage) +"^000000 zeny in your account!";
			close;
		}
		else if ((@cost > Zeny) && ((Zeny + @withdrawl) > @cost)) {
			mes "[Banker]";
			mes "You don't have the Zeny for the transaction fee right now. Would you like me to take the fee directly from your withdrawal?";
			next;
			switch(select("Yes please.:No, Thanks")){
			case 1:
				mes "[Banker]";
				mes "Removing " + @cost + " from your withdrawal to cover the deposit fee...";
				set @withdrawl,@withdrawl - @cost;
				set #bankstorage,#bankstorage - @cost;
				set @cost,0;
				next;
				set Zeny,Zeny - @cost;
				set Zeny,Zeny + @withdrawl;
				set #bankstorage,#bankstorage - @withdrawl;
				mes "[Banker]";
				mes "There's your Zeny. Have a good day.";
				close;
			case 2:
				mes "[Banker]";
				mes "Very well... come again soon.";
				close;
			}
		}
		else {
			set Zeny,Zeny - @cost;
			set Zeny,Zeny + @withdrawl;
			set #bankstorage,#bankstorage - @withdrawl;
			mes "[Banker]";
			mes "There's your Zeny. Have a good day.";
			close;
		}
	case 3:
		mes "[Banker]";
		mes "Hmmmm... let me check some paper work.";
		next;
		mes "*Rustle, Rustle*";
		next;
		mes "[Banker]";
		mes "You currently have " + callfunc("F_InsertComma",#bankstorage) + " Zeny in your account.";
		close;
	case 4:
		mes "[Banker]";
		mes "Very well... come again soon.";
		close;
	}
}

 

1 answer to this question

Recommended Posts

  • 1
Posted
//===== rAthena Script ======================================= 
//= Banker Script 
//===== By: ================================================== 
//= Syrus22 (1.0)
//===== Current Version: ===================================== 
//= 2.0
//===== Compatible With: ===================================== 
//= rAthena Project
//===== Description: ========================================= 
//= An account wide Banker to store Zeny
//===== Additional Comments: ================================= 
//= Syrus22 - There's an optional transaction fee at the top of
//= the script. To use it simply change the first set command
//= to set the cost variable to whatever you want the fee to be.
//= Version 2.0: Optimized and brought the script up to standard. [Jguy]
//============================================================ 

verus04,174,216,5	script	Banker	109,{
//prontera,132,217,5	script	Banker	109,{
	mes "[Banker]";
	mes "Welcome to the First Bank of Prontera. How can I help you today?";
	next;
	switch(select("I'd like to make a deposit.:I'd like to make a withdrawal.:What's my current balance?:Cancel")) {
	case 1:
		mes "[Banker]";
		mes "Very well... How much would you like to deposit? The maximum you can deposit at once is ^00FF00999,999^000000 zeny.";
		next;
		if (.transactionFee > 0) {
			mes "[Banker]";
			mes "Oh, and do realize there is a ^00FF00" + .transactionFee + "^000000 zeny charge on all transactions!";
			next;
		}

		input(.@deposit);
		if (.@deposit < 1) {
            mes "[Banker]";
			mes "Make sure you ask me to deposit a real amount.";
			close;
		}
		
        if (.@deposit > Zeny) {
            mes "[Banker]";
			mes "It does not appear like you have the amount of zeny you're trying to deposit!";
			close;
		}
		
        if (.@deposit + .transactionFee > Zeny) {
            mes "[Banker]";
			mes "You need ^00FF00" +.transactionFee + "^000000 Zeny to cover the transaction fee!";
			close;
		}
        
        if(#bankstorage + .@deposit > .maxDeposit) {
            mes "[Banker]";
			mes "Your deposit would break the limit of ^00FF00" + .maxDeposit + "^000000 zeny!";
			close;
        }

        Zeny -= .@deposit + .transactionFee;
        #bankstorage += .@deposit;
        mes "[Banker]";
        mes "Thank you very much... Your zeny is in good hands.";
        close;
	case 2:
		mes "[Banker]";
		mes "Very well... How much would you like to withdraw? The maximum you can withdraw at one time is ^00FF00999,999^000000 zeny";
		next;
		if (.transactionFee > 0) {
			mes "[Banker]";
			mes "Oh, and do realize there is a ^00FF00" + .transactionFee + "^000000 zeny charge on all transactions!";
			next;
		}
		input(.@withdrawal);
		if (.@withdrawal < 1) {
			mes "Please don't play games. I need a real amount to withdraw.";
			close;
		}
		
        if (.@withdrawal > #bankstorage) {
			mes "You only have ^00FF00" + callfunc("F_InsertComma", #bankstorage) +"^000000 zeny in your account!";
			close;
		}
		
        if (.transactionFee > Zeny && .@withdrawal > .transactionFee) {
			mes "[Banker]";
			mes "You don't have the Zeny for the transaction fee right now. Would you like me to take the fee directly from your withdrawal?";
			next;
			switch(select("Yes please.:No, Thanks")) {
                case 1:
                    mes "[Banker]";
                    mes "Removing ^00FF00" + .transactionFee + "^000000 from your withdrawal to cover the deposit fee...";
                    .@withdrawal -= .transactionFee;
                    #bankstorage -= .transactionFee;
                    next;
                    #bankstorage -= .@withdrawal;
                    Zeny += .@withdrawal;
                    mes "[Banker]";
                    mes "There's your Zeny. Have a good day.";
                    close;
                case 2:
                    mes "[Banker]";
                    mes "Very well... come again soon.";
                    close;
		    }
        }

        if(.transactionFee > Zeny) {
			mes "[Banker]";
			mes "You need ^00FF00" + .transactionFee + "^000000 zeny to cover the transaction fee!";
			close;
		}

        #bankstorage -= .@withdrawal;
        Zeny -= .transactionFee;
        Zeny += .@withdrawal;
        mes "[Banker]";
        mes "There's your zeny. Have a good day.";
        close;
	case 3:
		mes "[Banker]";
		mes "Hmmmm... let me check some paper work.";
		next;
		mes "*Rustle, Rustle*";
		next;
		mes "[Banker]";
		mes "You currently have ^00FF00" + callfunc("F_InsertComma", #bankstorage) + "^000000 zeny in your account.";
		close;
	case 4:
		mes "[Banker]";
		mes "Very well... come again soon.";
		close;
	}

    OnInit:
        .transactionFee = 500;
        .maxDeposit = 1000000;
}

 

  • Upvote 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...