From fce3b0239ea177694b1b64d8395ffa6e1eaaa5f1 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 30 Jun 2018 10:30:34 -0300 Subject: Delete unused file, move season() --- npc/functions/seasons.txt | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 npc/functions/seasons.txt (limited to 'npc/functions/seasons.txt') diff --git a/npc/functions/seasons.txt b/npc/functions/seasons.txt new file mode 100644 index 000000000..8b124e3bb --- /dev/null +++ b/npc/functions/seasons.txt @@ -0,0 +1,36 @@ +// TMW2 Script. +// Authors: +// Jesusalva +// Description: +// Season functions + +// Function authored by Reid and edited by Jesusalva +// season({day, month}) +// SQuest_Summer +// returns the current season (approximation) +// WINTER: Winter, 21/12 +// SPRING: Spring, 20/03 +// SUMMER: Summer, 21/06 +// AUTUMN: Autumn, 22/09 + +function script season { + .@current_month = getarg(0, gettime(GETTIME_MONTH)); + + if (.@current_month % 3 == 0) { + .@current_day = getarg(1, gettime(GETTIME_DAYOFMONTH)); + + switch (.@current_month) { + case MARCH: .@season_day = 20; break; + case JUNE: .@season_day = 21; break; + case SEPTEMBER: .@season_day = 22; break; + case DECEMBER: .@season_day = 21; break; + default: break; + } + + .@is_after_season_day = .@current_day >= .@season_day ? 0 : -1; + } + + return (.@current_month / 3 + .@is_after_season_day) % 4; +} + + -- cgit v1.2.3-60-g2f50