summaryrefslogtreecommitdiff
path: root/world/map/npc
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc')
-rw-r--r--world/map/npc/001-1/bernard.txt35
-rw-r--r--world/map/npc/001-1/mikhail.txt54
-rw-r--r--world/map/npc/021-2/kylian.txt7
3 files changed, 62 insertions, 34 deletions
diff --git a/world/map/npc/001-1/bernard.txt b/world/map/npc/001-1/bernard.txt
index 23b39f5c..0d65e6d2 100644
--- a/world/map/npc/001-1/bernard.txt
+++ b/world/map/npc/001-1/bernard.txt
@@ -1,10 +1,16 @@
-//
+// Variables used: nibble 0 of QUEST_SouthTulimshar
001-1.gat,37,44,0|script|Bernard|117,{
- if(TMW_Quest >= 4) goto L_Done2;
- if(TMW_Quest == 3) goto L_Progress2;
- if(TMW_Quest == 2) goto L_Done1;
- if(TMW_Quest == 1) goto L_Progress;
+
+ // This NPC previously used the variable TMW_Quest
+ callfunc "ClearVarTMW_Quest";
+
+ set @state, ((QUEST_SouthTulimshar & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
+
+ if(@state >= 4) goto L_Done2;
+ if(@state == 3) goto L_Progress2;
+ if(@state == 2) goto L_Done1;
+ if(@state == 1) goto L_Progress;
set @TEMP, rand(2);
if(@TEMP == 0) goto L_Opening0;
@@ -45,7 +51,8 @@ L_Req1:
goto L_Set;
L_Set:
- set TMW_Quest,1;
+ set @state, 1;
+ callsub S_Update_Var;
mes "[Bernard]";
mes "\"Please bring it to me!\"";
goto L_Close;
@@ -60,7 +67,10 @@ L_Progress:
delitem "RoastedMaggot", 1;
getexp 100, 0;
getitem "CherryCake", 5;
- set TMW_Quest, 2;
+ set @state, 2;
+ callsub S_Update_Var;
+ next;
+ mes "\"Now let's see...\"";
goto L_Close;
L_Progress2:
@@ -73,7 +83,8 @@ L_Progress2:
delitem "MaggotSlime", 3;
getexp 100, 0;
getitem "Beer", 3;
- set TMW_Quest, 4;
+ set @state, 4;
+ callsub S_Update_Var;
goto L_Close;
L_NotEnough:
@@ -93,7 +104,8 @@ L_Done1:
next;
mes "\"I need 3 Maggot Slimes for that.\"";
mes "\"Bring them to me, and I'll give you something nice.\"";
- set TMW_Quest,3;
+ set @state, 3;
+ callsub S_Update_Var;
goto L_Close;
L_Done2:
@@ -105,6 +117,7 @@ L_Done2:
L_Close:
set @TEMP, 0;
+ set @state, 0;
close;
L_TooMany:
@@ -112,4 +125,8 @@ L_TooMany:
mes "[Bernard]";
mes "\"You don't have room for my reward. I'll wait until you do.\"";
goto L_Close;
+
+S_Update_Var:
+ set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_0_MASK) | (@state << NIBBLE_0_SHIFT));
+ return;
}
diff --git a/world/map/npc/001-1/mikhail.txt b/world/map/npc/001-1/mikhail.txt
index ced945cf..8e6b6aec 100644
--- a/world/map/npc/001-1/mikhail.txt
+++ b/world/map/npc/001-1/mikhail.txt
@@ -1,21 +1,23 @@
-//
+// Variables used: nibble 0 of QUEST_SouthTulimshar
001-1.gat,50,46,0|script|Mikhail|120,{
- if (TMW_Quest >= 6) goto L_Done;
- if (TMW_Quest == 5) goto L_Progress;
- if (TMW_Quest == 4) goto L_Start;
- if (TMW_Quest < 4) goto L_Convince_Mikhail_First;
- // If this happens, something is wrong with the above case handling.
- mes "Mikhail looks confused.";
- close;
+ // This NPC previously used the variable TMW_Quest
+ callfunc "ClearVarTMW_Quest";
+
+ set @state, ((QUEST_SouthTulimshar & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
+
+ if (@state >= 6) goto L_Done;
+ if (@state == 5) goto L_Progress;
+ if (@state == 4) goto L_Start;
+ if (@state < 4) goto L_Convince_Mikhail_First;
L_Convince_Mikhail_First:
mes "[Mikhail]";
mes "\"Hello...\"";
mes "";
mes "It seems that the boy would like to say more, but does not dare to open up to you. Maybe you should help someone else first, so that he sees your intentions are good.";
- close;
+ goto L_Close;
L_Start:
mes "[Mikhail]";
@@ -24,16 +26,13 @@ L_Start:
mes "\"You look like a nice person. Would you go get them for me?\"";
menu
"Of course, I'll go get them for you.", L_accept,
- "I've got other things to do right now.", L_close;
- close;
-
-L_close:
- close;
+ "I've got other things to do right now.", L_Close;
L_accept:
mes "[Mikhail]";
mes "\"Thank you so much! I'll wait for you here.\"";
- set TMW_Quest, 5;
+ set @state, 5;
+ callsub S_Update_Var;
close;
L_Progress:
@@ -42,27 +41,34 @@ L_Progress:
next;
menu
"Yes, here they are, kiddo!", L_try,
- "Not yet, but I'll be back soon.", L_close;
- close;
+ "Not yet, but I'll be back soon.", L_Close;
L_try:
- if countitem("MaggotSlime") >= 5 goto L_get;
+ if countitem("MaggotSlime") >= 5
+ goto L_get;
mes "[Mikhail]";
mes "\"It doesn't look like you have them all...\"";
- close;
+ goto L_Close;
L_get:
delitem "MaggotSlime", 5;
- set TMW_Quest, 6;
+ getexp 100, 0;
+ set @state, 6;
+ callsub S_Update_Var;
mes "[Mikhail]";
mes "\"Ooh! Thank you so much! I can get back to my grandma now!\"";
- next;
- getexp 100, 0;
- mes "You get 100 xp.";
- close;
+ goto L_Close;
L_Done:
mes "[Mikhail]";
mes "\"Thanks again for helping me get those Maggot Slimes!\"";
+ goto L_Close;
+
+L_Close:
+ set @state, 0;
close;
+
+S_Update_Var:
+ set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_0_MASK) | (@state << NIBBLE_0_SHIFT));
+ return;
}
diff --git a/world/map/npc/021-2/kylian.txt b/world/map/npc/021-2/kylian.txt
index 2f5b903a..737214a5 100644
--- a/world/map/npc/021-2/kylian.txt
+++ b/world/map/npc/021-2/kylian.txt
@@ -70,6 +70,10 @@ OnInit:
set @fun_money, 50;
set @fun_exp, 20;
+ // This NPC previously used the variable TMW_Quest
+ callfunc "ClearVarTMW_Quest";
+ set @bernard, ((QUEST_SouthTulimshar & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
+
if (@state == 9) goto L_Done;
if (@KylianNTCasino) goto L_CasinoDone;
if (@state == 8) goto L_DesertHat;
@@ -166,7 +170,7 @@ L_SightSeeing: // @state == 4 and logged out sometime between getting to that st
L_Food: // @state == 5
mes "[Kylian]";
mes "\"While I'm out, I could also get something to eat. Maybe some typical dish for this region. Do you have a good suggestion for that?\"";
- if (TMW_Quest < 4) // didn't yet help Bernard to make his soup
+ if (@bernard < 4) // didn't yet help Bernard to make his soup
goto L_Close;
menu
"Bernard on the bazaar makes a great soup.",-,
@@ -265,6 +269,7 @@ L_Close:
set @fun_money, 0;
set @fun_exp, 0;
set @inventorylist_count, 0;
+ set @bernard, 0;
// NOT set to zero: @KylianNTLicense, @KylianNTSightSeeing and @KylianNTCasino
// those are used to check if the player logged out in the meanwhile
close;