summaryrefslogtreecommitdiff
path: root/npc/annuals/check_time.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-09 13:33:57 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-09 13:33:57 -0300
commitcf18ce071c79ae37e14ea38943e0b1d88da70a7b (patch)
treef9159c9b60b3018300dd22ffba0d797bc5e828e5 /npc/annuals/check_time.txt
parent8a4bf716002a017de77fe7df301ef8e4aaf00a2e (diff)
downloadserverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.tar.gz
serverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.tar.bz2
serverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.tar.xz
serverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.zip
Override
Diffstat (limited to 'npc/annuals/check_time.txt')
-rwxr-xr-xnpc/annuals/check_time.txt46
1 files changed, 46 insertions, 0 deletions
diff --git a/npc/annuals/check_time.txt b/npc/annuals/check_time.txt
new file mode 100755
index 00000000..74980e9c
--- /dev/null
+++ b/npc/annuals/check_time.txt
@@ -0,0 +1,46 @@
+
+function script GetEventTime {
+ $@month = gettime(6);
+ $@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:
+ $@event_time = 0;
+ return;
+
+L_EventTime:
+ $@event_time = 1;
+ return;
+
+L_RewardTime:
+ $@event_time = 2;
+ return;
+}