OSDN Git Service

First version
[st-ro/stro.git] / npc / custom / etc / bank.txt
1 //===== rAthena Script ======================================= 
2 //= Banker Script 
3 //===== By: ================================================== 
4 //= Syrus22 (1.0)
5 //===== Current Version: ===================================== 
6 //= 2.0
7 //===== Compatible With: ===================================== 
8 //= rAthena Project
9 //===== Description: ========================================= 
10 //= An account wide Banker to store Zeny
11 //===== Additional Comments: ================================= 
12 //= Syrus22 - There's an optional transaction fee at the top of
13 //= the script. To use it simply change the first set command
14 //= to set the cost variable to whatever you want the fee to be.
15 //= Version 2.0: Optimized and brought the script up to standard. [Jguy]
16 //============================================================ 
17
18 prontera,132,217,5      script  Banker  109,{
19         set @cost,500;
20         mes "[Banker]";
21         mes "Welcome to the First Bank of Prontera. How can I help you today?";
22         next;
23         switch(select("I'd like to make a deposit.:I'd like to make a withdrawl.:What's my current balance?:Cancel")) {
24         case 1:
25                 mes "[Banker]";
26                 mes "Very well... How much would you like to deposit? The maximum you can deposit at once is 999,999 Zeny.";
27                 next;
28                 if (@cost > 0) {
29                         mes "[Banker]";
30                         mes "Oh, and do realize there is a " +@cost + " Zeny charge on all transactions!";
31                         next;
32                 }
33                 input @deposit;
34                 if (@deposit < 1) {
35                         mes "Make sure you ask me to deposit a real amount.";
36                         close;
37                 }
38                 else if (@deposit > Zeny) {
39                         mes "It does not appear like you have the amount of zeny you're trying to deposit!";
40                         close;
41                 }
42                 else if (@deposit > (Zeny - @cost)) {
43                         mes "You need " + @cost + " Zeny to cover the transaction fee!";
44                         close;
45                 }
46                 else {
47                         set Zeny,Zeny - @deposit;
48                         set Zeny,Zeny - @cost;
49                         set #bankstorage,#bankstorage + @deposit;
50                         mes "[Banker]";
51                         mes "Thank you very much... Your zeny is in good hands.";
52                         close;
53                 }
54         case 2:
55                 mes "[Banker]";
56                 mes "Very well... How much would you like to withdraw? The maximum you can withdraw at one time is 999,999 Zeny";
57                 next;
58                 if (@cost > 0) {
59                         mes "[Banker]";
60                         mes "Oh, and do realize there is a " +@cost + " Zeny charge on all transactions!";
61                         next;
62                 }
63                 input @withdrawl;
64                 if (@withdrawl < 1) {
65                         mes "Please don't play games. I need a real amount to withdraw.";
66                         close;
67                 }
68                 else if (@withdrawl > #bankstorage) {
69                         mes "You only have ^00FF00" + callfunc("F_InsertComma",#bankstorage) +"^000000 zeny in your account!";
70                         close;
71                 }
72                 else if ((@cost > Zeny) && ((Zeny + @withdrawl) > @cost)) {
73                         mes "[Banker]";
74                         mes "You don't have the Zeny for the transaction fee right now. Would you like me to take the fee directly from your withdrawl?";
75                         next;
76                         switch(select("Yes please.:No, Thanks")){
77                         case 1:
78                                 mes "[Banker]";
79                                 mes "Removing " + @cost + " from your withdrawl to cover the deposit fee...";
80                                 set @withdrawl,@withdrawl - @cost;
81                                 set #bankstorage,#bankstorage - @cost;
82                                 set @cost,0;
83                                 next;
84                                 set Zeny,Zeny - @cost;
85                                 set Zeny,Zeny + @withdrawl;
86                                 set #bankstorage,#bankstorage - @withdrawl;
87                                 mes "[Banker]";
88                                 mes "There's your Zeny. Have a good day.";
89                                 close;
90                         case 2:
91                                 mes "[Banker]";
92                                 mes "Very well... come again soon.";
93                                 close;
94                         }
95                 }
96                 else {
97                         set Zeny,Zeny - @cost;
98                         set Zeny,Zeny + @withdrawl;
99                         set #bankstorage,#bankstorage - @withdrawl;
100                         mes "[Banker]";
101                         mes "There's your Zeny. Have a good day.";
102                         close;
103                 }
104         case 3:
105                 mes "[Banker]";
106                 mes "Hmmmm... let me check some paper work.";
107                 next;
108                 mes "*Rustle, Rustle*";
109                 next;
110                 mes "[Banker]";
111                 mes "You currently have " + callfunc("F_InsertComma",#bankstorage) + " Zeny in your account.";
112                 close;
113         case 4:
114                 mes "[Banker]";
115                 mes "Very well... come again soon.";
116                 close;
117         }
118 }