summaryrefslogtreecommitdiff
path: root/npc/functions/banker.txt
blob: 4967263a9f4563016a465f90a8c7616d6ae9922d (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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
//

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;
	menu
		"1,000 GP", D_1,
		"5,000 GP", D_5,
		"10,000 GP", D_10,
		"25,000 GP", D_25,
		"50,000 GP", D_50,
		"100,000 GP", D_100, 
		"250,000 GP", D_250,
		"500,000 GP", D_500,
		"1,000,000 GP", D_1000,
		"All of my money", D_All,
		"I've changed my mind", L_Nev;

D_1:
	if (zeny<1000) goto L_NoMoney;
	set @Amount, 1000;
	goto L_Deposit;
D_5:
	if (zeny<5000) goto L_NoMoney;
	set @Amount, 5000;
	goto L_Deposit;
D_10:
	if (zeny<10000) goto L_NoMoney;
	set @Amount, 10000;
	goto L_Deposit;
D_25:
	if (zeny<25000) goto L_NoMoney;
	set @Amount, 25000;
	goto L_Deposit;
D_50:
	if (zeny<50000) goto L_NoMoney;
	set @Amount, 50000;
	goto L_Deposit;
D_100:
	if (zeny<100000) goto L_NoMoney;
	set @Amount, 100000;
	goto L_Deposit;
D_250:
	if (zeny<250000) goto L_NoMoney;
	set @Amount, 250000;
	goto L_Deposit;
D_500:
	if (zeny<500000) goto L_NoMoney;
	set @Amount, 500000;
	goto L_Deposit;
D_1000:
	if (zeny<1000000) goto L_NoMoney;
	set @Amount, 1000000;
	goto L_Deposit;
D_All:
	if (zeny<1) goto L_NoMoney;
	set @Amount, zeny;
	goto L_Deposit;

L_Deposit:
	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;
	menu
		"1,000 GP", W_1,
		"5,000 GP", W_5,
		"10,000 GP", W_10,
		"25,000 GP", W_25,
		"50,000 GP", W_50,
		"100,000 GP", W_100,
		"250,000 GP", W_250,
		"500,000 GP", W_500,
		"1,000,000 GP", W_1000,
		"All of my money", W_All,
		"I've changed my mind", L_Nev;

W_1:
	if (#BankAccount < 1000) goto L_NoMoney;
	set @Amount, 1000;
	goto L_Withdraw;

W_5:
	if (#BankAccount < 5000) goto L_NoMoney;
	set @Amount, 5000;
	goto L_Withdraw;

W_10:
	if (#BankAccount < 10000) goto L_NoMoney;
	set @Amount, 10000;
	goto L_Withdraw;

W_25:
	if (#BankAccount < 25000) goto L_NoMoney;
	set @Amount, 25000;
	goto L_Withdraw;

W_50:
	if (#BankAccount < 50000) goto L_NoMoney;
	set @Amount, 50000;
	goto L_Withdraw;

W_100:
	if (#BankAccount < 100000) goto L_NoMoney;
	set @Amount, 100000;
	goto L_Withdraw;

W_250:
	if (#BankAccount < 250000) goto L_NoMoney;
	set @Amount, 250000;
	goto L_Withdraw;

W_500:
	if (#BankAccount < 500000) goto L_NoMoney;
	set @Amount, 500000;
	goto L_Withdraw;

W_1000:
	if (#BankAccount < 1000000) goto L_NoMoney;
	set @Amount, 1000000;
	goto L_Withdraw;

W_All:
	if (#BankAccount < 1) goto L_NoMoney;
	set @Amount, #BankAccount;
	goto L_Withdraw;

L_Withdraw:
	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;
}