summaryrefslogtreecommitdiff
path: root/world/map/npc/annuals/check_time.txt
diff options
context:
space:
mode:
authorwushin <pasekei@gmail.com>2014-12-01 09:23:20 -0600
committerwushin <pasekei@gmail.com>2014-12-01 09:23:20 -0600
commit126497666a2adb9962e1401b3d038a893266ae1e (patch)
tree5ab1298a5e46902e01afb68df09eac2f623c7906 /world/map/npc/annuals/check_time.txt
parenta23d11f9299e27899486439a0dcfb0711c6fad24 (diff)
downloadserverdata-126497666a2adb9962e1401b3d038a893266ae1e.tar.gz
serverdata-126497666a2adb9962e1401b3d038a893266ae1e.tar.bz2
serverdata-126497666a2adb9962e1401b3d038a893266ae1e.tar.xz
serverdata-126497666a2adb9962e1401b3d038a893266ae1e.zip
Fix Timings for Annual Events
Diffstat (limited to 'world/map/npc/annuals/check_time.txt')
-rw-r--r--world/map/npc/annuals/check_time.txt55
1 files changed, 55 insertions, 0 deletions
diff --git a/world/map/npc/annuals/check_time.txt b/world/map/npc/annuals/check_time.txt
new file mode 100644
index 00000000..06de3038
--- /dev/null
+++ b/world/map/npc/annuals/check_time.txt
@@ -0,0 +1,55 @@
+// check a date
+// Wushin
+// $@start_month
+// $@end_month
+// $@start_day
+// $@end_day
+// $@reward_start_month
+// $@reward_start_day
+
+function|script|GetEventTime
+{
+ set $@month, gettime(6);
+ set $@day, gettime(5);
+
+ if ($@start_month > $@end_month)
+ goto L_YearWrap;
+ goto L_Normal;
+
+L_Normal:
+ if(($@month < $@start_month)
+ || ($@month == $@start_month && $@day < $@start_day))
+ goto L_NoEventTime;
+ if(($@month > $@end_month)
+ || ($@month == $@end_month && $@day > $@end_day))
+ goto L_NoEventTime;
+ if(($@month > $@reward_start_month)
+ || ($@month == $@reward_start_month && $@day >= $@reward_start_day))
+ goto L_RewardTime;
+ goto L_EventTime;
+
+L_YearWrap:
+ if(($@month == $@reward_start_month && $@day >= $@reward_start_day
+ && ($@day <= $@end_day && $@reward_start_month == $@end_month
+ || !($@reward_start_month == $@end_month)))
+ || ($@month == $@end_month && $@day <= $@end_day
+ && ($@day >= $@reward_start_day && $@reward_start_month == $@end_month
+ || !($@reward_start_month == $@end_month)))
+ || ($@month < $@end_month && $@month > $@reward_start_month))
+ goto L_RewardTime;
+ if(($@month >= $@start_month) || ($@month <= $@end_month && $@day <= $@reward_start_day))
+ goto L_EventTime;
+ goto L_NoEventTime;
+
+L_NoEventTime:
+ set $@event_time, 0;
+ return;
+
+L_EventTime:
+ set $@event_time, 1;
+ return;
+
+L_RewardTime:
+ set $@event_time, 2;
+ return;
+}