summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-01-24 17:14:53 -0700
committerJared Adams <jaxad0127@gmail.com>2010-01-24 17:14:53 -0700
commit5ff6b8a397040a73edfe5cf3c9898d0d0cc50e99 (patch)
treebfe0836d5bcee47f1827fac4f0b29f803f47e941 /npc/functions
parent82d3c3b7dd9cd679a671b65abdf48159b928e83b (diff)
downloadserverdata-5ff6b8a397040a73edfe5cf3c9898d0d0cc50e99.tar.gz
serverdata-5ff6b8a397040a73edfe5cf3c9898d0d0cc50e99.tar.bz2
serverdata-5ff6b8a397040a73edfe5cf3c9898d0d0cc50e99.tar.xz
serverdata-5ff6b8a397040a73edfe5cf3c9898d0d0cc50e99.zip
Expand ClearVariables function
Now removes event variables from 2009 and tryies to fix negative bank accounts.
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/clear_vars.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/npc/functions/clear_vars.txt b/npc/functions/clear_vars.txt
index 706c5cd8..857e3793 100644
--- a/npc/functions/clear_vars.txt
+++ b/npc/functions/clear_vars.txt
@@ -57,5 +57,26 @@ function script ClearVariables {
set QUEST_xmas08_state, 0;
+ set QUEST_Easter09, 0;
+
+ set Candyman, 0; // Halloween 2009
+
+ set QUEST_Christmas09_state, 0;
+
+ if (#BankAccount < 0) goto FixBank;
+
+ return;
+
+FixBank:
+ if (zeny >= -#BankAccount) goto L_Fix_Full;
+
+ // Partial fix
+ set #BankAccount, #BankAccount + zeny
+ set zeny, 0;
+ return;
+
+L_Fix_Full:
+ set zeny, zeny + #BankAccount;
+ set #BankAccount, 0;
return;
}