summaryrefslogtreecommitdiff
path: root/world/map
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2019-07-28 22:37:03 -0400
committergumi <git@gumi.ca>2019-07-28 23:23:57 -0400
commit2ef1fd30751136d66b336e888027e7365d3bc724 (patch)
tree6314b055edc6cc0f9bf010b3acad61649603ad9b /world/map
parent17744086c452e23bf1077acc3bdf806eb19751f4 (diff)
downloadserverdata-2ef1fd30751136d66b336e888027e7365d3bc724.tar.gz
serverdata-2ef1fd30751136d66b336e888027e7365d3bc724.tar.bz2
serverdata-2ef1fd30751136d66b336e888027e7365d3bc724.tar.xz
serverdata-2ef1fd30751136d66b336e888027e7365d3bc724.zip
fix miriam expiration
Diffstat (limited to 'world/map')
-rw-r--r--world/map/npc/006-1/miriam.txt36
-rw-r--r--world/map/npc/006-1/pachua.txt9
-rw-r--r--world/map/npc/013-2/notes.txt16
-rw-r--r--world/map/npc/functions/miriam.txt23
-rw-r--r--world/map/npc/functions/travelers.txt8
-rw-r--r--world/map/npc/items/warpTowels.txt8
-rw-r--r--world/map/npc/scripts.conf2
7 files changed, 39 insertions, 63 deletions
diff --git a/world/map/npc/006-1/miriam.txt b/world/map/npc/006-1/miriam.txt
index 5f474784..179cb89d 100644
--- a/world/map/npc/006-1/miriam.txt
+++ b/world/map/npc/006-1/miriam.txt
@@ -10,10 +10,9 @@
// 3 you brought the needed stuff. if you meet other criteria (BaseLevel, agi) you will be taught the skill
// 4 you have met the criteria of 3, but declined to take the speed test.
// 5 you tried the quest but you failed
-// QUEST_MIRIAM_start
-// a time in ticks. This is only !=0 if you started running to pachua.
// QUEST_MIRIAM_run
-// when you reach pachua, he stores the difference of start and arrival in here.
+// positive is the start time
+// negative is the time difference from start
//#############################################
// after you gained the speed skill, all variables are reset to zero.
//#############################################
@@ -31,8 +30,8 @@
if (QUEST_MIRIAM == 2) goto L_ask2;
if (QUEST_MIRIAM == 3) goto L_teach;
if (QUEST_MIRIAM == 4) goto L_testoffer;
- if (QUEST_MIRIAM_run != 0) goto L_checktime;
- if (QUEST_MIRIAM_start != 0) goto L_wasting;
+ if (QUEST_MIRIAM_run < 0) goto L_checktime;
+ if (QUEST_MIRIAM_run > 0) goto L_wasting;
if (QUEST_MIRIAM == 5) goto L_testoffer;
goto L_intro;
@@ -241,8 +240,7 @@ L_LetsDoThis:
warp "032-1",55,21;
npctalk strnpcinfo(0), "Run " +strcharinfo(0)+ ", run!";
set QUEST_MIRIAM, 5;
- set QUEST_MIRIAM_start, gettimetick(2);
- set QUEST_MIRIAM_cheat, 0;
+ set QUEST_MIRIAM_run, gettimetick(2);
end;
L_naked:
@@ -280,8 +278,8 @@ L_Close:
L_warning:
mes "[Miriam]";
mes "\"I know very well what you tried to do. I will not teach you the speed skill if you keep trying this kind of trick!\"";
- next;
- goto L_testoffer;
+ set QUEST_MIRIAM_run, 0;
+ close;
L_stretch:
mes "[Miriam]";
@@ -294,22 +292,31 @@ L_wasting:
mes "\"Don't waste your time talking to me! RUN and talk to Pachua!\"";
close;
+L_expired:
+ mes "[Miriam]";
+ mes "\"You could not reach Pachua in time. Try again some other time.\"";
+ set QUEST_MIRIAM_run, 0;
+ close;
+
L_checktime:
- if (QUEST_MIRIAM_cheat != 0)
+ set @miriam_run_secs, 0 - (QUEST_MIRIAM_run);
+ if (@miriam_run_secs == 1)
goto L_warning;
- if (QUEST_MIRIAM_run <= 210)
+ if (@miriam_run_secs <= 10)
+ goto L_expired;
+ if (@miriam_run_secs <= 210)
goto L_goodjob;
goto L_tryagain;
L_tryagain:
mes "[Miriam]";
- mes "\"You needed " + QUEST_MIRIAM_run + " seconds to reach Pachua. It is not enough.\"";
+ mes "\"You needed " + @miriam_run_secs + " seconds to reach Pachua. It is not enough.\"";
set QUEST_MIRIAM_run, 0;
close;
L_goodjob:
mes "[Miriam]";
- mes "\"Great job! You needed " + QUEST_MIRIAM_run + " seconds to reach Pachua. Very impressive for a person like you.\"";
+ mes "\"Great job! You needed " + @miriam_run_secs + " seconds to reach Pachua. Very impressive for a person like you.\"";
next;
mes "\"Now I need you to relax. Do NOT move. This teaching process can be painful sometimes.\"";
next;
@@ -319,20 +326,17 @@ L_goodjob:
close2;
warp "032-1",55,22;
// free all used player variables. This can be done, since there is a conditional on the speedskill at the beginning.
- set QUEST_MIRIAM_start, 0;
set QUEST_MIRIAM_run, 0;
set QUEST_MIRIAM, 0;
message strcharinfo(0), "[You gain 2500 experience points]";
message strcharinfo(0), "[You learned Speed Skill]";
setskill SKILL_SPEED, 1;
getexp 2500, 0;
- set QUEST_MIRIAM_cheat, 0; // reset just in case it is still set.
close;
L_fast:
mes "[Miriam]";
mes "\"I hope you make a good use of your new skill... Take care!\"";
- set QUEST_MIRIAM_cheat, 0; // reset just in case it is still set.
close;
}
diff --git a/world/map/npc/006-1/pachua.txt b/world/map/npc/006-1/pachua.txt
index f0230a7a..16c12c5e 100644
--- a/world/map/npc/006-1/pachua.txt
+++ b/world/map/npc/006-1/pachua.txt
@@ -9,8 +9,8 @@
set @LEATHER_PATCH_PRICE, 300;
set @wants_leather_patch, QUEST_Forestbow_state & NIBBLE_4_MASK;
- if (QUEST_MIRIAM_cheat != 0) goto L_warp_cheat;
- if (QUEST_MIRIAM_start != 0) goto L_smoke;
+ if (QUEST_MIRIAM_run == -1) goto L_warp_cheat;
+ if (QUEST_MIRIAM_run) goto L_smoke;
goto L_Begin;
L_Begin:
@@ -229,13 +229,10 @@ L_TooMany:
L_smoke:
message strcharinfo(0), "Pachua quickly inhales from his pipe and releases a ring of smoke towards the sky!";
- set QUEST_MIRIAM_run, gettimetick(2) - QUEST_MIRIAM_start;
- set QUEST_MIRIAM_start, 0;
+ callfunc "MiriamGoal";
end;
L_warp_cheat:
- if (@warp_cheat == 1) goto L_Begin;
message strcharinfo(0), "Pachua releases a ring of smoke towards the sky! But, by the look on his face, you can tell he is suspicious about your methods...";
- set @warp_cheat, 1;
end;
}
diff --git a/world/map/npc/013-2/notes.txt b/world/map/npc/013-2/notes.txt
index 988d2895..99de40df 100644
--- a/world/map/npc/013-2/notes.txt
+++ b/world/map/npc/013-2/notes.txt
@@ -72,19 +72,7 @@ L_Close:
next;
mes "You feel the floor disappear below your feet...";
next;
- if (QUEST_MIRIAM_start != 0)
- goto L_cheat;
- goto L_Warp;
-
-// If you try to use the notes to warp to pachua the quest will fail.
-L_cheat:
- set QUEST_MIRIAM_cheat, 1;
- set QUEST_MIRIAM_run, gettimetick(2) - QUEST_MIRIAM_start;
- set QUEST_MIRIAM_start, 0;
- message strcharinfo(0), "You were supposed to actually run to this place. You are not sure if this is going to work for Miriam...";
- goto L_Warp;
-
-L_Warp:
+ callfunc "MiriamCheat";
set @dest, rand(BaseLevel);
if (@dest < 10)
goto L_PlaceOne;
@@ -171,7 +159,7 @@ L_Close:
close;
}
-// Warp to mines
+// Warp to mines
013-2,26,28,0|script|Spell#wiz5|400
{
mes "You read: \"Darkness and legs, eight of them each - I'd rather not go there, but now it's too late...\"";
diff --git a/world/map/npc/functions/miriam.txt b/world/map/npc/functions/miriam.txt
index f458784d..b76efcc5 100644
--- a/world/map/npc/functions/miriam.txt
+++ b/world/map/npc/functions/miriam.txt
@@ -1,21 +1,20 @@
-function|script|MiriamExpire
+function|script|MiriamGoal
{
- if (QUEST_MIRIAM_start == 0) goto L_Return;
- set QUEST_MIRIAM_run, gettimetick(2) - QUEST_MIRIAM_start;
- set QUEST_MIRIAM_start, 0;
- goto L_Return;
+ if (QUEST_MIRIAM_run > 0)
+ set QUEST_MIRIAM_run, 0 - (gettimetick(2) - QUEST_MIRIAM_run);
+ return;
+}
-L_Return:
+function|script|MiriamExpire
+{
+ if (QUEST_MIRIAM_run > 0)
+ set QUEST_MIRIAM_run, 0 - 2; // force failute (expired)
return;
}
function|script|MiriamCheat
{
- if (QUEST_MIRIAM_start == 0) goto L_Return;
- set QUEST_MIRIAM_cheat, 1;
- callfunc "MiriamExpire";
- goto L_Return;
-
-L_Return:
+ if (QUEST_MIRIAM_run > 0)
+ set QUEST_MIRIAM_run, 0 - 1; // force failure (cheating)
return;
}
diff --git a/world/map/npc/functions/travelers.txt b/world/map/npc/functions/travelers.txt
index c1b7f3fd..30116ecb 100644
--- a/world/map/npc/functions/travelers.txt
+++ b/world/map/npc/functions/travelers.txt
@@ -180,13 +180,7 @@ L_TravelPachua:
set @NextLocationMap$, "006-1";
set @NextLocationX, 28;
set @NextLocationY, 97;
- if(QUEST_MIRIAM_start != 0) goto L_Cheat;
- goto L_TravelChecks;
-
-L_Cheat:
- set QUEST_MIRIAM_cheat, 1;
- set QUEST_MIRIAM_run, gettimetick(2) - QUEST_MIRIAM_start;
- set QUEST_MIRIAM_start, 0;
+ callfunc "MiriamCheat";
goto L_TravelChecks;
L_TravelBarbarians:
diff --git a/world/map/npc/items/warpTowels.txt b/world/map/npc/items/warpTowels.txt
index 461ac333..b6faaec3 100644
--- a/world/map/npc/items/warpTowels.txt
+++ b/world/map/npc/items/warpTowels.txt
@@ -101,13 +101,7 @@ L_Lime:
set @NextLocationMap$, "006-1";
set @NextLocationX, 28;
set @NextLocationY, 97;
- if(QUEST_MIRIAM_start != 0) goto L_Cheat;
- goto L_WarpPlayer;
-
-L_Cheat:
- set QUEST_MIRIAM_cheat, 1;
- set QUEST_MIRIAM_run, gettimetick(2) - QUEST_MIRIAM_start;
- set QUEST_MIRIAM_start, 0;
+ callfunc "MiriamCheat";
goto L_WarpPlayer;
L_Save:
diff --git a/world/map/npc/scripts.conf b/world/map/npc/scripts.conf
index b83692aa..e8743cd7 100644
--- a/world/map/npc/scripts.conf
+++ b/world/map/npc/scripts.conf
@@ -6,6 +6,7 @@ npc: npc/functions/barber.txt
npc: npc/functions/clear_vars.txt
npc: npc/functions/dailyquest.txt
npc: npc/functions/ferry.txt
+npc: npc/functions/miriam.txt
npc: npc/functions/travelers.txt
npc: npc/functions/game_rules.txt
npc: npc/functions/inn.txt
@@ -29,7 +30,6 @@ npc: npc/functions/DyeConfig.txt
npc: npc/functions/motd.txt
npc: npc/functions/motdconfig.txt
npc: npc/functions/ghost.txt
-npc: npc/functions/miriam.txt
npc: npc/functions/global_event_handler.txt
// Item Functions