summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/constants.conf6
-rw-r--r--db/quest_db.conf6
-rw-r--r--npc/012-1/_import.txt1
-rw-r--r--npc/012-1/lufix.txt30
-rw-r--r--npc/functions/util.txt25
5 files changed, 55 insertions, 13 deletions
diff --git a/db/constants.conf b/db/constants.conf
index 820356e51..95b3bc3e3 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -3841,6 +3841,12 @@ constants_db: {
RIGHT: 6
DOWNRIGHT: 7
+ comment__: "seasons"
+ WINTER: 0
+ SPRING: 1
+ SUMMER: 2
+ AUTUMN: 3
+
comment__: "speechflags"
S_FIRST_BLANK_LINE: 1
S_LAST_BLANK_LINE: 2
diff --git a/db/quest_db.conf b/db/quest_db.conf
index 6c5535d82..207e29c8a 100644
--- a/db/quest_db.conf
+++ b/db/quest_db.conf
@@ -238,6 +238,12 @@ quest_db: (
Id: 193
Name: "MineQuest_Miner"
},
+// ID 300 to 320: Seasonal/Annual quests
+{
+ Id: 300
+ Name: "SQuest_Summer"
+},
+
// ID 1000+: Test quests
{
Id: 1000
diff --git a/npc/012-1/_import.txt b/npc/012-1/_import.txt
index 2742626a1..266454f96 100644
--- a/npc/012-1/_import.txt
+++ b/npc/012-1/_import.txt
@@ -9,6 +9,7 @@
"npc/012-1/hinnak.txt",
"npc/012-1/jack.txt",
"npc/012-1/locamit.txt",
+"npc/012-1/lufix.txt",
"npc/012-1/mapflags.txt",
"npc/012-1/richard.txt",
"npc/012-1/ship.txt",
diff --git a/npc/012-1/lufix.txt b/npc/012-1/lufix.txt
new file mode 100644
index 000000000..8647b3ab3
--- /dev/null
+++ b/npc/012-1/lufix.txt
@@ -0,0 +1,30 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// Description:
+// Hunt mouboos, Summer Quest
+
+012-1,68,74,0 script Lufix NPC_RAIJIN,{
+ mesn;
+ if (season() == SUMMER) {
+ mesq l("Yay it's summer");
+ } else {
+ mesq l("Aww it's not summer");
+ }
+ close;
+
+OnInit:
+ .@npcId = getnpcid(0, .name$);
+ setunitdata(.@npcId, UDT_HEADTOP, CommunityShirt);
+ setunitdata(.@npcId, UDT_HEADMIDDLE, JeansChaps);
+ setunitdata(.@npcId, UDT_HEADBOTTOM, DeepBlackBoots);
+ setunitdata(.@npcId, UDT_WEAPON, BugSlayer);
+ setunitdata(.@npcId, UDT_HAIRSTYLE, 13);
+ setunitdata(.@npcId, UDT_HAIRCOLOR, 7);
+
+ .distance=4;
+ .sex=G_MALE;
+ end;
+
+}
+
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 5ff544f17..c7a9c3c90 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -7,29 +7,28 @@
// Util functions
-// season_direction({day, month})
-// returns the direction that represents our current season (approximation)
-// DOWN: Winter, 21/12
-// DOWNLEFT: Spring, 20/03
-// LEFT: Summer, 21/06
-// UPLEFT: Autumn, 22/09
-
-function script season_direction {
+// 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)
- {
+ if (.@current_month % 3 == 0) {
.@current_day = getarg(1, gettime(GETTIME_DAYOFMONTH));
- switch (.@current_month)
- {
+ 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;
}