summaryrefslogtreecommitdiff
path: root/world/map/npc/018-2
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-04-02 11:06:32 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-04-02 22:21:29 -0700
commitc0ba38cd4b68491e28e467889804ebc09c9c002e (patch)
treeaf2890e6fe20990d2a9b7c94b991be58f25a5d52 /world/map/npc/018-2
parent514a2f05cb335c1e9210fea58bc9a9a58478283f (diff)
downloadserverdata-c0ba38cd4b68491e28e467889804ebc09c9c002e.tar.gz
serverdata-c0ba38cd4b68491e28e467889804ebc09c9c002e.tar.bz2
serverdata-c0ba38cd4b68491e28e467889804ebc09c9c002e.tar.xz
serverdata-c0ba38cd4b68491e28e467889804ebc09c9c002e.zip
Clean up main scripts
Diffstat (limited to 'world/map/npc/018-2')
-rw-r--r--world/map/npc/018-2/caul.txt79
-rw-r--r--world/map/npc/018-2/miners.txt23
-rw-r--r--world/map/npc/018-2/receptionist.txt5
3 files changed, 69 insertions, 38 deletions
diff --git a/world/map/npc/018-2/caul.txt b/world/map/npc/018-2/caul.txt
index a599f5f8..e8143971 100644
--- a/world/map/npc/018-2/caul.txt
+++ b/world/map/npc/018-2/caul.txt
@@ -54,6 +54,7 @@
set @choice_idx[@choices_nr], @C_monster_oil;
set @choice$[@choices_nr], "I would like to brew Monster Oil.";
set @choices_nr, @choices_nr + 1;
+ goto L_M_no_monster_oil;
L_M_no_monster_oil:
if (!@Q_knows_mopox_cure)
@@ -62,6 +63,7 @@ L_M_no_monster_oil:
set @choice_idx[@choices_nr], @C_mopox_cure;
set @choice$[@choices_nr], "I would like to brew a Mopox Cure Potion.";
set @choices_nr, @choices_nr + 1;
+ goto L_M_no_mopox_cure;
L_M_no_mopox_cure:
if (@inspector != 10)
@@ -70,6 +72,7 @@ L_M_no_mopox_cure:
set @choice_idx[@choices_nr], @C_nohmask;
set @choice$[@choices_nr], "Actually...";
set @choices_nr, @choices_nr + 1;
+ goto L_M_no_inspector;
L_M_no_inspector:
if (!(MAGIC_FLAGS & MFLAG_KNOWS_UNFOCUS_RECIPE))
@@ -78,6 +81,7 @@ L_M_no_inspector:
set @choice_idx[@choices_nr], @C_dementiapotion;
set @choice$[@choices_nr], "I would like to brew a Dementia Potion.";
set @choices_nr, @choices_nr + 1;
+ goto L_M_no_dempo;
L_M_no_dempo:
set @choice_idx[@choices_nr], @C_bye;
@@ -85,15 +89,16 @@ L_M_no_dempo:
set @choices_nr, @choices_nr + 1;
menu
- @choice$[0], -,
- @choice$[1], -,
- @choice$[2], -,
- @choice$[3], -,
- @choice$[4], -,
- @choice$[5], -,
- @choice$[6], -,
- @choice$[7], -;
-
+ @choice$[0], L_MenuItems,
+ @choice$[1], L_MenuItems,
+ @choice$[2], L_MenuItems,
+ @choice$[3], L_MenuItems,
+ @choice$[4], L_MenuItems,
+ @choice$[5], L_MenuItems,
+ @choice$[6], L_MenuItems,
+ @choice$[7], L_MenuItems;
+
+L_MenuItems:
set @choice, @choice_idx[@menu - 1];
if (@choice == @C_monster_oil)
@@ -111,6 +116,7 @@ L_M_no_dempo:
set @num, @choice;
if (@num == 0)
goto L_close;
+ goto L_brew;
L_brew:
mes "[Caul]";
@@ -131,6 +137,7 @@ L_brew:
set @result2, 0;
set @result3, 0;
set @result4, 0;
+ goto L_CraftLoop;
L_CraftLoop:
set @throw, rand(readparam(bInt));
@@ -192,6 +199,7 @@ L_monster_oil_knows_recipe:
mes "\"Ah, but of course! Yes, we should be able to brew that here. Except that... hmm. Pearl and three black scorpion stingers? This sounds very dangerous;";
mes "I fear that I will have to ask you to do this yourself.\"";
next;
+ goto L_monster_oil_main_menu;
L_monster_oil_main_menu:
set @main_menu, 1;
@@ -202,7 +210,6 @@ L_monster_oil_main_menu:
"Let's start!", L_monster_oil_start_brew,
"Where can I get a golden scorpion stinger?", L_monster_oil_where_gold,
"I've changed my mind.", L_close;
- close;
L_monster_oil_why_dangerous:
mes "[Caul]";
@@ -321,8 +328,9 @@ L_monster_oil_loop:
"Add cobalt leaf", L_monster_oil_cobalt,
"Add mauve leaf", L_monster_oil_mauve,
"Ask Caul for advice", L_monster_oil_explain,
- "Duck!", -;
+ "Duck!", L_Explodes;
+L_Explodes:
mes "[Brewing monster oil]";
mes "You throw yourself onto the ground. Seconds later, the cauldron shakes, and your entire mixture explodes upwards.";
mes "Caul crawls out from underneath a char.";
@@ -388,6 +396,7 @@ S_monster_oil_random_move:
if (@auto_mode == 1)
goto L_monster_oil_random_1;
+ goto L_monster_oil_random_0;
L_monster_oil_random_0: // mode 0: add colour or lighten up
set @auto_mode, 1;
@@ -506,14 +515,14 @@ L_mopox_cure_start:
mes "\"The mopox cure potion? Certainly, if you have all of the ingredients... oh, and make sure to bring water, roots, sulphur powder and Mauve leaves.\"";
mes "\"This is a very easy one, so I think I should let you do this yourself. It is very good exercise.\"";
next;
+ goto L_mopox_cure_overview_menu;
L_mopox_cure_overview_menu:
menu
"I'm ready!", L_mopox_cure_setup,
"What are the ingredients?", L_mopox_cure_ingredients,
"How does this work?", L_mopox_cure_howto,
- "I'd rather not try.", -;
- close;
+ "I'd rather not try.", L_close;
L_mopox_cure_ingredients:
mes "[Caul]";
@@ -584,6 +593,7 @@ L_mopox_cure_setup:
if (@stickiness == 3 && @colour == 3)
set @colour, 4; // don't allow insta-win; it's easy enough.
set @rounds, 0;
+ goto L_mopox_cure_loop;
L_mopox_cure_loop:
mes "[Brewing Mopox Cure]";
@@ -602,7 +612,7 @@ L_mopox_cure_loop:
"Add sulphur powder", L_mopox_B_sulphur,
"Add mauve", L_mopox_B_mauve,
"...what should I do again?", L_mopox_reexplain,
- "Wait", -;
+ "Wait", L_mopox_cure_next;
L_mopox_cure_next:
set @stickiness, @stickiness + @rounds;
@@ -729,6 +739,7 @@ L_mopox_cure_win:
getexp @MOPOX_CURE_XP, 0;
mes "[" + @MOPOX_CURE_XP + " experience points]";
set QUEST_MAGIC2, (QUEST_MAGIC2 & ~NIBBLE_3_MASK) | (2 << NIBBLE_3_SHIFT); // Make sure we can only get XP for brewing this once
+ goto L_mopox_cure_win_quick;
L_mopox_cure_win_quick:
close;
@@ -741,8 +752,7 @@ L_DemPotion:
menu
"Please explain to me what you know about that potion.", L_explain_dempo,
"Ok, I will start brewing.", L_brew_dempo_init,
- "Nevermind", -;
- close;
+ "Nevermind", L_close;
L_explain_dempo:
mes "[Caul]";
@@ -825,6 +835,7 @@ L_brew_dempo:
set @choice_idx[@choices_nr], @C_root;
set @choice$[@choices_nr], "Add a root";
set @choices_nr, @choices_nr + 1;
+ goto L_noroots;
L_noroots:
if (countitem("MauveHerb") == 0)
@@ -832,6 +843,7 @@ L_noroots:
set @choice_idx[@choices_nr], @C_mauve;
set @choice$[@choices_nr], "Add a mauve herb";
set @choices_nr, @choices_nr + 1;
+ goto L_nomauve;
L_nomauve:
if (countitem("Lifestone") == 0)
@@ -839,6 +851,7 @@ L_nomauve:
set @choice_idx[@choices_nr], @C_lifestone;
set @choice$[@choices_nr], "Add a lifestone";
set @choices_nr, @choices_nr + 1;
+ goto L_nolifestone;
L_nolifestone:
if (countitem("DiseasedHeart") == 0)
@@ -846,6 +859,7 @@ L_nolifestone:
set @choice_idx[@choices_nr], @C_diseasedheart;
set @choice$[@choices_nr], "Add a diseased heart";
set @choices_nr, @choices_nr + 1;
+ goto L_noheart;
L_noheart:
if (countitem("Bone") == 0)
@@ -853,6 +867,7 @@ L_noheart:
set @choice_idx[@choices_nr], @C_bone;
set @choice$[@choices_nr], "Add a bone";
set @choices_nr, @choices_nr + 1;
+ goto L_nobone;
L_nobone:
if (countitem("Skull") == 0)
@@ -860,6 +875,7 @@ L_nobone:
set @choice_idx[@choices_nr], @C_skull;
set @choice$[@choices_nr], "Add a skull";
set @choices_nr, @choices_nr + 1;
+ goto L_noskull;
L_noskull:
if (countitem("UndeadEar") == 0)
@@ -867,6 +883,7 @@ L_noskull:
set @choice_idx[@choices_nr], @C_undeadear;
set @choice$[@choices_nr], "Add an undead ear";
set @choices_nr, @choices_nr + 1;
+ goto L_noear;
L_noear:
if (countitem("Pearl") == 0)
@@ -874,24 +891,26 @@ L_noear:
set @choice_idx[@choices_nr], @C_pearl;
set @choice$[@choices_nr], "Finalize with a pearl.";
set @choices_nr, @choices_nr + 1;
+ goto L_nopearl;
L_nopearl:
set @choice_idx[@choices_nr], @C_nevermind;
set @choice$[@choices_nr], "Nevermind and leave";
menu
- @choice$[0],-,
- @choice$[1],-,
- @choice$[2],-,
- @choice$[3],-,
- @choice$[4],-,
- @choice$[5],-,
- @choice$[6],-,
- @choice$[7],-,
- @choice$[8],-,
- @choice$[9],-,
- @choice$[10],-;
-
+ @choice$[0],L_MenuItems1,
+ @choice$[1],L_MenuItems1,
+ @choice$[2],L_MenuItems1,
+ @choice$[3],L_MenuItems1,
+ @choice$[4],L_MenuItems1,
+ @choice$[5],L_MenuItems1,
+ @choice$[6],L_MenuItems1,
+ @choice$[7],L_MenuItems1,
+ @choice$[8],L_MenuItems1,
+ @choice$[9],L_MenuItems1,
+ @choice$[10],L_MenuItems1;
+
+L_MenuItems1:
set @menu, @menu - 1;
if (@choice_idx[@menu] == 0)
goto L_brew_dempo;
@@ -984,9 +1003,8 @@ L_ask_quit:
mes "[Caul]";
mes "\"The potion is not ready. You can't just leave now!\"";
menu
- "Please throw away that stupid potion, I'm in a hurry!", -,
+ "Please throw away that stupid potion, I'm in a hurry!", L_close,
"Oh you are right, let me finish it.", L_brew_dempo;
- close;
L_check_explosion:
// set to range [-50 50];
@@ -999,6 +1017,7 @@ L_check_explosion:
// square again, so you must be in the middle to get it work there;
// and multiply with 3 so there is definitly no chance to get it directly after starting
set @prob, (@prob * @prob) * 2;
+ goto L_check_exp_nof;
L_check_exp_nof:
// in about 95% of the cases anything is fine, so return.
diff --git a/world/map/npc/018-2/miners.txt b/world/map/npc/018-2/miners.txt
index d4397492..59e97297 100644
--- a/world/map/npc/018-2/miners.txt
+++ b/world/map/npc/018-2/miners.txt
@@ -53,6 +53,7 @@ L_Check_Gems:
next;
setarray @menuitems$, "", "", "", "", "", "", "";
set @c, 0;
+ goto L_Check_Diamond;
L_Check_Diamond:
if (countitem("Diamond") < 1)
@@ -60,6 +61,7 @@ L_Check_Diamond:
set @menuitems$[@c], "A diamond.";
set @menuid[@c], 0;
set @c, @c + 1;
+ goto L_Check_Ruby;
L_Check_Ruby:
if (countitem("Ruby") < 1)
@@ -67,6 +69,7 @@ L_Check_Ruby:
set @menuitems$[@c], "A ruby.";
set @menuid[@c], 1;
set @c, @c + 1;
+ goto L_Check_Emerald;
L_Check_Emerald:
if (countitem("Emerald") < 1)
@@ -74,6 +77,7 @@ L_Check_Emerald:
set @menuitems$[@c], "An emerald.";
set @menuid[@c], 2;
set @c, @c + 1;
+ goto L_Check_Sapphire;
L_Check_Sapphire:
if (countitem("Sapphire") < 1)
@@ -81,6 +85,7 @@ L_Check_Sapphire:
set @menuitems$[@c], "A sapphire.";
set @menuid[@c], 3;
set @c, @c + 1;
+ goto L_Check_Topaz;
L_Check_Topaz:
if (countitem("Topaz") < 1)
@@ -88,6 +93,7 @@ L_Check_Topaz:
set @menuitems$[@c], "A topaz.";
set @menuid[@c], 4;
set @c, @c + 1;
+ goto L_Check_Amethyst;
L_Check_Amethyst:
if (countitem("Amethyst") < 1)
@@ -95,19 +101,22 @@ L_Check_Amethyst:
set @menuitems$[@c], "An amethyst.";
set @menuid[@c], 5;
set @c, @c + 1;
+ goto L_Choose_Gem;
L_Choose_Gem:
set @menuitems$[@c], "None right now, thanks.";
set @menuid[@c], 6;
set @c, @c + 1;
menu
- @menuitems$[0], -,
- @menuitems$[1], -,
- @menuitems$[2], -,
- @menuitems$[3], -,
- @menuitems$[4], -,
- @menuitems$[5], -,
- @menuitems$[6], -;
+ @menuitems$[0], L_MenuItems,
+ @menuitems$[1], L_MenuItems,
+ @menuitems$[2], L_MenuItems,
+ @menuitems$[3], L_MenuItems,
+ @menuitems$[4], L_MenuItems,
+ @menuitems$[5], L_MenuItems,
+ @menuitems$[6], L_MenuItems;
+
+L_MenuItems:
set @menu, @menu - 1;
if (@menu >= @c)
goto L_Close;
diff --git a/world/map/npc/018-2/receptionist.txt b/world/map/npc/018-2/receptionist.txt
index 45635cfd..be7d6bb9 100644
--- a/world/map/npc/018-2/receptionist.txt
+++ b/world/map/npc/018-2/receptionist.txt
@@ -10,6 +10,7 @@
mes "\"Welcome to the mining camp!";
mes "Do you need anything?\"";
next;
+ goto L_Menu;
L_Menu:
if (@inspector == 10)
@@ -42,8 +43,10 @@ L_Building:
mes "\"No, the company bought this building. It's been abandoned for a while. The villagers think it's haunted, but we haven't seen anything, except for the basement. None of us have been able to stay there for very long.\"";
next;
menu
- "Why not?", -,
+ "Why not?", L_Next,
"Not my problem", L_Question_End;
+
+L_Next:
mes "[Receptionist]";
mes "\"I haven't been down there myself, and the ones who have haven't been able to describe why at all.\"";
next;