summaryrefslogtreecommitdiff
path: root/npc/other/bank.txt
blob: ae8ce7829778abf02628175ac0fe2b239d90d322 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//===== eAthena Script ======================================= 
//= Banker Script 
//===== By: ================================================== 
//= Syrus22 (1.0)
//===== Current Version: ===================================== 
//= 1.0
//===== Compatible With: ===================================== 
//= Any eAthena version with Account variables.
//===== 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.
//============================================================ 
prontera.gat,132,217,5	script	Banker	109,{
set @cost,0;
mes "[Banker]";
mes "Welcome to the First Bank of Prontera. How can I help you today?";
next;
menu "I'd like to make a deposit.",Ldeposit,"I'd like to make a withdrawl.",Lwithdrawl,"What's my current balance?",Lbalance,"Cancel",Lcancel;

Ldeposit:
	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) goto Ldepocost;
	goto Ldepocont;

	Ldepocost:
		mes "[Banker]";
		mes "Oh and don't forget there is a " + @cost + " Zeny charge on all transactions.";
		next;
		goto Ldepocont;

Ldepocont:
	input @deposit;
	if (@deposit < 1) goto Lrealamount;
	if (@deposit > Zeny) goto Lneedzeny;
	if (@deposit > (Zeny - @cost)) goto Lneedzeny2;
	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;

Lwithdrawl:
	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) goto Lwithcost;
	goto Lwithcont;

	Lwithcost:
		mes "[Banker]";
		mes "Oh and don't forget there is a " + @cost + " Zeny charge on all transactions.";
		next;
		goto Lwithcont;

Lwithcont:
	input @withdrawl;
	if (@withdrawl < 1) goto Lrealamount;
	if (@withdrawl > #bankstorage) goto Lneedzeny3;
	if ((@cost > Zeny) && ((Zeny + @withdrawl) > @cost)) goto Lcostask; 
	if (@cost > Zeny) goto Lneedzeny2;
	goto Lwithcont2;

	Lcostask:
		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 withdrawl?";
		next;
		menu "Yes please.",Lwithtake,"No thank you.",Lcancel;

	Lwithtake:
		mes "[Banker]";
		mes "Ok then.";
		set @withdrawl,@withdrawl - @cost;
		set #bankstorage,#bankstorage - @cost;
		set @cost,0;
		next;
		goto Lwithcont2;

Lwithcont2:
	set Zeny,Zeny - @cost;
	set Zeny,Zeny + @withdrawl;
	set #bankstorage,#bankstorage - @withdrawl;
	mes "[Banker]";
	mes "There's your Zeny. Have a good day.";
	close;

Lbalance:
	mes "[Banker]";
	mes "Hmmmm lemme check the paper work.";
	next;
	mes "*Rustle, Rustle*";
	next;
	mes "[Banker]";
	mes "You currently have " + #bankstorage + " Zeny in your account.";
	close;

Lrealamount:
	mes "[Banker]";
	mes "Don't play jokes with me please. Next time ask for a real amount.";
	close;

Lneedzeny:
	mes "[Banker]";
	mes "You don't have enough Zeny to make that deposit.";
	close;

Lneedzeny2:
	mes "[Banker]";
	mes "You don't have enough Zeny to cover the transaction fee.";
	close;

Lneedzeny3:
	mes "[Banker]";
	mes "You don't have enough Zeny in your account.";
	close;

Lcancel:
	mes "[Banker]";
	mes "Very well... come again soon.";
	close;
}