From e6db4af9d0873d1b1b31680d54e5f8452000ea2b Mon Sep 17 00:00:00 2001 From: Jessica Tölke Date: Thu, 7 Feb 2013 16:27:45 +0100 Subject: Variable restructuring: move Inspector quest to nibble 3 of QUEST_Hurnscald. --- world/map/npc/009-1/jack.txt | 49 +++++++++++++++++++-------------- world/map/npc/009-1/milly.txt | 18 ++++++++---- world/map/npc/009-1/old_man.txt | 25 +++++++++++------ world/map/npc/009-1/old_woman.txt | 58 ++++++++++++++++++++++++++------------- world/map/npc/009-1/sabine.txt | 18 ++++++++---- 5 files changed, 107 insertions(+), 61 deletions(-) (limited to 'world/map/npc/009-1') diff --git a/world/map/npc/009-1/jack.txt b/world/map/npc/009-1/jack.txt index 6f08c719..4ccc5d82 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,21 @@ 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, + "No thanks.", L_Close, "Yes, please!", -, "Actually, I'd like to know if you've seen any strange happenings in town.", L_NohMask_Answer; - if (Inspector != 1) + if (@inspector != 1) menu - "No thanks.", L_End, + "No thanks.", L_Close, "Yes, please!", -; 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,32 +191,31 @@ 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!\""; next; - if (Inspector == 1) + if (@inspector == 1) menu - "Me too.", -, + "Me too.", L_Close, "Have you seen anything that might be connected to the recent robberies in town?", L_NohMask_Answer; - close; S_NohMask_Ask: next; @@ -224,6 +227,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; } -- cgit v1.2.3-60-g2f50 From 2c8e25d9b2efd1d8f051db3bd1c7676a044994f1 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 12 Feb 2013 00:24:41 -0800 Subject: o11c's review of inspector --- world/map/npc/009-1/jack.txt | 22 +++++++++++++--------- world/map/npc/009-2/alan.txt | 9 +++++---- world/map/npc/018-2/receptionist.txt | 12 +++++------- 3 files changed, 23 insertions(+), 20 deletions(-) (limited to 'world/map/npc/009-1') diff --git a/world/map/npc/009-1/jack.txt b/world/map/npc/009-1/jack.txt index 4ccc5d82..9e1ebbe1 100644 --- a/world/map/npc/009-1/jack.txt +++ b/world/map/npc/009-1/jack.txt @@ -144,12 +144,13 @@ L_Shield_state_1: if (@inspector == 1) menu "No thanks.", L_Close, - "Yes, please!", -, + "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_Close, - "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; @@ -211,12 +212,15 @@ L_TooMany: 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.", L_Close, - "Have you seen anything that might be connected to the recent robberies in town?", L_NohMask_Answer; + 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 diff --git a/world/map/npc/009-2/alan.txt b/world/map/npc/009-2/alan.txt index 65a36c0d..53715527 100644 --- a/world/map/npc/009-2/alan.txt +++ b/world/map/npc/009-2/alan.txt @@ -202,11 +202,12 @@ L_State_4_TooMany: L_State_5: mes "[Alan]"; mes "\"I hope you are satisfied with your forest bow. It is one of my best works.\""; + if (@inspector != 1) + goto L_Close; next; - if (@inspector == 1) - menu - "I am!", L_Close, - "Have you seen anything strange recently that might be connected to the robberies?", L_NohMask_Answer; + menu + "I am!", L_Close, + "Have you seen anything strange recently that might be connected to the robberies?", L_NohMask_Answer; L_NohMask_Answer: mes "[Alan]"; diff --git a/world/map/npc/018-2/receptionist.txt b/world/map/npc/018-2/receptionist.txt index e36fe0c4..5f03c4b1 100644 --- a/world/map/npc/018-2/receptionist.txt +++ b/world/map/npc/018-2/receptionist.txt @@ -18,13 +18,11 @@ L_Menu: "Did the company build this building?", L_Building, "Did you hear a commotion here the other night?", L_NohMask, "Thank you, no.", L_Close; - if (@inspector != 10) - menu - "Why was a mine setup here?", L_Mine, - "Can I go into the mine?", L_Enter, - "Did the company build this building?", L_Building, - "Thank you, no.", L_Close; - goto L_Close; + menu + "Why was a mine setup here?", L_Mine, + "Can I go into the mine?", L_Enter, + "Did the company build this building?", L_Building, + "Thank you, no.", L_Close; L_Mine: mes "[Receptionist]"; -- cgit v1.2.3-60-g2f50