summaryrefslogtreecommitdiff
path: root/world/map/npc/009-1
diff options
context:
space:
mode:
authorJessica Tölke <jtoelke@mail.upb.de>2013-02-12 23:06:27 +0100
committerJessica Tölke <jtoelke@mail.upb.de>2013-02-12 23:06:27 +0100
commit627a802f4eeb0872ab84d32ef952ca8884cea795 (patch)
treeb62300599d9f82f986769d0b501d9b18c83123f6 /world/map/npc/009-1
parent776515d46c6ffe47334537c32fc1b55f26fe47e4 (diff)
parente0e679a8a695641d1845c28bebe1c7e83c21a39f (diff)
downloadserverdata-627a802f4eeb0872ab84d32ef952ca8884cea795.tar.gz
serverdata-627a802f4eeb0872ab84d32ef952ca8884cea795.tar.bz2
serverdata-627a802f4eeb0872ab84d32ef952ca8884cea795.tar.xz
serverdata-627a802f4eeb0872ab84d32ef952ca8884cea795.zip
Merge branch 'variables'
Several older scripts were changed to use bitmasking for the player variables. Variables that are or became unused were added to the clear_vars function.
Diffstat (limited to 'world/map/npc/009-1')
-rw-r--r--world/map/npc/009-1/jack.txt63
-rw-r--r--world/map/npc/009-1/milly.txt18
-rw-r--r--world/map/npc/009-1/old_man.txt25
-rw-r--r--world/map/npc/009-1/old_woman.txt58
-rw-r--r--world/map/npc/009-1/sabine.txt18
5 files changed, 116 insertions, 66 deletions
diff --git a/world/map/npc/009-1/jack.txt b/world/map/npc/009-1/jack.txt
index 6f08c719..9e1ebbe1 100644
--- a/world/map/npc/009-1/jack.txt
+++ b/world/map/npc/009-1/jack.txt
@@ -15,6 +15,8 @@
// Lumberjack
009-1.gat,40,45,0|script|Jack|141,{
+ callfunc "ClearVariables";
+
set @RAWLOGS_AMOUNT, 40;
set @SHIELD_COST, 5000;
set @QUEST_SHIELD_EXP, 2500;
@@ -28,6 +30,8 @@
set @Q_Forestbow, ((QUEST_Forestbow_state & @Q_Forestbow_MASK) >> @Q_Forestbow_SHIFT);
set @Q_Woodenshield, ((QUEST_Forestbow_state & @Q_Woodenshield_MASK) >> @Q_Woodenshield_SHIFT);
+ set @inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
+
if (@Q_Woodenshield >= 3) goto L_Shield_state_3;
if (@Q_Woodenshield == 2) goto L_Shield_state_2;
if (@Q_Woodenshield == 1) goto L_Shield_state_1;
@@ -35,9 +39,11 @@
mes "[Jack Lumber]";
mes "\"Hello there, my name is Jack Lumber, the enemy of all trees. If you need some firewood just let me know.\"";
- if (Inspector == 1) callsub S_NohMask_Ask;
+ if (@inspector == 1)
+ callsub S_NohMask_Ask;
next;
- if (@Q_Forestbow < 1) close;
+ if (@Q_Forestbow < 1)
+ goto L_Close;
menu
"I heard you aren't delivering any more living wood. Why not?", -;
mes "[Jack Lumber]";
@@ -83,15 +89,16 @@
"Southwest you say? OK, thank you.", -;
set @Q_Forestbow, 2;
callsub S_Update_Mask;
- close;
+ goto L_Close;
L_Bow_state_2:
// Bow state 4: The player has found a perfect piece of wood.
if (@Q_Forestbow > 3) goto L_Bow_state_4;
mes "\"Good luck hunting those tree monsters - you will need it.\"";
- if (Inspector == 1) callsub S_NohMask_Ask;
- close;
+ if (@inspector == 1)
+ callsub S_NohMask_Ask;
+ goto L_Close;
L_Bow_state_4:
mes "[Jack Lumber]";
@@ -114,7 +121,7 @@ L_Bow_state_4:
L_Bow_state_4_reaffirm:
mes "[Jack Lumber]";
mes "\"You should go talk to Alan again.\"";
- close;
+ goto L_Close;
L_Shield_state_0:
set @Q_Woodenshield, 1;
@@ -134,24 +141,22 @@ L_Shield_state_1:
mes "[Jack Lumber]";
mes "\"I have an idea. What would you say about a new shield?\"";
next;
- if (Inspector == 1)
+ if (@inspector == 1)
menu
- "No thanks.", L_End,
- "Yes, please!", -,
+ "No thanks.", L_Close,
+ "Yes, please!", L_Yes,
"Actually, I'd like to know if you've seen any strange happenings in town.", L_NohMask_Answer;
- if (Inspector != 1)
- menu
- "No thanks.", L_End,
- "Yes, please!", -;
+ menu
+ "No thanks.", L_Close,
+ "Yes, please!", L_Yes;
+
+L_Yes:
mes "[Jack Lumber]";
mes "\"All I need is " + @RAWLOGS_AMOUNT + " raw logs. This needn't be highest-quality wood; pretty much any log you can find should work. Oh, and I'll also need " + @SHIELD_COST + " GP for other materials.\"";
next;
set @Q_Woodenshield, 2;
callsub S_Update_Mask;
- close;
-
-L_End:
- close;
+ goto L_Close;
L_Shield_state_2:
mes "[Jack Lumber]";
@@ -187,33 +192,35 @@ L_Shield_state_2:
mes "\"Enjoy your new shield!\"";
mes "[" + @QUEST_SHIELD_EXP + " experience points]";
next;
- goto L_End;
+ goto L_Close;
L_Not_enough_logs:
mes "[Jack Lumber]";
mes "\"You don't have enough wood for me to craft this shield; I need a total of " + @RAWLOGS_AMOUNT + " raw logs.\"";
- close;
+ goto L_Close;
L_Not_enough_money:
mes "[Jack Lumber]";
mes "\"You don't have enough gold, I'm afraid. I need " + @SHIELD_COST + " GP to finish your shield.\"";
- close;
+ goto L_Close;
L_TooMany:
mes "[Jack Lumber]";
mes "\"You don't have enough room for the shield. Come back when you do.\"";
- close;
+ goto L_Close;
L_Shield_state_3:
mes "[Jack Lumber]";
mes "\"I hope that my shield will serve you well!\"";
+ if (@inspector != 1)
+ goto L_Close;
next;
- if (Inspector == 1)
- menu
- "Me too.", -,
- "Have you seen anything that might be connected to the recent robberies in town?", L_NohMask_Answer;
- close;
+ menu
+ "Me too.", L_Close,
+ "Have you seen anything that might be connected to the recent robberies in town?", L_NohMask_Answer;
+// This is an ugly violation of the scripting standards,
+// but it's somewhat complicated to fix.
S_NohMask_Ask:
next;
menu
@@ -224,6 +231,10 @@ S_NohMask_Ask:
L_NohMask_Answer:
mes "[Jack Lumber]";
mes "\"Sorry, no.\"";
+ goto L_Close;
+
+L_Close:
+ set @inspector, 0;
close;
S_Update_Mask:
diff --git a/world/map/npc/009-1/milly.txt b/world/map/npc/009-1/milly.txt
index 1f75eed2..df0d31be 100644
--- a/world/map/npc/009-1/milly.txt
+++ b/world/map/npc/009-1/milly.txt
@@ -1,24 +1,30 @@
009-1.gat,81,41,0|script|Milly|114,{
+ callfunc "ClearVariables";
+
+ set @inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
+
mes "[Milly]";
mes "\"Hello.\"";
next;
- if (Inspector == 1) goto L_NohMask;
- close;
+ if (@inspector != 1)
+ goto L_Close;
-L_NohMask:
menu
"Have you seen anything strange lately?", L_NohMask_Strange,
"Do you know anything about the recent robberies?", L_NohMask_Robbery,
- "Hello", -;
- close;
+ "Hello.", L_Close;
L_NohMask_Strange:
mes "[Milly]";
mes "\"I haven't seen anything strange.\"";
- close;
+ goto L_Close;
L_NohMask_Robbery:
mes "[Milly]";
mes "\"No, sorry.\"";
+ goto L_Close;
+
+L_Close:
+ set @inspector, 0;
close;
}
diff --git a/world/map/npc/009-1/old_man.txt b/world/map/npc/009-1/old_man.txt
index 97679b35..e799cc89 100644
--- a/world/map/npc/009-1/old_man.txt
+++ b/world/map/npc/009-1/old_man.txt
@@ -1,34 +1,41 @@
// Old man
009-1.gat,85,51,0|script|Old Man|159,{
+ callfunc "ClearVariables";
+
+ set @inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
+
mes "[Old Man]";
mes "\"Don't let those monsters get to you.\"";
next;
- if (Inspector == 1) goto L_NohMask_Ask;
- if (Inspector == 6) goto L_NohMask_Accuse;
- close;
+ if (@inspector == 1) goto L_NohMask_Ask;
+ if (@inspector == 6) goto L_NohMask_Accuse;
+ goto L_Close;
L_NohMask_Ask:
menu
"Have you seen anything strange lately?", L_NohMask_Ask_Nothing,
"Do you know anything about the recent robberies?", L_NohMask_Ask_Nothing,
- "I won't, thank you.", -;
- close;
+ "I won't, thank you.", L_Close;
L_NohMask_Ask_Nothing:
mes "[Old Man]";
mes "\"I'm sorry, but I didn't see anything. You should ask my old woman.\"";
- close;
+ goto L_Close;
L_NohMask_Accuse:
menu
"The leader of the troupe said you hung around them a lot while they were in town.", L_NohMask_Accuse_Respond,
- "I won't, thank you.", -;
- close;
+ "I won't, thank you.", L_Close;
L_NohMask_Accuse_Respond:
mes "[Old Man]";
mes "\"Yes, I hung around the theater a lot. I was an actor when I was younger. But I wasn't there that night. Me and the wife were at home all night.\"";
- set Inspector, 7;
+ set @inspector, 7;
+ set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_3_MASK)) | (@inspector << NIBBLE_3_SHIFT);
+ goto L_Close;
+
+L_Close:
+ set @inspector, 0;
close;
}
diff --git a/world/map/npc/009-1/old_woman.txt b/world/map/npc/009-1/old_woman.txt
index abca82c4..fbd0e7aa 100644
--- a/world/map/npc/009-1/old_woman.txt
+++ b/world/map/npc/009-1/old_woman.txt
@@ -1,68 +1,88 @@
// Old woman
009-1.gat,29,43,0|script|Old Woman|154,{
+ callfunc "ClearVariables";
+
+ set @inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
+
if (BaseLevel < 40) goto L_Lower;
mes "[Old Woman]";
mes "\"Hello deary.\"";
next;
-
-L_Continue:
- if ((Inspector >= 1 && Inspector <= 7) || Inspector == 9) goto L_NohMask;
- close;
+ goto L_Continue;
L_Lower:
mes "[Old Woman]";
mes "\"Watch out for these flowers. They don't like to be messed with.\"";
next;
- goto L_Continue;
+
+L_Continue:
+ if ((@inspector >= 1 && @inspector <= 7) || @inspector == 9)
+ goto L_NohMask;
+ goto L_Close;
L_NohMask:
- if (Inspector == 7) goto L_NohMask_Alibi;
+ if (@inspector == 7)
+ goto L_NohMask_Alibi;
callfunc "ProcessEquip";
if (@torsoC == cDarkBlue && @legsC == cDarkBlue)
goto L_NohMask_Fake;
- if (Inspector >= 3 && Inspector <= 6) close;
+ if (@inspector >= 3 && @inspector <= 6)
+ goto L_Close;
menu
"Have you seen anything strange lately?", L_NohMask_FirstAsk,
"Do you know anything about the recent robberies?", L_NohMask_FirstAsk,
- "Hello", -;
- close;
+ "Hello", L_Close;
L_NohMask_FirstAsk:
mes "[Old Woman]";
mes "\"Yes, but I'm only talking to the inspector himself!\"";
- if (Inspector == 1) set Inspector, 2;
- close;
+ if (@inspector != 1)
+ goto L_Close;
+ set @inspector, 2;
+ callsub S_Update_Mask;
+ goto L_Close;
L_NohMask_Alibi:
menu
"Was your husband with you at home all night the last night that the troupe was in town?", -;
mes "[Old Woman]";
mes "\"Yes, we were both at home all night.\"";
- set Inspector, 8;
- close;
+ set @inspector, 8;
+ callsub S_Update_Mask;
+ goto L_Close;
L_NohMask_Fake:
- if (Inspector == 9) goto L_NohMask_Fake_Satchel;
- if (Inspector >= 3 && Inspector <= 6) goto L_NohMask_Filler;
+ if (@inspector == 9) goto L_NohMask_Fake_Satchel;
+ if (@inspector >= 3 && @inspector <= 6) goto L_NohMask_Filler;
mes "[Old Woman]";
mes "\"I saw someone sneaking around town wearing a theater mask. It looked like one of the masks used by the troupe that was in town recently.\"";
- set Inspector, 3;
- close;
+ set @inspector, 3;
+ callsub S_Update_Mask;
+ goto L_Close;
L_NohMask_Filler:
mes "[Old Woman]";
mes "\"I hope you catch that naughty person!\"";
- close;
+ goto L_Close;
L_NohMask_Fake_Satchel:
mes "[Old Woman]";
mes "\"I've remembered something else. The night the troupe left, I saw someone with a theater mask take a large satchel out of town. He was heading north.\"";
- set Inspector, 10;
+ set @inspector, 10;
+ callsub S_Update_Mask;
+ goto L_Close;
+
+L_Close:
+ set @inspector, 0;
close;
+S_Update_Mask:
+ set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_3_MASK)) | (@inspector << NIBBLE_3_SHIFT);
+ return;
+
OnPCDieEvent:
if (countitem(E10_TOKEN_ID) < 1) end;
delitem E10_TOKEN_ID, 1;
diff --git a/world/map/npc/009-1/sabine.txt b/world/map/npc/009-1/sabine.txt
index 9fa5e20f..d67c55b0 100644
--- a/world/map/npc/009-1/sabine.txt
+++ b/world/map/npc/009-1/sabine.txt
@@ -1,26 +1,32 @@
// Girl sitting on bench
009-1.gat,88,27,0|script|Sabine|106,{
+ callfunc "ClearVariables";
+
+ set @inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
+
mes "[Sabine]";
mes "\"Isn't this place pretty? I love hanging out here!\"";
next;
- if (Inspector == 1) goto L_NohMask;
- close;
+ if (@inspector != 1)
+ goto L_Close;
-L_NohMask:
menu
"Have you seen anything strange lately?", L_NohMask_Strange,
"Do you know anything about the recent robberies?", L_NohMask_Robbery,
- "Yes, it is.", -;
- close;
+ "Yes, it is.", L_Close;
L_NohMask_Strange:
mes "[Sabine]";
mes "\"I haven't seen anything strange.\"";
- close;
+ goto L_Close;
L_NohMask_Robbery:
mes "[Sabine]";
mes "\"No, sorry.\"";
+ goto L_Close;
+
+L_Close:
+ set @inspector, 0;
close;
}