summaryrefslogtreecommitdiff
path: root/npc/functions/bank.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/bank.txt')
-rw-r--r--npc/functions/bank.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/npc/functions/bank.txt b/npc/functions/bank.txt
index 00ca148a9..d4c0d30ce 100644
--- a/npc/functions/bank.txt
+++ b/npc/functions/bank.txt
@@ -293,3 +293,26 @@ function script Banker {
close;
}
+
+// still_owed = TakeMoney (amount, reason)
+// This function is meant to be used from clientversion, when a quest failed
+// to take money from user.
+function script TakeMoney {
+ .@still_owed = getarg(0);
+ .@reason$ = getarg(1);
+
+ .@take = min(Zeny, .@still_owed);
+ Zeny -= .@take;
+ .@still_owed -= .@take;
+
+ .@take = min(BankVault, .@still_owed);
+ BankVault -= .@take;
+ .@still_owed -= .@take;
+
+ if (.@still_owed > 0)
+ consoleinfo("%s STILL OWES %s for %s.", strcharinfo(0), fnum(.@leftover), .@reason$);
+
+ dispbottom col(l("%s were deducted for %s", fnum(10000-.@leftover), .@reason$), 1);
+ return .@still_owed;
+}
+