root/npc/custom/banks/bank.txt @ 1

Revision 1, 3.6 kB (checked in by jinshiro, 17 years ago)
Line 
1//===== eAthena Script =======================================
2//= Banker Script
3//===== By: ==================================================
4//= Syrus22 (1.0)
5//===== Current Version: =====================================
6//= 1.0
7//===== Compatible With: =====================================
8//= Any eAthena version with Account variables.
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//============================================================
16prontera,132,217,5      script  Banker  109,{
17set @cost,500;
18mes "[Banker]";
19mes "Welcome to the First Bank of Prontera. How can I help you today?";
20next;
21menu "I'd like to make a deposit.",Ldeposit,"I'd like to make a withdrawl.",Lwithdrawl,"What's my current balance?",Lbalance,"Cancel",Lcancel;
22
23Ldeposit:
24        mes "[Banker]";
25        mes "Very well... How much would you like to deposit? The maximum you can deposit at once is 999,999 Zeny.";
26        next;
27        if (@cost > 0) goto Ldepocost;
28        goto Ldepocont;
29
30        Ldepocost:
31                mes "[Banker]";
32                mes "Oh and don't forget there is a " + @cost + " Zeny charge on all transactions.";
33                next;
34                goto Ldepocont;
35
36Ldepocont:
37        input @deposit;
38        if (@deposit < 1) goto Lrealamount;
39        if (@deposit > Zeny) goto Lneedzeny;
40        if (@deposit > (Zeny - @cost)) goto Lneedzeny2;
41        set Zeny,Zeny - @deposit;
42        set Zeny,Zeny - @cost;
43        set #bankstorage,#bankstorage + @deposit;
44        mes "[Banker]";
45        mes "Thank you very much... Your zeny is in good hands.";
46        close;
47
48Lwithdrawl:
49        mes "[Banker]";
50        mes "Very well... How much would you like to withdraw? The maximum you can withdraw at one time is 999,999 Zeny";
51        next;
52        if (@cost > 0) goto Lwithcost;
53        goto Lwithcont;
54
55        Lwithcost:
56                mes "[Banker]";
57                mes "Oh and don't forget there is a " + @cost + " Zeny charge on all transactions.";
58                next;
59                goto Lwithcont;
60
61Lwithcont:
62        input @withdrawl;
63        if (@withdrawl < 1) goto Lrealamount;
64        if (@withdrawl > #bankstorage) goto Lneedzeny3;
65        if ((@cost > Zeny) && ((Zeny + @withdrawl) > @cost)) goto Lcostask;
66        if (@cost > Zeny) goto Lneedzeny2;
67        goto Lwithcont2;
68
69        Lcostask:
70                mes "[Banker]";
71                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?";
72                next;
73                menu "Yes please.",Lwithtake,"No thank you.",Lcancel;
74
75        Lwithtake:
76                mes "[Banker]";
77                mes "Ok then.";
78                set @withdrawl,@withdrawl - @cost;
79                set #bankstorage,#bankstorage - @cost;
80                set @cost,0;
81                next;
82                goto Lwithcont2;
83
84Lwithcont2:
85        set Zeny,Zeny - @cost;
86        set Zeny,Zeny + @withdrawl;
87        set #bankstorage,#bankstorage - @withdrawl;
88        mes "[Banker]";
89        mes "There's your Zeny. Have a good day.";
90        close;
91
92Lbalance:
93        mes "[Banker]";
94        mes "Hmmmm lemme check the paper work.";
95        next;
96        mes "*Rustle, Rustle*";
97        next;
98        mes "[Banker]";
99        mes "You currently have " + #bankstorage + " Zeny in your account.";
100        close;
101
102Lrealamount:
103        mes "[Banker]";
104        mes "Don't play jokes with me please. Next time ask for a real amount.";
105        close;
106
107Lneedzeny:
108        mes "[Banker]";
109        mes "You don't have enough Zeny to make that deposit.";
110        close;
111
112Lneedzeny2:
113        mes "[Banker]";
114        mes "You don't have enough Zeny to cover the transaction fee.";
115        close;
116
117Lneedzeny3:
118        mes "[Banker]";
119        mes "You don't have enough Zeny in your account.";
120        close;
121
122Lcancel:
123        mes "[Banker]";
124        mes "Very well... come again soon.";
125        close;
126}
Note: See TracBrowser for help on using the browser.