From dd1e92091b9a7d7399ec12da6df0e87dc306322f Mon Sep 17 00:00:00 2001 From: gumi Date: Fri, 27 Jan 2017 14:53:01 -0500 Subject: move the bank script into its own function --- npc/functions/bank.txt | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 npc/functions/bank.txt (limited to 'npc/functions/bank.txt') 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; +} -- cgit v1.2.3-60-g2f50