summaryrefslogblamecommitdiff
path: root/npc/functions/banker.txt
blob: 62408cd611d8f6979a5365e208effaa9181f7513 (plain) (tree)
1
2
3
4
5
6
7
8


                                 
                                                   



                                     



                                              




                                                      

                      
                                           
                                 
                                                 
                       




                                                       

                      
                                 
                                                 




                                              
                                   










                                                                      
        



                                                     
 
//

function	script	Banker	{
	if (BankAccount > 0) callsub S_MoveAccount;
	mes "[" + @npcName$ + "]";
	mes "\"Welcome to the bank!";
	mes "How can I help you?\"";
	next;
	menu	"Deposit", L_Dep,
		"Withdraw", L_With,
		"Check my balance", L_Balance,
		"Nevermind", L_Nev;
	
L_Dep:
	mes "[" + @npcName$ + "]";
	mes "\"How much would you like to deposit?\"";
	next;
	input @Amount;
	
	if (zeny < @Amount) goto L_NoMoney;
	set zeny, zeny - @Amount;
	set #BankAccount, #BankAccount + @Amount;
	goto L_Balance;
	
L_With:
	mes "[" + @npcName$ + "]";
	mes "\"How much would you like to withdraw?\"";
	next;
	input @Amount;
	
	set zeny, zeny + @Amount;
	set #BankAccount, #BankAccount - @Amount;
	goto L_Balance;
	
L_Balance:
	mes "[" + @npcName$ + "]";
	mes "\"Your current bank balance is:";
	mes #BankAccount + " GP\"";
	return;
	
L_Nev:
	mes "[" + @npcName$ + "]";
	mes "\"Goodbye then.\"";
	return;
	
L_NoMoney:
	mes "[" + @npcName$ + "]";
	mes "\"Oh dear, it seems that you don't have enough money.\"";
	return;
	
S_MoveAccount:
	set #BankAccount, #BankAccount + BankAccount;
	set BankAccount, 0;
	return;
}