1 | //===== eAthena Script ======================================= |
---|
2 | //= The 2nd Bank of Prontera ( with daily 0.01% income! ) |
---|
3 | //===== By: ================================================== |
---|
4 | //= Lupus (1.0) |
---|
5 | //===== Current Version: ===================================== |
---|
6 | //= 1.2a |
---|
7 | //===== Compatible With: ===================================== |
---|
8 | //= eAthena 1.x |
---|
9 | //===== Description: ========================================= |
---|
10 | //= A bank which has an interest % |
---|
11 | //===== Additional Comments: ================================= |
---|
12 | // Look for this formula and setup your Bank daily % interest |
---|
13 | // #kafrabank/1000 = 0.1% of interest per day |
---|
14 | // #kafrabank/100 = 1% of interest per day |
---|
15 | // #kafrabank/10 = 10% of interest per day |
---|
16 | // |
---|
17 | // 1.1 Added log of bank operation -> logmes "some info"; |
---|
18 | // 1.2 Set max income to 100,000z. It would help to avoid |
---|
19 | // zeny exploits when you change DATE at your server |
---|
20 | // 1.2a Corrected bad duplicate names. (bugreport:921) [Samuray22] |
---|
21 | //============================================================ |
---|
22 | |
---|
23 | prontera,131,190,1 script Bank Clerk::bankg 833,{ |
---|
24 | mes"[Maniss]"; |
---|
25 | mes strcharinfo(0)+", welcome to the 2nd Bank of Prontera!"; |
---|
26 | |
---|
27 | set @kb_int,(gettime(6)*31)+gettime(5); //today's number |
---|
28 | set @income,0; |
---|
29 | //calculate % |
---|
30 | if (#kafrabank<=0 || #kb_int>=@kb_int) goto L_NoIncomeToday; |
---|
31 | set @income,(#kafrabank/1000)*(@kb_int-#kb_int); //@income == % of the sum |
---|
32 | //max income constant: |
---|
33 | if (@income>100000) set @income,100000; |
---|
34 | L_NoIncomeToday: |
---|
35 | set #kb_int,@kb_int; //reset days timer |
---|
36 | |
---|
37 | if(#kafrabank==0) mes "We could open you an account."; |
---|
38 | if(@income>0) mes "Today's income: ^135445" + @income + "^000000 zeny."; |
---|
39 | set #kafrabank,#kafrabank+@income; |
---|
40 | if(#kafrabank>0) mes "Your account: ^135445" + #kafrabank + "^000000 zeny."; |
---|
41 | mes "What would you like?"; |
---|
42 | next; |
---|
43 | if(#kafrabank==0) menu "-Open an account",-,"-Quit",B_EXIT2; |
---|
44 | if(#kafrabank>0) menu "-Deposit money",-,"-Withdraw money",M_WITHDRAW,"-Quit",B_EXIT2; |
---|
45 | |
---|
46 | mes"[Maniss]"; |
---|
47 | mes "Please, tell me how much zeny you would like to deposit."; |
---|
48 | next; |
---|
49 | input @kafrabank; |
---|
50 | |
---|
51 | if(@kafrabank<1000) goto L_LESS_1000; |
---|
52 | if(@kafrabank>10000000) goto L_TOO_BIG_AMOUNT; |
---|
53 | if(@kafrabank>zeny) goto L_NOT_ENOUGH; |
---|
54 | set zeny,zeny-@kafrabank; |
---|
55 | set #kafrabank,#kafrabank+@kafrabank; |
---|
56 | mes"[Maniss]"; |
---|
57 | mes "You've made a deposit of ^135445" + @kafrabank + "z^000000."; |
---|
58 | //we log these zeny operations into the log db |
---|
59 | logmes "Bank %: " + @income +"z, Deposit: "+ @kafrabank +"z, Final: "+ #kafrabank +"z"; |
---|
60 | goto B_EXIT; |
---|
61 | |
---|
62 | M_WITHDRAW: |
---|
63 | if(#kafrabank==0) goto L_ZERO_ACCOUNT; |
---|
64 | mes"[Maniss]"; |
---|
65 | mes "Your account: ^135445" + #kafrabank + "^000000 zeny."; |
---|
66 | mes "How much zeny would you like to withdraw?"; |
---|
67 | next; |
---|
68 | input @kafrabank; |
---|
69 | |
---|
70 | if(@kafrabank<1) goto B_EXIT2; |
---|
71 | if(@kafrabank>10000000) goto L_TOO_BIG_AMOUNT; |
---|
72 | if(@kafrabank>#kafrabank) goto L_NOT_ENOUGH; |
---|
73 | set #kafrabank,#kafrabank-@kafrabank; |
---|
74 | set zeny,zeny+@kafrabank; |
---|
75 | mes"[Maniss]"; |
---|
76 | mes "Here is your ^135445" + @kafrabank + "z^000000, put your sign here..."; |
---|
77 | //we log these zeny operations into the log db |
---|
78 | logmes "Bank %: " + @income +"z, Withdraw: "+ @kafrabank +"z, Final: "+ #kafrabank +"z"; |
---|
79 | goto B_EXIT; |
---|
80 | |
---|
81 | L_NOT_ENOUGH: |
---|
82 | mes"[Maniss]"; |
---|
83 | mes "You don't have enough zeny for this operation."; |
---|
84 | next; |
---|
85 | goto B_EXIT2; |
---|
86 | |
---|
87 | L_ZERO_ACCOUNT: |
---|
88 | mes"[Maniss]"; |
---|
89 | mes "You don't have any zeny on your account!"; |
---|
90 | next; |
---|
91 | goto B_EXIT2; |
---|
92 | |
---|
93 | L_TOO_BIG_AMOUNT: |
---|
94 | mes"[Maniss]"; |
---|
95 | mes "Sorry. The maximum deposit you can make on a time is 10,000,000 zeny."; |
---|
96 | next; |
---|
97 | goto B_EXIT2; |
---|
98 | |
---|
99 | L_LESS_1000: |
---|
100 | mes"[Maniss]"; |
---|
101 | mes "We're sorry, the minimum amount of zeny you can deposit is 1,000 zeny."; |
---|
102 | next; |
---|
103 | goto B_EXIT2; |
---|
104 | |
---|
105 | B_EXIT: |
---|
106 | mes "Very well... Come again soon!"; |
---|
107 | next; |
---|
108 | |
---|
109 | B_EXIT2: |
---|
110 | mes"[Maniss]"; |
---|
111 | mes "Thank you for using our Bank Service. We hope to see you again soon."; |
---|
112 | close; |
---|
113 | } |
---|
114 | |
---|
115 | geffen,125,73,3 duplicate(bankg) Bank Clerk#2-1 833 |
---|
116 | izlude,145,107,1 duplicate(bankg) Bank Clerk#3-1 833 |
---|
117 | morocc,147,84,7 duplicate(bankg) Bank Clerk#4-1 833 |
---|