summaryrefslogtreecommitdiff
path: root/npc
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
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')
-rw-r--r--npc/001-1_Tulimshar/banker.txt2
-rw-r--r--npc/001-1_Tulimshar/soul-menhir.txt1
-rw-r--r--npc/009-1_Hurnscald/soul-menhir.txt1
-rw-r--r--npc/009-2_Hurnscald/richard.txt2
-rw-r--r--npc/020-1_Nivalis/soul-menhir.txt1
-rw-r--r--npc/functions/clear_vars.txt21
6 files changed, 28 insertions, 0 deletions
diff --git a/npc/001-1_Tulimshar/banker.txt b/npc/001-1_Tulimshar/banker.txt
index c428e6e8..75ea18d5 100644
--- a/npc/001-1_Tulimshar/banker.txt
+++ b/npc/001-1_Tulimshar/banker.txt
@@ -1,12 +1,14 @@
//
001-1.gat,57,52,0 script Tybalt 107,{
+ callfunc "ClearVariables";
set @npcName$, "Tybalt";
callfunc "Banker";
close;
}
001-1.gat,51,29,0 script Achar 49,{
+ callfunc "ClearVariables";
openstorage;
mes "Come again!";
close;
diff --git a/npc/001-1_Tulimshar/soul-menhir.txt b/npc/001-1_Tulimshar/soul-menhir.txt
index eacdd9e8..00208932 100644
--- a/npc/001-1_Tulimshar/soul-menhir.txt
+++ b/npc/001-1_Tulimshar/soul-menhir.txt
@@ -1,6 +1,7 @@
//
001-1.gat,38,69,0 script Soul Menhir 144, {
+ callfunc "ClearVariables";
set @map$, "001-1.gat";
setarray @Xs, 37, 38, 39, 37, 39, 37, 39;
setarray @Ys, 68, 68, 68, 69, 69, 70, 70;
diff --git a/npc/009-1_Hurnscald/soul-menhir.txt b/npc/009-1_Hurnscald/soul-menhir.txt
index d62a1275..5daadd23 100644
--- a/npc/009-1_Hurnscald/soul-menhir.txt
+++ b/npc/009-1_Hurnscald/soul-menhir.txt
@@ -1,6 +1,7 @@
//
009-1.gat,53,40,0 script Soul Menhir 144, {
+ callfunc "ClearVariables";
set @map$, "009-1.gat";
setarray @Xs, 52, 53, 54, 52, 54, 52, 54;
setarray @Ys, 39, 39, 39, 40, 40, 41, 41;
diff --git a/npc/009-2_Hurnscald/richard.txt b/npc/009-2_Hurnscald/richard.txt
index 1710ca45..0dcd4d02 100644
--- a/npc/009-2_Hurnscald/richard.txt
+++ b/npc/009-2_Hurnscald/richard.txt
@@ -1,12 +1,14 @@
//
009-2.gat,20,99,0 script Richard 161,{
+ callfunc "ClearVariables";
set @npcName$, "Richard";
callfunc "Banker";
close;
}
009-2.gat,19,99,0 script William 48,{
+ callfunc "ClearVariables";
openstorage;
mes "Come again!";
close;
diff --git a/npc/020-1_Nivalis/soul-menhir.txt b/npc/020-1_Nivalis/soul-menhir.txt
index 4da72853..ee973170 100644
--- a/npc/020-1_Nivalis/soul-menhir.txt
+++ b/npc/020-1_Nivalis/soul-menhir.txt
@@ -1,6 +1,7 @@
//
020-1.gat,64,89,0 script Soul Menhir 144, {
+ callfunc "ClearVariables";
set @map$, "020-1.gat";
setarray @Xs, 63, 64, 65, 63, 65, 63, 65;
setarray @Ys, 88, 88, 88, 89, 89, 90, 90;
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;
}