From 5ff6b8a397040a73edfe5cf3c9898d0d0cc50e99 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sun, 24 Jan 2010 17:14:53 -0700 Subject: Expand ClearVariables function Now removes event variables from 2009 and tryies to fix negative bank accounts. --- npc/functions/clear_vars.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'npc/functions') 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; } -- cgit v1.2.3-70-g09d2