summaryrefslogtreecommitdiff
path: root/world/map/npc/annuals/xmas/helpers.txt
diff options
context:
space:
mode:
authorwushin <pasekei@gmail.com>2013-12-25 09:08:06 -0600
committerwushin <pasekei@gmail.com>2013-12-26 08:27:31 -0600
commitcd71949def7c2c9b86991b92f4462136671757a3 (patch)
tree1122db272deff33e017afd9011e6c92ffd3eea59 /world/map/npc/annuals/xmas/helpers.txt
parent91498af8d7e3f347ef5bcc3a9b1dc7d91d52fd61 (diff)
downloadserverdata-cd71949def7c2c9b86991b92f4462136671757a3.tar.gz
serverdata-cd71949def7c2c9b86991b92f4462136671757a3.tar.bz2
serverdata-cd71949def7c2c9b86991b92f4462136671757a3.tar.xz
serverdata-cd71949def7c2c9b86991b92f4462136671757a3.zip
Annual Xmas Event
Diffstat (limited to 'world/map/npc/annuals/xmas/helpers.txt')
-rw-r--r--world/map/npc/annuals/xmas/helpers.txt48
1 files changed, 48 insertions, 0 deletions
diff --git a/world/map/npc/annuals/xmas/helpers.txt b/world/map/npc/annuals/xmas/helpers.txt
new file mode 100644
index 00000000..57e535b5
--- /dev/null
+++ b/world/map/npc/annuals/xmas/helpers.txt
@@ -0,0 +1,48 @@
+// This file is part of Christmas Event
+// author: Jenalya, Chayenne, cinderweb, wushin
+// please see #XmasConfig
+// TODO: Make Helpers static functions
+
+function|script|XmasHelperPoints|,
+{
+ set @xmas_helper_count, 0;
+ set @xmas_helper_loop, 0;
+ if((@xmas_helper_done_state) || !(@xmas_helper_start_state))
+ goto L_Return;
+
+L_Loop:
+ if(XMASTIME & $@xmas_helper_list[@xmas_helper_loop])
+ goto L_AddOne;
+ goto L_LoopAgain;
+
+L_AddOne:
+ set @xmas_helper_count, (@xmas_helper_count + 1);
+ goto L_LoopAgain;
+
+L_LoopAgain:
+ if((@xmas_helper_loop + 1) == getarraysize($@xmas_helper_list))
+ goto L_HelperTally;
+ set @xmas_helper_loop, (@xmas_helper_loop + 1);
+ goto L_Loop;
+
+L_HelperTally:
+ if(@xmas_helper_count == $@xmas_perfect_helpers_count)
+ goto L_PerfectHelpers;
+ if(@xmas_helper_count > $@xmas_required_helpers_count)
+ goto L_SetHelperState;
+ goto L_Return;
+
+L_PerfectHelpers:
+ set XMASTIME, XMASTIME | $@xmas_all_helpers_bit;
+ goto L_SetHelperState;
+
+L_SetHelperState:
+ set @xmas_state, $@xmas_helpers_done_state;
+ callfunc "XmasSetState";
+ goto L_Return;
+
+L_Return:
+ set @xmas_helper_count, 0;
+ set @xmas_helper_loop, 0;
+ return;
+}