summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <mekolat@users.noreply.github.com>2017-01-27 14:53:01 -0500
committergumi <mekolat@users.noreply.github.com>2017-01-28 09:53:54 -0500
commitdd1e92091b9a7d7399ec12da6df0e87dc306322f (patch)
tree42a6b0d531700cccf4ae00104532b56d301ac959
parent36a0f913168fdca7d50e73d8a4df5e01d1c08c21 (diff)
downloadserverdata-dd1e92091b9a7d7399ec12da6df0e87dc306322f.tar.gz
serverdata-dd1e92091b9a7d7399ec12da6df0e87dc306322f.tar.bz2
serverdata-dd1e92091b9a7d7399ec12da6df0e87dc306322f.tar.xz
serverdata-dd1e92091b9a7d7399ec12da6df0e87dc306322f.zip
move the bank script into its own function
-rw-r--r--npc/001-2-19/lloyd.txt74
-rw-r--r--npc/functions/bank.txt76
-rw-r--r--npc/scripts.conf1
3 files changed, 78 insertions, 73 deletions
diff --git a/npc/001-2-19/lloyd.txt b/npc/001-2-19/lloyd.txt
index 46002411..96106e80 100644
--- a/npc/001-2-19/lloyd.txt
+++ b/npc/001-2-19/lloyd.txt
@@ -158,78 +158,6 @@
} while (.@q == 2);
}
- function bank_account {
- speech 5,
- l("Fine, what do you want to do with your money?");
-
- do
- {
- .@q = select (l("Deposit."),
- l("Withdraw."),
- l("Check my balance."),
- l("I'm done."));
- switch (.@q)
- {
- case 1:
- speech 1,
- l("Enter the amount that you want to deposit.");
- mes "";
-
- input .@amount;
- if (.@amount < 1)
- {
- speech 5,
- l("Please enter a valid amount.");
- continue;
- }
- if (.@amount > Zeny)
- {
- speech 5,
- l("You do not have enough Esperin on yourself.");
- continue;
- }
- set Zeny, Zeny - .@amount;
- set #MerchantBank, #MerchantBank + .@amount;
-
- speech 5,
- l("You made a cash deposit of @@ E.", .@amount);
-
- break;
- case 2:
- speech 1,
- l("Enter the amount that you want to withdraw.");
- mes "";
-
- input .@amount;
- if (.@amount < 1)
- {
- speech 5,
- l("Please enter a valid amount.");
- continue;
- }
- if (.@amount > #MerchantBank)
- {
- speech 5,
- l("You do not have enough Esperin on your bank account.");
- continue;
- }
- set #MerchantBank, #MerchantBank - .@amount;
- set Zeny, Zeny + .@amount;
-
- speech 5,
- l("You withdrawn a total of @@ E.", .@amount);
-
- break;
- case 3:
- speech 5,
- l("You currently have @@ on your bank account.", #MerchantBank);
- break;
- case 4:
- break;
- }
- } while (.@q != 4);
- }
-
if (getq (ArtisQuests_Lloyd) == 0)
{
first_visit;
@@ -266,7 +194,7 @@
close;
break;
case 3:
- bank_account;
+ MerchantGuild_Bank;
break;
case 4:
mes "";
diff --git a/npc/functions/bank.txt b/npc/functions/bank.txt
new file mode 100644
index 00000000..22facc1f
--- /dev/null
+++ b/npc/functions/bank.txt
@@ -0,0 +1,76 @@
+// Evol scripts.
+// Authors:
+// gumi
+// Reid
+
+function script MerchantGuild_Bank {
+ speech 5,
+ l("Fine, what do you want to do with your money?");
+
+ do
+ {
+ .@q = select (l("Deposit."),
+ l("Withdraw."),
+ l("Check my balance."),
+ l("I'm done."));
+ switch (.@q)
+ {
+ case 1:
+ speech 1,
+ l("Enter the amount that you want to deposit.");
+ mes "";
+
+ input .@amount;
+ if (.@amount < 1)
+ {
+ speech 5,
+ l("Please enter a valid amount.");
+ continue;
+ }
+ if (.@amount > Zeny)
+ {
+ speech 5,
+ l("You do not have enough Esperin on yourself.");
+ continue;
+ }
+ set Zeny, Zeny - .@amount;
+ set #MerchantBank, #MerchantBank + .@amount;
+
+ speech 5,
+ l("You made a cash deposit of @@ E.", .@amount);
+
+ break;
+ case 2:
+ speech 1,
+ l("Enter the amount that you want to withdraw.");
+ mes "";
+
+ input .@amount;
+ if (.@amount < 1)
+ {
+ speech 5,
+ l("Please enter a valid amount.");
+ continue;
+ }
+ if (.@amount > #MerchantBank)
+ {
+ speech 5,
+ l("You do not have enough Esperin on your bank account.");
+ continue;
+ }
+ set #MerchantBank, #MerchantBank - .@amount;
+ set Zeny, Zeny + .@amount;
+
+ speech 5,
+ l("You withdrawn a total of @@ E.", .@amount);
+
+ break;
+ case 3:
+ speech 5,
+ l("You currently have @@ on your bank account.", #MerchantBank);
+ break;
+ }
+ } while (.@q != 4);
+
+ return;
+}
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 05e563e5..ec7f0be7 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -36,6 +36,7 @@
"npc/functions/asklanguage.txt",
"npc/functions/game-rules.txt",
"npc/functions/riddle.txt",
+"npc/functions/bank.txt",
// quest debug
"npc/functions/quest-debug/functions.txt",