summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-01-27 15:10:10 -0700
committerJared Adams <jaxad0127@gmail.com>2010-01-27 15:53:40 -0700
commit150ada94fd40fe47f9a4be9444b480d385713f07 (patch)
tree6ee315828d2005663419e25e56612d6ff050c953 /npc/functions
parentb67e09dd443a792e7554a18aeedff9b666e8c69d (diff)
downloadserverdata-150ada94fd40fe47f9a4be9444b480d385713f07.tar.gz
serverdata-150ada94fd40fe47f9a4be9444b480d385713f07.tar.bz2
serverdata-150ada94fd40fe47f9a4be9444b480d385713f07.tar.xz
serverdata-150ada94fd40fe47f9a4be9444b480d385713f07.zip
Improve the usefullness of the banker a bit
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/banker.txt36
1 files changed, 34 insertions, 2 deletions
diff --git a/npc/functions/banker.txt b/npc/functions/banker.txt
index 32c380b6..43f6f879 100644
--- a/npc/functions/banker.txt
+++ b/npc/functions/banker.txt
@@ -2,6 +2,8 @@
function script Banker {
if (BankAccount > 0) callsub S_MoveAccount;
+
+L_Start:
mes "[" + @npcName$ + "]";
mes "\"Welcome to the bank!";
mes "How can I help you?\"";
@@ -15,7 +17,22 @@ L_Dep:
mes "[" + @npcName$ + "]";
mes "\"How much would you like to deposit?\"";
next;
+
+L_Dep_Input:
input @Amount;
+ if (@Amount >= 0) goto L_Dep_Continue;
+ mes "[" + @npcName$ + "]";
+ mes "\"I need a positive amount. What would you like to do?\"";
+ menu "Go back", L_Start,
+ "Try again", L_Dep_Input,
+ "Deposit all", L_Dep_All,
+ "Quit", -;
+ goto L_Nev;
+
+L_Dep_All:
+ set @Amount, zeny;
+
+L_Dep_Continue:
if (zeny < @Amount) goto L_NoMoney;
set zeny, zeny - @Amount;
@@ -26,7 +43,22 @@ L_With:
mes "[" + @npcName$ + "]";
mes "\"How much would you like to withdraw?\"";
next;
+
+L_With_Input:
input @Amount;
+ if (@Amount >= 0) goto L_With_Continue;
+ mes "[" + @npcName$ + "]";
+ mes "\"I need a positive amount. What would you like to do?\"";
+ menu "Go back", L_Start,
+ "Try again", L_With_Input,
+ "Withdraw all", L_With_All,
+ "Quit", -;
+ goto L_Nev;
+
+L_With_All:
+ set @Amount, zeny;
+
+L_With_Continue:
if (#BankAccount < @Amount) goto L_NoMoney;
set zeny, zeny + @Amount;
@@ -37,7 +69,7 @@ L_Balance:
mes "[" + @npcName$ + "]";
mes "\"Your current bank balance is:";
mes #BankAccount + " GP\"";
- return;
+ goto L_Start;
L_Nev:
mes "[" + @npcName$ + "]";
@@ -47,7 +79,7 @@ L_Nev:
L_NoMoney:
mes "[" + @npcName$ + "]";
mes "\"Oh dear, it seems that you don't have enough money.\"";
- return;
+ goto L_Start;
S_MoveAccount:
set #BankAccount, #BankAccount + BankAccount;