diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-07-07 20:36:00 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-07-07 20:36:00 -0300 |
commit | 6967b9e0b63d19141d4f59b7933a960ac81916d0 (patch) | |
tree | 8ecd9cd2461f3598cb7faece71eb77162aa4ef2a /npc/annuals/check_time.txt | |
parent | 9877fd4ad81120af8e63e96d5d429092014dc017 (diff) | |
parent | 046c659193e1ca8bd13478678d1277df8bf9395c (diff) | |
download | serverdata-6967b9e0b63d19141d4f59b7933a960ac81916d0.tar.gz serverdata-6967b9e0b63d19141d4f59b7933a960ac81916d0.tar.bz2 serverdata-6967b9e0b63d19141d4f59b7933a960ac81916d0.tar.xz serverdata-6967b9e0b63d19141d4f59b7933a960ac81916d0.zip |
Merge branch 'master' into legacy
Override all files with 'master' version.
This version is meant to preserve git history as requested by bjorn.
Diffstat (limited to 'npc/annuals/check_time.txt')
-rw-r--r-- | npc/annuals/check_time.txt | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/npc/annuals/check_time.txt b/npc/annuals/check_time.txt new file mode 100644 index 00000000..5d229e4c --- /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 && $@day >= $@start_day) || ($@month <= $@end_month && $@day <= $@end_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; +} |