summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/functions/harbours.txt39
-rw-r--r--npc/functions/seasons.txt36
-rw-r--r--npc/functions/util.txt29
-rw-r--r--npc/scripts.conf2
4 files changed, 37 insertions, 69 deletions
diff --git a/npc/functions/harbours.txt b/npc/functions/harbours.txt
deleted file mode 100644
index 63d58076b..000000000
--- a/npc/functions/harbours.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-// Evol scripts.
-// Author:
-// Reid
-// Description:
-// Harbour utility functions
-// Animation:
-// Length: 1680
-// Values:
-// 2 Hook moving down.
-// 4 Hook moving up.
-// 6 Hook down.
-// 8 Hook up.
-
-function script harbourClic {
- if (.dir == 0)
- {
- .dir = 2;
-
- initnpctimer;
- startnpctimer;
- close;
- }
-
- if (.dir == 6)
- {
- .dir = 4;
-
- initnpctimer;
- startnpctimer;
- close;
- }
-}
-
-function script harbourTimer {
- stopnpctimer;
- if (.dir == 2) .dir = 6;
- if (.dir == 4) .dir = 0;
- end;
-}
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;
+}
+
+
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 9b2e106ac..48937d157 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -1,39 +1,10 @@
// TMW2 Script.
-// Evol functions.
// Authors:
-// Reid
// Jesusalva
// Description:
// Util functions
-// 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;
-}
// Returns Nard reputation for discounts
// Currently ranges from 0 to 15.
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 6222a4fed..9bc6c1f79 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -35,7 +35,6 @@
"npc/functions/doors.txt",
"npc/functions/fishing.txt",
"npc/functions/hammocks.txt",
-"npc/functions/harbours.txt",
"npc/functions/marriage.txt",
"npc/functions/mobpoint.txt",
"npc/functions/mobhunter.txt",
@@ -46,6 +45,7 @@
"npc/functions/questgen.txt",
"npc/functions/riddle.txt",
"npc/functions/savepoint.txt",
+"npc/functions/seasons.txt",
"npc/functions/shops.txt",
"npc/functions/soul_menhir.txt",