summaryrefslogtreecommitdiff
path: root/world
diff options
context:
space:
mode:
Diffstat (limited to 'world')
-rw-r--r--world/map/data/045-1.wlkbin40004 -> 40004 bytes
-rw-r--r--world/map/npc/001-1/weellos.txt2
-rw-r--r--world/map/npc/001-2/pauline.txt19
-rw-r--r--world/map/npc/002-1/luca.txt2
-rw-r--r--world/map/npc/002-2/hetchel.txt2
-rw-r--r--world/map/npc/007-1/witch.txt6
-rw-r--r--world/map/npc/009-2/selim.txt299
-rw-r--r--world/map/npc/009-4/barriers.txt63
-rw-r--r--world/map/npc/009-6/brodomir.txt6
-rw-r--r--world/map/npc/010-2/loratay.txt139
-rw-r--r--world/map/npc/011-6/crastur.txt4
-rw-r--r--world/map/npc/020-2/baktar.txt4
-rw-r--r--world/map/npc/029-2/sorfina.txt26
-rw-r--r--world/map/npc/029-2/tanisha.txt16
-rw-r--r--world/map/npc/052-1/janitor.txt2
-rw-r--r--world/map/npc/functions/dynamic_menu.txt302
-rw-r--r--world/map/npc/functions/quiz.txt93
-rw-r--r--world/map/npc/scripts.conf2
18 files changed, 529 insertions, 458 deletions
diff --git a/world/map/data/045-1.wlk b/world/map/data/045-1.wlk
index adc5cb45..01c0f1f2 100644
--- a/world/map/data/045-1.wlk
+++ b/world/map/data/045-1.wlk
Binary files differ
diff --git a/world/map/npc/001-1/weellos.txt b/world/map/npc/001-1/weellos.txt
index 7400402a..b2a89aed 100644
--- a/world/map/npc/001-1/weellos.txt
+++ b/world/map/npc/001-1/weellos.txt
@@ -9,7 +9,7 @@
set QUEST_NorthTulimshar, QUEST_NorthTulimshar | $@knowWeellosNT;
set @kylian, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
- if isin("001-1.gat", 48, 20, 61, 28) goto L_In;
+ if (isin("001-1.gat", 48, 20, 61, 28)) goto L_In;
mes "[Weellos]";
mes "\"This is a very historic building. One of the oldest in the area.\"";
diff --git a/world/map/npc/001-2/pauline.txt b/world/map/npc/001-2/pauline.txt
index b8833251..2c49bef6 100644
--- a/world/map/npc/001-2/pauline.txt
+++ b/world/map/npc/001-2/pauline.txt
@@ -122,13 +122,15 @@ L_KnowIngredientsMouboo:
"No.", L_ComeBackLater;
L_Next3:
+ setarray @items$, "AlizarinHerb", "GambogeHerb", "SilkCocoon", "PinkAntenna", "MaggotSlime", "BugLeg", "GrassSeeds", "ReedBundle", "RoastedAcorn", "Candy", "Milk", "BottleOfWater", "ChickenLeg", "Steak", "Root", "RawLog", "Beer", "CactusDrink", "MoubooFigurine", "Acorn", "Iten", "WarpedLog";
+ setarray @item_names$, "Alizarin Herb", "Gamboge Herb", "Silk Cocoon", "Pink Antenna", "Maggot Slime", "Bug Leg", "Grass Seeds", "Reed Bundle", "Roasted Acorn", "Candy", "Milk", "Bottle of Water", "Chicken Leg", "Steak", "Root", "Raw Log", "Beer", "Cactus Drink", "Mouboo Figurine", "Acorn", "Iten", "Warped Log";
mes "\"Then tell me the ingredients for the mouboo summoning spell and give them to me. Start with the first ingredient and then tell me the second one separately.\"";
next;
- mes "This is case sensitive. Also do not enter whitespaces.";
- next;
- input @pauline_ingredient1$;
+ callfunc "DynamicItemMenu$";
+ set @pauline_ingredient1$, @item$;
mes "Next ingredient.";
- input @pauline_ingredient2$;
+ callfunc "DynamicItemMenu$";
+ set @pauline_ingredient2$, @item$;
if (@pauline_ingredient1$ == "")
goto L_Wrong;
if (@pauline_ingredient2$ == "")
@@ -180,13 +182,16 @@ L_TrySpellMouboo:
goto L_Close;
L_KnowIngredientsPinkie:
+ setarray @items$, "AlizarinHerb", "GambogeHerb", "SilkCocoon", "PinkAntenna", "MaggotSlime", "BugLeg", "GrassSeeds", "ReedBundle", "RoastedAcorn", "Candy", "Milk", "BottleOfWater", "ChickenLeg", "Steak", "Root", "RawLog", "Beer", "CactusDrink", "MoubooFigurine", "Acorn", "Iten", "WarpedLog";
+ setarray @item_names$, "Alizarin Herb", "Gamboge Herb", "Silk Cocoon", "Pink Antenna", "Maggot Slime", "Bug Leg", "Grass Seeds", "Reed Bundle", "Roasted Acorn", "Candy", "Milk", "Bottle of Water", "Chicken Leg", "Steak", "Root", "Raw Log", "Beer", "Cactus Drink", "Mouboo Figurine", "Acorn", "Iten", "Warped Log";
mes "[Pauline]";
mes "\"Now give me the ingredients for the pinkie spell.\"";
next;
- mes "This is case sensitive. Also do not enter whitespaces.";
- input @pauline_ingredient1$;
+ callfunc "DynamicItemMenu$";
+ set @pauline_ingredient1$, @item$;
mes "Next ingredient.";
- input @pauline_ingredient2$;
+ callfunc "DynamicItemMenu$";
+ set @pauline_ingredient2$, @item$;
if (@pauline_ingredient1$ == "")
goto L_Wrong;
if (@pauline_ingredient2$ == "")
diff --git a/world/map/npc/002-1/luca.txt b/world/map/npc/002-1/luca.txt
index c6c47647..17ac66c7 100644
--- a/world/map/npc/002-1/luca.txt
+++ b/world/map/npc/002-1/luca.txt
@@ -316,7 +316,7 @@ L_MenuItems1:
L_unfocus:
if (countitem("GrimaceOfDementia") > 0) goto L_unfocus_menu;
- if (MAGIG_FLAGS & MFLAG_KNOWS_UNFOCUS_RECIPE) goto L_nopotion;
+ if (MAGIC_FLAGS & MFLAG_KNOWS_UNFOCUS_RECIPE) goto L_nopotion;
mes "[Luca the Hunter]";
mes "\"Unfocusing is one of the harder parts though, because it is sunk in. You see?\"";
diff --git a/world/map/npc/002-2/hetchel.txt b/world/map/npc/002-2/hetchel.txt
index b595bd88..134d40dc 100644
--- a/world/map/npc/002-2/hetchel.txt
+++ b/world/map/npc/002-2/hetchel.txt
@@ -263,7 +263,7 @@ L_Spants_Pay:
if (countitem(@spants_req$[0]) < @spants_req_amt[0] || countitem(@spants_req$[1]) < @spants_req_amt[1] || countitem(@spants_req$[2]) < @spants_req_amt[2])
goto L_Spants_No_Item;
getinventorylist;
- if (inventorylist_count == 100) goto L_TooMany;
+ if (@inventorylist_count == 100) goto L_TooMany;
mes "Hetchel takes your items.";
delitem @spants_req$[0], @spants_req_amt[0];
delitem @spants_req$[1], @spants_req_amt[1];
diff --git a/world/map/npc/007-1/witch.txt b/world/map/npc/007-1/witch.txt
index 82057128..97649deb 100644
--- a/world/map/npc/007-1/witch.txt
+++ b/world/map/npc/007-1/witch.txt
@@ -307,7 +307,7 @@ L_ChooseHelper2:
L_HelperTooWeak2:
detachrid;
if (!(attachrid($@ILLIA_HERO_ID)))
- goto_Exit;
+ goto L_Exit;
mes "[Team Selector]";
mes "The player " + $@ILLIA_HELPER2$ + " is too weak to help you.";
set $@ILLIA_HELPER2$, "";
@@ -353,14 +353,14 @@ L_ChooseHelper3:
set $@ILLIA_HELPER3$, strcharinfo(0);
detachrid;
if (!(attachrid($@ILLIA_HERO_ID)))
- goto_Exit;
+ goto L_Exit;
mes $@ILLIA_HELPER1$ + ", " + $@ILLIA_HELPER2$ + " and " + $@ILLIA_HELPER3$ + " will be your three comrades.";
close;
L_HelperTooWeak3:
detachrid;
if (!(attachrid($@ILLIA_HERO_ID)))
- goto_Exit;
+ goto L_Exit;
mes "[Team Selector]";
mes "The player " + $@ILLIA_HELPER3$ + " is too weak to help you.";
set $@ILLIA_HELPER3$, "";
diff --git a/world/map/npc/009-2/selim.txt b/world/map/npc/009-2/selim.txt
index f936f2cc..c34f3968 100644
--- a/world/map/npc/009-2/selim.txt
+++ b/world/map/npc/009-2/selim.txt
@@ -9,255 +9,29 @@
{
setarray @all_colours$, "red", "green", "dark blue", "yellow", "light blue", "pink", "black", "orange", "purple", "dark green";
- mes "[Selim]";
- mes "\"What can I dye for you today?\"";
- next;
+ cleararray @items$, "", getarraysize(@items$);
+ cleararray @item_names$, "", getarraysize(@item_names$);
+ cleararray @items_new, "", getarraysize(@items_new);
+ setarray @items_new, 5131, 2250, 2060, 2070, 2110, 2180, 2100, 2170, 2090, 2120, 2080, 2140, 2130, 2150, 2160, 2190, 2200, 2210, 2230, 2240, 5131, 2220, 5000, 5011, 5022, 5033, 5044, 5055, 5066, 5077, 5088, 5099;
+ setarray @items$, "CottonShirt", "CottonCloth", "VNeckSweater", "TurtleneckSweater", "CottonShorts", "CottonTrousers", "CottonSkirt", "Miniskirt", "TankTop", "ShortTankTop", "SilkRobe", "CottonHeadband", "DesertHat", "CottonBoots", "CottonGloves", "WhiteRabbitEars", "WizardHat", "BowlerHat", "BowlerHatBrown", "FineDress", "ContributorShirt", "SorcererRobeRed", "SorcererRobeGreen", "SorcererRobeDarkBlue", "SorcererRobeYellow", "SorcererRobeLightBlue", "SorcererRobePink", "SorcererRobeBlack", "SorcererRobeOrange", "SorcererRobePurple", "SorcererRobeDarkGreen", "SorcererRobeWhite";
+ setarray @item_names$, "Cotton Shirt", "Cotton Cloth", "V-Neck Sweater", "Turtleneck Sweater", "Cotton Shorts", "Cotton Trousers", "Cotton Skirt", "Miniskirt", "Tank Top", "Short Tank Top", "Silk Robe", "Cotton Headband", "Desert Hat", "Cotton Boots", "Cotton Gloves", "White Rabbit Ears", "Wizard Hat", "Bowler Hat", "Bowler Hat (brown)", "Fine Dress", "Contributor Shirt", "Red lined Sorcerer Robe", "Green lined Sorcerer Robe", "Dark Blue lined Sorcerer Robe", "Yellow lined Sorcerer Robe", "Light Blue lined Sorcerer Robe", "Pink lined Sorcerer Robe", "Black lined Sorcerer Robe", "Orange lined Sorcerer Robe", "Purple lined Sorcerer Robe", "Dark Green lined Sorcerer Robe", "White lined Sorcerer Robe";
+ set @default_choice$, "About these sorcerer robes...";
goto L_clothes_choice;
L_clothes_choice:
- set @pronoun$, "it";
- set @is_verb$, "is";
- menu
- "Cotton shirt.", L_cottonshirt,
- "Cotton cloth.", L_cottoncloth,
- "V-Neck sweater.", L_vneck,
- "Turtleneck sweater.", L_tneck,
- "Cotton shorts.", L_shorts,
- "Cotton trousers.", L_trousers,
- "Cotton skirt.", L_skirt,
- "Miniskirt.", L_miniskirt,
- "Tank top.", L_tanktop,
- "Short tank top.", L_tanktop_short,
- "Silk robe.", L_robe,
- "Cotton headband.", L_headband,
- "Desert hat.", L_desert_hat,
- "Cotton boots.", L_cottonboots,
- "Cotton gloves.", L_cottongloves,
- "Rabbit ears.", L_rabbitears,
- "Wizard hat.", L_wizardhat,
- "Bowler hat.", L_bowlerhat,
- "Sorcerer robe.", L_sorcererrobe,
- "Bowler hat (brown).", L_bowlerhatbrown,
- "Fine dress.", L_finedress,
- "Contributor Shirt.", L_contributor,
- "About these sorcerer robes...", L_asksorcererrobe,
- "I'm fine for now, thanks.", L_Close;
-
-L_contributor:
- set @del, 1178;
- set @new, 5131;
- set @name$, "contributor shirt";
- goto L_picked_item;
-
-L_cottonshirt:
- set @del, 1202;
- set @new, 2050;
- set @name$, "cotton shirt";
- goto L_picked_item;
-
-L_vneck:
- set @del, 624;
- set @new, 2060;
- set @name$, "V-neck sweater";
- goto L_picked_item;
-
-L_tneck:
- set @del, 564;
- set @new, 2070;
- set @name$, "turtleneck sweater";
- goto L_picked_item;
-
-L_shorts:
- set @del, 586;
- set @new, 2110;
- set @name$, "cotton shorts";
- set @pronoun$, "them";
- set @is_verb$, "are";
- goto L_picked_item;
-
-L_trousers:
- set @del, 648;
- set @new, 2180;
- set @name$, "cotton trousers";
- set @pronoun$, "them";
- set @is_verb$, "are";
- goto L_picked_item;
-
-L_skirt:
- set @del, 632;
- set @new, 2100;
- set @name$, "cotton skirt";
- goto L_picked_item;
-
-L_miniskirt:
- set @del, 771;
- set @new, 2170;
- set @name$, "miniskirt";
- goto L_picked_item;
-
-L_tanktop:
- set @del, 688;
- set @new, 2090;
- set @name$, "tank top";
- goto L_picked_item;
-
-L_tanktop_short:
- set @del, 689;
- set @new, 2120;
- set @name$, "short tank top";
- goto L_picked_item;
-
-L_robe:
- set @del, 720;
- set @new, 2080;
- set @name$, "silk robe";
- goto L_picked_item;
-
-L_headband:
- set @del, 724;
- set @new, 2140;
- set @name$, "cotton headband";
- goto L_picked_item;
-
-L_desert_hat:
- set @del, 723;
- set @new, 2130;
- set @name$, "desert hat";
- goto L_picked_item;
-
-L_cottonboots:
- set @del, 735;
- set @new, 2150;
- set @name$, "cotton boots";
- goto L_picked_item;
-
-L_cottongloves:
- set @del, 741;
- set @new, 2160;
- set @name$, "cotton gloves";
- goto L_picked_item;
-
-L_rabbitears:
- set @del, 1255;
- set @new, 2190;
- set @name$, "rabbit ears";
- set @pronoun$, "them";
- set @is_verb$, "are";
- goto L_picked_item;
-
-L_wizardhat:
- set @del, 4028;
- set @new, 2200;
- set @name$, "wizard hat";
- goto L_picked_item;
-
-L_bowlerhat:
- set @del, 4030;
- set @new, 2210;
- set @name$, "bowler hat";
- goto L_picked_item;
-
-L_sorcererrobe:
mes "[Selim]";
- mes "\"Which one?\"";
+ mes "\"What can I dye for you today?\"";
next;
- menu
- "A red lined one.", L_redlinedsorcererrobe,
- "A green lined one.", L_greenlinedsorcererrobe,
- "A dark blue lined one.", L_darkbluelinedsorcererrobe,
- "A yellow lined one.", L_yellowlinedsorcererrobe,
- "A light blue lined one.", L_lightbluelinedsorcererrobe,
- "A pink lined one.", L_pinklinedsorcererrobe,
- "A black lined one.", L_blacklinedsorcererrobe,
- "An orange lined one.", L_orangelinedsorcererrobe,
- "A purple lined one.", L_purplelinedsorcererrobe,
- "A dark green lined one.", L_darkgreenlinedsorcererrobe,
- "A white lined one.", L_whitelinedsorcererrobe,
- "I'm fine for now, thanks.", L_Close;
-
-L_redlinedsorcererrobe:
- set @del, 798;
- set @new, 2220;
- set @name$, "red lined sorcerer robe";
- goto L_picked_item;
-
-L_greenlinedsorcererrobe:
- set @del, 5010;
- set @new, 5000;
- set @name$, "green lined sorcerer robe";
+ callfunc "DynamicItemMenu$";
+ set @default_choice$, "";
+ set @item_del$, @item$;
+ set @item_new, @items_new[@index];
+ set @name$, @item_names$[@index];
+ cleararray @items$, "", getarraysize(@items$);
+ cleararray @item_names$, "", getarraysize(@item_names$);
+ if(@item$ == "") goto L_asksorcererrobe;
goto L_picked_item;
-L_darkbluelinedsorcererrobe:
- set @del, 5021;
- set @new, 5011;
- set @name$, "dark blue lined sorcerer robe";
- goto L_picked_item;
-
-L_yellowlinedsorcererrobe:
- set @del, 5032;
- set @new, 5022;
- set @name$, "yellow lined sorcerer robe";
- goto L_picked_item;
-
-L_lightbluelinedsorcererrobe:
- set @del, 5043;
- set @new, 5033;
- set @name$, "light blue lined sorcerer robe";
- goto L_picked_item;
-
-L_pinklinedsorcererrobe:
- set @del, 5054;
- set @new, 5044;
- set @name$, "pink lined sorcerer robe";
- goto L_picked_item;
-
-L_blacklinedsorcererrobe:
- set @del, 5065;
- set @new, 5055;
- set @name$, "black lined sorcerer robe";
- goto L_picked_item;
-
-L_orangelinedsorcererrobe:
- set @del, 5076;
- set @new, 5066;
- set @name$, "orange lined sorcerer robe";
- goto L_picked_item;
-
-L_purplelinedsorcererrobe:
- set @del, 5087;
- set @new, 5077;
- set @name$, "purple lined sorcerer robe";
- goto L_picked_item;
-
-L_darkgreenlinedsorcererrobe:
- set @del, 5098;
- set @new, 5088;
- set @name$, "dark green lined sorcerer robe";
- goto L_picked_item;
-
-L_whitelinedsorcererrobe:
- set @del, 5109;
- set @new, 5099;
- set @name$, "white lined sorcerer robe";
- goto L_picked_item;
-
-L_bowlerhatbrown:
- set @del, 800;
- set @new, 2230;
- set @name$, "bowler hat (brown)";
- goto L_picked_item;
-
-L_finedress:
- set @del, 870;
- set @new, 2240;
- set @name$, "fine dress";
- goto L_picked_item;
-
-L_cottoncloth:
- set @del, 660;
- set @new, 2250;
- set @name$, "cotton cloth";
- goto L_picked_item;
L_asksorcererrobe:
mes "[Selim]";
@@ -278,43 +52,38 @@ L_Next:
mes "[Selim]";
mes "\"Of course I can help you by dyeing the materials your tailor will want.";
mes "All I need is a piece of Cotton Cloth.\"";
+ set @item_del$, "CottonCloth";
+ set @item_new, 2250;
menu
- "Sure. Here is one.", L_cottoncloth,
+ "Sure. Here is one.", L_picked_item,
"I have to go pick that.", L_Close;
L_picked_item:
- if (countitem(@del) == 0) goto L_havenone;
+ if (countitem(@item_del$) == 0) goto L_havenone;
goto L_colour;
L_colour:
mes "[Selim]";
mes "\"Excellent. Now, what color do you want?\"";
next;
- menu
- "Red.", L_MenuItems,
- "Green.", L_MenuItems,
- "Dark Blue.", L_MenuItems,
- "Yellow.", L_MenuItems,
- "Light Blue.", L_MenuItems,
- "Pink.", L_MenuItems,
- "Black.", L_MenuItems,
- "Orange.", L_MenuItems,
- "Purple.", L_MenuItems,
- "Dark Green.", L_MenuItems;
-
-L_MenuItems:
- set @colour, @menu - 1;
+ setarray @items$, "RedDye", "GreenDye", "DarkBlueDye", "YellowDye", "LightBlueDye", "PinkDye", "BlackDye", "OrangeDye", "PurpleDye", "DarkGreenDye";
+ setarray @item_names$, "red", "green", "dark blue", "yellow", "light blue", "pink", "black", "orange", "purple", "dark green";
+ set @default_choice$, "I have no dye.";
+ callfunc "DynamicItemMenu$";
+ cleararray @items$, "", getarraysize(@items$);
+ cleararray @item_names$, "", getarraysize(@item_names$);
+ set @default_choice$, "";
+ if (@item$ == "") goto L_no_dye;
+ set @colour, @index;
set @vial, 690 + @colour;
- if (countitem(@vial) == 0) goto L_no_dye;
goto L_finish;
L_no_dye:
mes "[Selim]";
- mes "\"I would love to dye your " + @name$ + " for you, but you will have to bring me some " + @all_colours$[@colour] + " dye first.";
+ mes "\"I would love to dye your " + @name$ + " for you, but you will have to bring me some dye first.";
mes "Those behind me are nearly empty and won't last for your item.\"";
next;
menu
- "Sorry, I meant a different color.", L_colour,
"I wanted to dye a different item anyway.", L_clothes_choice,
"What do you mean, `bring you dye'?", L_explain_dye,
"Where would I get dye?", L_explain_dye,
@@ -329,13 +98,11 @@ L_explain_dye:
close;
L_finish:
- if (countitem(@del) == 0)
- goto L_havenone;
delitem @vial, 1;
- delitem @del, 1;
- getitem @new + @colour, 1;
+ delitem @item_del$, 1;
+ getitem @item_new + @colour, 1;
mes "[Selim]";
- mes "\"Here " + @is_verb$ + " your " + @all_colours$[@colour] + " " + @name$ + "! Please let " + @pronoun$ + " dry for a minute before you put " + @pronoun$ + " on.\"";
+ mes "\"Here's your " + @all_colours$[@colour] + " " + @name$ + "! Please let dry for a minute.\"";
close;
L_havenone:
diff --git a/world/map/npc/009-4/barriers.txt b/world/map/npc/009-4/barriers.txt
index 9e9ef7bc..49fd3877 100644
--- a/world/map/npc/009-4/barriers.txt
+++ b/world/map/npc/009-4/barriers.txt
@@ -44,12 +44,11 @@ L_Error2:
// Starting Barrier / Quest Entrance
-009-4.gat,37,120,0|script|#OrumCaveStartBarrier|127,1,0
+009-4.gat,37,119,0|script|#OrumCaveStartMessage|127,0,0
{
- if (OrumQuest >= 3) close;
+ if (OrumQuest >= 3) end;
if (OrumQuest == 2) goto L_Started;
- warp "009-4.gat", 37, 118;
mes "As you try to pass, two torches begin to flare and push you back. They seem to form some kind of barrier.";
close;
@@ -59,8 +58,15 @@ L_Started:
close;
}
+009-4.gat,37,120,0|script|#OrumCaveStartBarrier|127,0,0
+{
+ if (OrumQuest >= 3) end;
+ warp "009-4.gat", 37, 118;
+ end;
+}
+
// First Barrier
-009-4.gat,57,29,0|script|#OrumCaveFirstBarrier|127,1,0
+009-4.gat,57,29,0|script|#OrumCaveFirstBarrier|127,0,0
{
if (OrumQuest >= 5) close;
@@ -70,7 +76,7 @@ L_Started:
}
// Second Barrier
-009-4.gat,61,54,0|script|#OrumCaveSecondBarrier|127,1,0
+009-4.gat,61,55,0|script|#OrumCaveSecondMessage|127,0,0
{
if (OrumQuest == 3) set OrumQuest, 4;
@@ -81,7 +87,6 @@ L_Started:
if (OrumQuest > 7 && @TorchColor == @BarrierColor)
goto L_Allow_Second_Passage;
- warp "009-4.gat", 60, 56;
mes "As you try to pass, the torches begin to flare and push you back. Perhaps there's a way to get past it.";
mes "";
setarray @colors$,"transparent","red","dark orange","orange","light orange","yellow","light green","green","dark green","blue","dark purple","purple","light purple";
@@ -90,18 +95,29 @@ L_Started:
L_Allow_Second_Passage:
if (OrumQuest < 9) goto L_Advance_Quest;
- close;
+ end;
L_Advance_Quest:
message strcharinfo(0), "The torches dim as you enter like the first. You must be on the right trail.";
set OrumQuest, 9;
- close;
+ end;
+}
+
+009-4.gat,61,54,0|script|#OrumCaveSecondBarrier|127,0,0
+{
+ if (OrumQuest >= 9) end;
+ warp "009-4.gat", 60, 56;
+ end;
}
// Third Barrier
-009-4.gat,24,66,0|script|#OrumCaveThirdBarrier|127,1,0
+009-4.gat,24,65,0|script|#OrumCaveThirdMessage|127,0,0
{
if (OrumQuest == 3) set OrumQuest, 4;
+ if (OrumQuest > 8 && @Torch1Color == @firstColor && @Torch2Color == @secondColor)
+ goto L_Allow_Third_Passage;
+ if (OrumQuest > 8 && @Torch2Color == @firstColor && @Torch1Color == @secondColor)
+ goto L_Allow_Third_Passage;
set @Barrier, 1;
callfunc("GetBarrierColor");
@@ -121,12 +137,6 @@ L_Advance_Quest:
if (@secondColor > 12)
set @secondColor, 1;
- if (OrumQuest > 8 && @Torch1Color == @firstColor && @Torch2Color == @secondColor)
- goto L_Allow_Third_Passage;
- if (OrumQuest > 8 && @Torch2Color == @firstColor && @Torch1Color == @secondColor)
- goto L_Allow_Third_Passage;
-
- warp "009-4.gat", 23, 64;
mes "As you try to pass, the torches begin to flare and push you back. Perhaps there is a way to get past it.";
mes "";
setarray @colors$,"transparent","red","dark orange","orange","light orange","yellow","light green","green","dark green","blue","dark purple","purple","light purple";
@@ -135,17 +145,24 @@ L_Advance_Quest:
L_Allow_Third_Passage:
if (OrumQuest < 10) goto L_Advance_Quest;
- close;
+ end;
L_Advance_Quest:
set OrumQuest, 10;
- close;
+ end;
+}
+
+009-4.gat,24,66,0|script|#OrumCaveThirdBarrier|127,0,0
+{
+ if (OrumQuest >= 10) end;
+ warp "009-4.gat", 23, 64;
+ end;
}
// Ending Barrier
-009-4.gat,48,38,0|script|#OrumCaveEndBarrier|127,1,0
+009-4.gat,48,37,0|script|#OrumCaveEndMessage|127,0,0
{
- if (OrumQuest >= 11) close;
+ if (OrumQuest >= 11) end;
if (OrumQuest == 3) set OrumQuest, 4;
set @Barrier, 2;
@@ -239,7 +256,6 @@ L_Advance_Quest:
goto L_Deny_Final_Passage;
L_Deny_Final_Passage:
- warp "009-4.gat", 47, 36;
mes "As you try to pass, the torches begin to flare and push you back. Perhaps there is a way to get past it.";
mes "";
setarray @colors$,"transparent","red","dark orange","orange","light orange","yellow","light green","green","dark green","blue","dark purple","purple","light purple";
@@ -255,3 +271,10 @@ L_Advance_Quest:
set OrumQuest, 11;
close;
}
+
+009-4.gat,48,38,0|script|#OrumCaveEndBarrier|127,0,0
+{
+ if (OrumQuest >= 11) end;
+ warp "009-4.gat", 47, 36;
+ end;
+}
diff --git a/world/map/npc/009-6/brodomir.txt b/world/map/npc/009-6/brodomir.txt
index e0443bc4..f1ca3789 100644
--- a/world/map/npc/009-6/brodomir.txt
+++ b/world/map/npc/009-6/brodomir.txt
@@ -133,11 +133,11 @@ L_Go:
set $@BRODOMIR_MONEY, @brodomir_money;
set $@brodomir_delay_seconds, 600;
set $@BRODOMIR_PVP_STATUS, 1;
- announce "Brodomir:* In "+$@brodomir_delay_seconds/60+" minutes, I will start a PvP tournament, if at least 3 fighters are present. Make your way in Hurnscald Underground Caves!", 0;
+ announce "Brodomir: In "+$@brodomir_delay_seconds/60+" minutes, I will start a PvP tournament, if at least 3 fighters are present. Make your way in Hurnscald Underground Caves!", 0;
if ($@BRODOMIR_ITEM_AMOUNT > 0)
- announce "Brodomir:* The winner will receive 150GP per fighter and " + $@BRODOMIR_ITEM_AMOUNT + " " + $@BRODOMIR_ITEM$ + ".", 0;
+ announce "Brodomir: The winner will receive 150GP per fighter and " + $@BRODOMIR_ITEM_AMOUNT + " " + $@BRODOMIR_ITEM$ + ".", 0;
if ($@BRODOMIR_MONEY > 0)
- announce "Brodomir:* The winner will receive " + $@BRODOMIR_MONEY + "GP and additionally 150GP per fighter.", 0;
+ announce "Brodomir: The winner will receive " + $@BRODOMIR_MONEY + "GP and additionally 150GP per fighter.", 0;
mes "[Brodomir]";
mes "\"In "+$@brodomir_delay_seconds/60+" minutes I will bring you all to the PvP cave. If there are less than 3 players here the event will not start and your money will be lost.\"";
set $@BRODOMIR_START_TIME, gettimetick(2) + $@brodomir_delay_seconds;
diff --git a/world/map/npc/010-2/loratay.txt b/world/map/npc/010-2/loratay.txt
index b8a00c28..324f953a 100644
--- a/world/map/npc/010-2/loratay.txt
+++ b/world/map/npc/010-2/loratay.txt
@@ -487,12 +487,12 @@ L_desert_hat:
mes "The seamstress sighs.";
mes "\"One of these days it would be nice to have an actual challenge... yes, of course I can make a desert hat. A Cotton Headband, three pieces of cotton cloth. Hmm. And let's add 300 GP to that.\"";
next;
- set @default_choice$, "Never mind.";
+ cleararray @items, 0, getarraysize(@items);
+ cleararray @item_names$, "", getarraysize(@item_names$);
setarray @items, 724, 2140, 2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149;
setarray @item_names$, "Here is a Cotton Headband.", "Here is a Red Cotton Headband.", "Here is a Green Cotton Headband.", "Here is a Dark Blue Cotton Headband.", "Here is a Yellow Cotton Headband.", "Here is a Light Blue Cotton Headband.", "Here is a Pink Cotton Headband.", "Here is a Black Cotton Headband.", "Here is an Orange Cotton Headband.", "Here is a Puple Cotton Headband.", "Here is a Dark Green Cotton Headband.";
- set @items_nr, 11;
- callsub S_pick_one_of_many_items;
+ callfunc "DynamicItemMenu";
if (@item == 0)
goto L_main_menu;
if (@item == 724)
@@ -544,11 +544,11 @@ L_trim:
mes "\"Alright. What is it that you want trimmed?\"";
next;
- set @default_choice$, "Never mind.";
+ cleararray @items, 0, getarraysize(@items);
+ cleararray @item_names$, "", getarraysize(@item_names$);
setarray @items, 1202, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 688, 2090, 2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, 632, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 648, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189;
setarray @item_names$, "Cotton Shirt", "Red Cotton Shirt", "Green Cotton Shirt", "Dark Blue Cotton Shirt", "Yellow Cotton Shirt", "Light Blue Cotton Shirt", "Pink Cotton Shirt", "Black Cotton Shirt", "Orange Cotton Shirt", "Purple Cotton Shirt", "Dark Green Cotton Shirt", "Tank Top", "Red Tank Top", "Green Tank Top", "Dark Blue Tank Top", "Yellow Tank Top", "Light Blue Tank Top", "Pink Tank Top", "Black Tank Top", "Orange Tank Top", "Purple Tank Top", "Dark Green Tank Top", "Cotton Skirt", "Red Cotton Skirt", "Green Cotton Skirt", "Dark Blue Cotton Skirt", "Yellow Cotton Skirt", "Light Blue Cotton Skirt", "Pink Cotton Skirt", "Black Cotton Skirt", "Orange Cotton Skirt", "Purple Cotton Skirt", "Dark Green Cotton Skirt", "Cotton Trousers", "Red Cotton Trousers", "Green Cotton Trousers", "Dark Blue Cotton Trousers", "Yellow Cotton Trousers", "Light Blue Cotton Trousers", "Pink Cotton Trousers", "Black Cotton Trousers", "Orange Cotton Trousers", "Purple Cotton Trousers", "Dark Green Cotton Trousers";
- set @items_nr, 44;
- callsub S_pick_one_of_many_items;
+ callfunc "DynamicItemMenu";
if (@item == 0)
goto L_main_menu;
set @delitem, @item;
@@ -603,12 +603,12 @@ L_lengthen:
mes "\"Now, let me see. What is it that you want lengthened?\"";
next;
- set @default_choice$, "Never mind.";
+ cleararray @items, 0, getarraysize(@items);
+ cleararray @item_names$, "", getarraysize(@item_names$);
setarray @items, 688, 2090, 2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, 689, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 2127, 2128, 2129, 771, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 586, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119;
setarray @item_names$, "Tank Top", "Red Tank Top", "Green Tank Top", "Dark Blue Tank Top", "Yellow Tank Top", "Light Blue Tank Top", "Pink Tank Top", "Black Tank Top", "Orange Tank Top", "Purple Tank Top", "Dark Green Tank Top", "Short Tank Top", "Red Short Tank Top", "Green Short Tank Top", "Dark Blue Short Tank Top", "Yellow Short Tank Top", "Light Blue Short Tank Top", "Pink Short Tank Top", "Black Short Tank Top", "Orange Short Tank Top", "Purple Short Tank Top", "Dark Green Short Tank Top", "Miniskirt", "Red Miniskirt", "Green Miniskirt", "Dark Blue Miniskirt", "Yellow Miniskirt", "Light Blue Miniskirt", "Pink Miniskirt", "Black Miniskirt", "Orange Miniskirt", "Purple Miniskirt", "Dark Green Miniskirt", "Cotton Shorts", "Red Cotton Shorts", "Green Cotton Shorts", "Dark Blue Cotton Shorts", "Yellow Cotton Shorts", "Light Blue Cotton Shorts", "Pink Cotton Shorts", "Black Cotton Shorts", "Orange Cotton Shorts", "Purple Cotton Shorts", "Dark Green Cotton Shorts";
- set @items_nr, 44;
- callsub S_pick_one_of_many_items;
+ callfunc "DynamicItemMenu";
if (@item == 0)
goto L_main_menu;
@@ -903,127 +903,6 @@ L_end:
set @Robe_with_sheets, 0;
goto L_Close;
-// Input: @items (array of items you want to choose from)
-// @item_names (names of the items in @items)
-// @items_nr (number of entries in @items)
-// @default_choice$ (default option)
-// Return: @item (The selected item, or 0 if the default/something invalid was chosen)
-S_pick_one_of_many_items:
- set @c, 0;
- set @i, 0;
-
- setarray @choice_n$, "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "";
- goto S_SUB_pick_choice_loop;
-
-S_SUB_pick_choice_loop:
- if (@i >= @items_nr)
- goto S_SUB_choice_init_done;
- set @current, @items[@i];
- set @current_name$, @item_names$[@i];
- set @i, @i + 1;
-
- if (countitem(@current) == 0)
- goto S_SUB_pick_choice_loop;
- set @choice_v[@c], @current;
- set @choice_n$[@c], @current_name$;
- set @c, @c + 1;
- goto S_SUB_pick_choice_loop;
-
-S_SUB_choice_init_done:
- set @choice_v[@c], 0;
- set @choice_n$[@c], @default_choice$;
- set @c, @c + 1;
-
- if (@c < 10)
- menu
- @choice_n$[0], L_MenuItems,
- @choice_n$[1], L_MenuItems,
- @choice_n$[2], L_MenuItems,
- @choice_n$[3], L_MenuItems,
- @choice_n$[4], L_MenuItems,
- @choice_n$[5], L_MenuItems,
- @choice_n$[6], L_MenuItems,
- @choice_n$[7], L_MenuItems,
- @choice_n$[8], L_MenuItems,
- @choice_n$[9], L_MenuItems;
- goto L_MenuItems;
-
-L_MenuItems:
- if (@c < 10)
- goto L_SUB_choice_join;
-
- if (@c < 20)
- menu
- @choice_n$[0], L_MenuItems1,
- @choice_n$[1], L_MenuItems1,
- @choice_n$[2], L_MenuItems1,
- @choice_n$[3], L_MenuItems1,
- @choice_n$[4], L_MenuItems1,
- @choice_n$[5], L_MenuItems1,
- @choice_n$[6], L_MenuItems1,
- @choice_n$[7], L_MenuItems1,
- @choice_n$[8], L_MenuItems1,
- @choice_n$[9], L_MenuItems1,
- @choice_n$[10], L_MenuItems1,
- @choice_n$[11], L_MenuItems1,
- @choice_n$[12], L_MenuItems1,
- @choice_n$[13], L_MenuItems1,
- @choice_n$[14], L_MenuItems1,
- @choice_n$[15], L_MenuItems1,
- @choice_n$[16], L_MenuItems1,
- @choice_n$[17], L_MenuItems1,
- @choice_n$[18], L_MenuItems1,
- @choice_n$[19], L_MenuItems1;
- goto L_MenuItems1;
-
-L_MenuItems1:
- if (@c < 20)
- goto L_SUB_choice_join;
-
- menu
- @choice_n$[0], L_SUB_choice_join,
- @choice_n$[1], L_SUB_choice_join,
- @choice_n$[2], L_SUB_choice_join,
- @choice_n$[3], L_SUB_choice_join,
- @choice_n$[4], L_SUB_choice_join,
- @choice_n$[5], L_SUB_choice_join,
- @choice_n$[6], L_SUB_choice_join,
- @choice_n$[7], L_SUB_choice_join,
- @choice_n$[8], L_SUB_choice_join,
- @choice_n$[9], L_SUB_choice_join,
- @choice_n$[10], L_SUB_choice_join,
- @choice_n$[11], L_SUB_choice_join,
- @choice_n$[12], L_SUB_choice_join,
- @choice_n$[13], L_SUB_choice_join,
- @choice_n$[14], L_SUB_choice_join,
- @choice_n$[15], L_SUB_choice_join,
- @choice_n$[16], L_SUB_choice_join,
- @choice_n$[17], L_SUB_choice_join,
- @choice_n$[18], L_SUB_choice_join,
- @choice_n$[19], L_SUB_choice_join,
- @choice_n$[20], L_SUB_choice_join,
- @choice_n$[21], L_SUB_choice_join,
- @choice_n$[22], L_SUB_choice_join,
- @choice_n$[23], L_SUB_choice_join,
- @choice_n$[24], L_SUB_choice_join,
- @choice_n$[25], L_SUB_choice_join,
- @choice_n$[26], L_SUB_choice_join,
- @choice_n$[27], L_SUB_choice_join,
- @choice_n$[28], L_SUB_choice_join,
- @choice_n$[29], L_SUB_choice_join,
- @choice_n$[30], L_SUB_choice_join,
- @choice_n$[31], L_SUB_choice_join;
-
-L_SUB_choice_join:
- set @menu, @menu - 1;
- set @item, @choice_v[@menu];
- if (@menu >= @c)
- set @item, 0;
- return;
-
L_TooMany:
mes "[Lora Tay the Seamstress]";
mes "\"You don't have anywhere to put this. Come back when you have more room.\"";
diff --git a/world/map/npc/011-6/crastur.txt b/world/map/npc/011-6/crastur.txt
index 2818998b..aae2ff38 100644
--- a/world/map/npc/011-6/crastur.txt
+++ b/world/map/npc/011-6/crastur.txt
@@ -187,13 +187,13 @@ L_Personal:
mes "\"Ah. Here it is:\"";
mes "\"Today you have accomplished tasks that are worth " + DailyQuestPoints + " Hours in the Northern Mines\"";
next;
- if BOSSPOINTS < 1000 goto L_Worm;
+ if BOSS_POINTS < 1000 goto L_Worm;
emotion EMOTE_DEAD;
mes "[Crastur]";
mes "";
mes "\"Also you seem to be quite a hero, it appears you have a record in the Almanach\"";
mes "Crastur turns a giant book upside down";
- mes "\"According to this you have gained " + BOSSPOINTS / 1000 + "thousand Points in the eternal charts already.\"";
+ mes "\"According to this you have gained " + BOSS_POINTS / 1000 + "thousand Points in the eternal charts already.\"";
mes "Crastur shudders";
goto L_Close;
diff --git a/world/map/npc/020-2/baktar.txt b/world/map/npc/020-2/baktar.txt
index 1c6e3202..cc6b7ef2 100644
--- a/world/map/npc/020-2/baktar.txt
+++ b/world/map/npc/020-2/baktar.txt
@@ -95,9 +95,9 @@ L_Delivery:
goto L_Close;
L_Start:
- if(sex)
+ if(Sex)
set @type$, "man";
- if(!sex)
+ if(!Sex)
set @type$, "woman";
if(@Q_status & (1<<@BIT_KNOWHIM)) goto L_KnowAlready;
diff --git a/world/map/npc/029-2/sorfina.txt b/world/map/npc/029-2/sorfina.txt
index 671835f1..4f55ef76 100644
--- a/world/map/npc/029-2/sorfina.txt
+++ b/world/map/npc/029-2/sorfina.txt
@@ -57,8 +57,8 @@ L_Tut:
L_Carpet:
mes "[Sorfina]";
mes "\"Try to take a few steps and walk to that carpet over there.";
- mes "Just use the ###keyMoveUp; to move up, press ###keyMoveDown; to move down, ";
- mes "press ###keyMoveLeft; to move left, press ###keyMoveRight; to move right ";
+ mes "Press [###keyMoveUp;] to move up, press [###keyMoveDown;] to move down, ";
+ mes "press [###keyMoveLeft;] to move left, press [###keyMoveRight;] to move right ";
mes " or click on the place you want to go to.\"";
set @tutorial_tmp, 1;
callfunc "SetTutorialMask";
@@ -67,15 +67,15 @@ L_Carpet:
L_Dresser:
mes "[Sorfina]";
mes "\"In that dresser there are some clothes you can wear.\"";
- mes "\"To interact with things in your environment or talk to NPCs you can either click on it or press ###keyTargetNPC; to focus and ###keyTalk; to talk/activate.\"";
+ mes "\"To interact with things in your environment or talk to NPCs you can either click on it or press [###keyTargetNPC;] to focus and [###keyTalk;] to talk/activate.\"";
mes "\"Now get the clothes out of the dresser.\"";
goto L_Close;
L_Naked:
mes "[Sorfina]";
- mes "\"Press ###keyWindowInventory; or click on the Inventory button in the bar at the upper right corner to open your bag.\"";
+ mes "\"Press [###keyWindowInventory;] or click on the Inventory button in the bar at the upper right corner to open your bag.\"";
mes "\"Once we stop talking, double-click on the clothes to equip.\"";
- mes "\"Talk to me again after you get dressed. You can either click on me, or press ###keyTargetNPC; to focus on me and ###keyTalk; to talk.\"";
+ mes "\"Talk to me again after you get dressed. You can either click on me, or press [###keyTargetNPC;] to focus on me and [###keyTalk;] to talk.\"";
goto L_Close;
L_Clothes:
@@ -136,8 +136,8 @@ L_Explain:
L_Walk:
mes "[Sorfina]";
mes "\"You can use the arrow keys to walk around.";
- mes "Just use the ###keyMoveUp; to move up, press ###keyMoveDown; to move down, ";
- mes "press ###keyMoveLeft; to move left, press ###keyMoveRight; to move right ";
+ mes "Press [###keyMoveUp;] to move up, press [###keyMoveDown;] to move down, ";
+ mes "press [###keyMoveLeft;] to move left, press [###keyMoveRight;] to move right ";
mes " or click on the place you want to go to.\"";
mes "This only works if that place is reachable and walkable.\"";
goto L_Close;
@@ -145,16 +145,16 @@ L_Walk:
L_Talk:
mes "[Sorfina]";
mes "\"If you want to talk to a normal person, you can click at him or her.";
- mes "Or you can press ###keyTargetNPC; to focus on the nearest person and then press ###keyTalk; to talk.\"";
+ mes "Or you can press [###keyTargetNPC;] to focus on the nearest person and then press [###keyTalk;] to talk.\"";
next;
- mes "\"If you want to talk to other adventurers, press ###keyChat; to open your chat window.";
+ mes "\"If you want to talk to other adventurers, press [###keyChat;] to open your chat window.";
mes "Then type your message and press Enter to send.\"";
next;
mes "\"You may want to talk privately to another adventurer sometimes. In that case you can whisper.";
- mes "After pressing ###keyChat; type '/whisper [name] [message]'.";
+ mes "After pressing [###keyChat;] type '/whisper [name] [message]'.";
mes "Or you can right click on someone and choose the whisper option.\"";
next;
- mes "\"Press ###keyWindowChat; to show and hide your chat window.\"";
+ mes "\"Press [###keyWindowChat;] to show and hide your chat window.\"";
goto L_Close;
L_Items:
@@ -173,7 +173,7 @@ L_Items:
mes "\"Your HitchHikers Towel will return you to your last set soul menhir or here if not set.\"";
mes "\"It can't be used constantly as the magic needs time to power the jump.\"";
next;
- mes "\"Press ###keyWindowInventory; to open your inventory.";
+ mes "\"Press [###keyWindowInventory;] to open your inventory.";
mes "When placing your cursor over an item there, you can see a box with some information about that item.\"";
next;
mes "\"To use or equip an item, select it by double-clicking on it.";
@@ -182,7 +182,7 @@ L_Items:
L_Shortcut:
mes "[Sorfina]";
- mes "\"Press ###keyWindowShortcut; or click the Shortcut button in the bar at the upper right to open your shortcut window.\"";
+ mes "\"Press [###keyWindowShortcut;] or click the Shortcut button in the bar at the upper right to open your shortcut window.\"";
next;
mes "\"You can select the item you want to put on a shortcut with your mouse and then click on the position in the shortcut window you want to place it.\"";
next;
diff --git a/world/map/npc/029-2/tanisha.txt b/world/map/npc/029-2/tanisha.txt
index b45b5d06..92ffccaf 100644
--- a/world/map/npc/029-2/tanisha.txt
+++ b/world/map/npc/029-2/tanisha.txt
@@ -58,14 +58,14 @@ L_Fight_Again:
mes "[Tanisha]";
mes "\"Ok, listen what to do.";
mes "Equip a weapon and kill the maggots.\"";
- mes "\"Press ###keyTargetMonster; to focus on a monster. With ###keyTargetAttack; you can focus and start attacking the same time.";
+ mes "\"Press [###keyTargetMonster;] to focus on a monster. With [###keyTargetAttack;] you can focus and start attacking the same time.";
mes "But it also works to click on the monster with your mouse.\"";
next;
- mes "\"If you press the ###keyTarget;, you can abort your attack.\"";
+ mes "\"If you press the [###keyTarget;], you can abort your attack.\"";
next;
mes "\"Maggots aren't aggressive, so they won't harm you until you attack them first. Take them out one by one.\"";
next;
- mes "\"Sometimes dead monsters leave some useful things. You can pick them up by pressing ###keyPickup; or clicking on the items with your mouse.\"";
+ mes "\"Sometimes dead monsters leave some useful things. You can pick them up by pressing [###keyPickup;] or clicking on the items with your mouse.\"";
close2;
// The getitem must be in the same place as set @tutorial, 2;
// since it was moved to after L_Fight_Again, add it conditionally
@@ -101,7 +101,7 @@ L_Stats:
mes "\"That was great! Like a professional exterminator!\"";
mes "\"And it seems you became stronger and more experienced.";
mes "That means you got some status points which you can use to increase your abilities.\"";
- mes "\"Press ###keyWindowStatus; or click the Status button in the bar at the upper right to see your status window. There you can distribute your points on six different properties.\"";
+ mes "\"Press [###keyWindowStatus;] or click the Status button in the bar at the upper right to see your status window. There you can distribute your points on six different properties.\"";
next;
goto L_StatsRe;
@@ -150,14 +150,14 @@ L_Explain:
L_Fight:
mes "[Tanisha]";
- mes "\"Press ###keyTargetMonster; to focus on a monster. With ###keyTargetAttack; you can focus and attack.";
+ mes "\"Press [###keyTargetMonster;] to focus on a monster. With [###keyTargetAttack;] you can focus and attack.";
mes "But it also works to click on the monster with your mouse.\"";
next;
- mes "\"If you press the ###keyTarget; button, you can abort your attack.\"";
+ mes "\"If you press the [###keyTarget;] button, you can abort your attack.\"";
next;
- mes "\"Sometimes dead monsters leave some useful things. You can pick them up with pressing ###keyPickup; or clicking on the items with your mouse.\"";
+ mes "\"Sometimes dead monsters leave some useful things. You can pick them up with pressing [###keyPickup;] or clicking on the items with your mouse.\"";
next;
- mes "\"If you feel exhausted from battle you can sit down by pressing ###keyBeingSit; to recover faster.\"";
+ mes "\"If you feel exhausted from battle you can sit down by pressing [###keyBeingSit;] to recover faster.\"";
goto L_Close;
L_Mob:
diff --git a/world/map/npc/052-1/janitor.txt b/world/map/npc/052-1/janitor.txt
index 26b52d38..d0067d6e 100644
--- a/world/map/npc/052-1/janitor.txt
+++ b/world/map/npc/052-1/janitor.txt
@@ -7,7 +7,7 @@ end;
OnCommandClean:
// Kill all monsters (that includes the spawned Demonic Spirits and Azul Slimes)
// Note that the loot the slimes may have picked will be deleted at the same time.
- killmonsterall "052-1.gat";
+ killmonster "052-1", "All";
// Delete the magic stones that are still laying around.
// FIXME Syntax error happens if not setting a variable...
set $@dummy_var, getareadropitem("052-1.gat", 1, 1, 98, 78, 873, 1) +
diff --git a/world/map/npc/functions/dynamic_menu.txt b/world/map/npc/functions/dynamic_menu.txt
new file mode 100644
index 00000000..a2a735d6
--- /dev/null
+++ b/world/map/npc/functions/dynamic_menu.txt
@@ -0,0 +1,302 @@
+// Input: @items (array of items you want to choose from)
+// @item_names$ (names of the items in @items)
+// @default_choice$ (default option)
+// Return: @item (The selected item, or 0 if the default/something invalid was chosen)
+//
+// NOTE: DynamicItemMenu is ONLY used for scripts that need to do math with @item like tailor, dyer, bleacher
+// All other scripts should use DynamicItemMenu$
+
+function|script|DynamicItemMenu
+{
+set @items_nr, getarraysize(@items);
+if(@items_nr != getarraysize(@item_names$)) goto L_ArrayLengthMismatch;
+if(@default_choice$ == "") set @default_choice$, "Never mind.";
+goto L_pick_one_of_many_items;
+
+L_pick_one_of_many_items:
+ set @c, 0;
+ set @i, 0;
+
+ setarray @choice_n$, "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "";
+ goto L_pick_choice_loop;
+
+L_pick_choice_loop:
+ if (@i >= @items_nr)
+ goto L_choice_init_done;
+ set @current, @items[@i];
+ set @current_name$, @item_names$[@i];
+ set @current_index, @i;
+ set @i, @i + 1;
+
+ if (countitem(@current) == 0)
+ goto L_pick_choice_loop;
+ set @choice_v[@c], @current;
+ set @choice_n$[@c], @current_name$;
+ set @choice_i[@c], @current_index;
+ set @c, @c + 1;
+ goto L_pick_choice_loop;
+
+L_choice_init_done:
+ set @choice_v[@c], 0;
+ set @choice_n$[@c], @default_choice$;
+ set @c, @c + 1;
+
+ if (@c < 10)
+ menu
+ @choice_n$[0], L_MenuItems,
+ @choice_n$[1], L_MenuItems,
+ @choice_n$[2], L_MenuItems,
+ @choice_n$[3], L_MenuItems,
+ @choice_n$[4], L_MenuItems,
+ @choice_n$[5], L_MenuItems,
+ @choice_n$[6], L_MenuItems,
+ @choice_n$[7], L_MenuItems,
+ @choice_n$[8], L_MenuItems,
+ @choice_n$[9], L_MenuItems;
+ goto L_MenuItems;
+
+L_MenuItems:
+ if (@c < 10)
+ goto L_choice_join;
+
+ if (@c < 20)
+ menu
+ @choice_n$[0], L_MenuItems1,
+ @choice_n$[1], L_MenuItems1,
+ @choice_n$[2], L_MenuItems1,
+ @choice_n$[3], L_MenuItems1,
+ @choice_n$[4], L_MenuItems1,
+ @choice_n$[5], L_MenuItems1,
+ @choice_n$[6], L_MenuItems1,
+ @choice_n$[7], L_MenuItems1,
+ @choice_n$[8], L_MenuItems1,
+ @choice_n$[9], L_MenuItems1,
+ @choice_n$[10], L_MenuItems1,
+ @choice_n$[11], L_MenuItems1,
+ @choice_n$[12], L_MenuItems1,
+ @choice_n$[13], L_MenuItems1,
+ @choice_n$[14], L_MenuItems1,
+ @choice_n$[15], L_MenuItems1,
+ @choice_n$[16], L_MenuItems1,
+ @choice_n$[17], L_MenuItems1,
+ @choice_n$[18], L_MenuItems1,
+ @choice_n$[19], L_MenuItems1;
+ goto L_MenuItems1;
+
+L_MenuItems1:
+ if (@c < 20)
+ goto L_choice_join;
+
+ menu
+ @choice_n$[0], L_choice_join,
+ @choice_n$[1], L_choice_join,
+ @choice_n$[2], L_choice_join,
+ @choice_n$[3], L_choice_join,
+ @choice_n$[4], L_choice_join,
+ @choice_n$[5], L_choice_join,
+ @choice_n$[6], L_choice_join,
+ @choice_n$[7], L_choice_join,
+ @choice_n$[8], L_choice_join,
+ @choice_n$[9], L_choice_join,
+ @choice_n$[10], L_choice_join,
+ @choice_n$[11], L_choice_join,
+ @choice_n$[12], L_choice_join,
+ @choice_n$[13], L_choice_join,
+ @choice_n$[14], L_choice_join,
+ @choice_n$[15], L_choice_join,
+ @choice_n$[16], L_choice_join,
+ @choice_n$[17], L_choice_join,
+ @choice_n$[18], L_choice_join,
+ @choice_n$[19], L_choice_join,
+ @choice_n$[20], L_choice_join,
+ @choice_n$[21], L_choice_join,
+ @choice_n$[22], L_choice_join,
+ @choice_n$[23], L_choice_join,
+ @choice_n$[24], L_choice_join,
+ @choice_n$[25], L_choice_join,
+ @choice_n$[26], L_choice_join,
+ @choice_n$[27], L_choice_join,
+ @choice_n$[28], L_choice_join,
+ @choice_n$[29], L_choice_join,
+ @choice_n$[30], L_choice_join,
+ @choice_n$[31], L_choice_join;
+
+L_choice_join:
+ set @menu, @menu - 1;
+ set @item, @choice_v[@menu];
+ set @index, @choice_i[@menu];
+ if (@menu >= @c)
+ set @item, 0;
+ goto L_Clean;
+
+L_Clean:
+ set @menu, 0;
+ set @items_nr, 0;
+ set @c, 0;
+ set @i, 0;
+ set @current, 0;
+ set @current_name$, "";
+ cleararray @choice_v, 0, getarraysize(@choice_v);
+ cleararray @choice_n$, "", getarraysize(@choice_n$);
+ cleararray @choice_i, 0, getarraysize(@choice_i);
+ return;
+
+L_ArrayLengthMismatch:
+ debugmes "@items and @item_names$ array length mismatch";
+ mapexit;
+}
+
+
+
+
+// Input: @items$ (array of items you want to choose from)
+// @item_names$ (names of the items in @items)
+// @default_choice$ (default option)
+// Return: @item$ (The selected item, or 0 if the default/something invalid was chosen)
+
+function|script|DynamicItemMenu$
+{
+set @items_nr, getarraysize(@items$);
+if(@items_nr != getarraysize(@item_names$)) goto L_ArrayLengthMismatch;
+if(@default_choice$ == "") set @default_choice$, "Never mind.";
+goto L_pick_one_of_many_items;
+
+L_pick_one_of_many_items:
+ set @c, 0;
+ set @i, 0;
+
+ setarray @choice_n$, "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "";
+ goto L_pick_choice_loop;
+
+L_pick_choice_loop:
+ if (@i >= @items_nr)
+ goto L_choice_init_done;
+ set @current$, @items$[@i];
+ set @current_name$, @item_names$[@i];
+ set @current_index, @i;
+ set @i, @i + 1;
+
+ if (countitem(@current$) == 0)
+ goto L_pick_choice_loop;
+ set @choice_v$[@c], @current$;
+ set @choice_n$[@c], @current_name$;
+ set @choice_i[@c], @current_index;
+ set @c, @c + 1;
+ goto L_pick_choice_loop;
+
+L_choice_init_done:
+ set @choice_v$[@c], "";
+ set @choice_n$[@c], @default_choice$;
+ set @c, @c + 1;
+
+ if (@c < 10)
+ menu
+ @choice_n$[0], L_MenuItems,
+ @choice_n$[1], L_MenuItems,
+ @choice_n$[2], L_MenuItems,
+ @choice_n$[3], L_MenuItems,
+ @choice_n$[4], L_MenuItems,
+ @choice_n$[5], L_MenuItems,
+ @choice_n$[6], L_MenuItems,
+ @choice_n$[7], L_MenuItems,
+ @choice_n$[8], L_MenuItems,
+ @choice_n$[9], L_MenuItems;
+ goto L_MenuItems;
+
+L_MenuItems:
+ if (@c < 10)
+ goto L_choice_join;
+
+ if (@c < 20)
+ menu
+ @choice_n$[0], L_MenuItems1,
+ @choice_n$[1], L_MenuItems1,
+ @choice_n$[2], L_MenuItems1,
+ @choice_n$[3], L_MenuItems1,
+ @choice_n$[4], L_MenuItems1,
+ @choice_n$[5], L_MenuItems1,
+ @choice_n$[6], L_MenuItems1,
+ @choice_n$[7], L_MenuItems1,
+ @choice_n$[8], L_MenuItems1,
+ @choice_n$[9], L_MenuItems1,
+ @choice_n$[10], L_MenuItems1,
+ @choice_n$[11], L_MenuItems1,
+ @choice_n$[12], L_MenuItems1,
+ @choice_n$[13], L_MenuItems1,
+ @choice_n$[14], L_MenuItems1,
+ @choice_n$[15], L_MenuItems1,
+ @choice_n$[16], L_MenuItems1,
+ @choice_n$[17], L_MenuItems1,
+ @choice_n$[18], L_MenuItems1,
+ @choice_n$[19], L_MenuItems1;
+ goto L_MenuItems1;
+
+L_MenuItems1:
+ if (@c < 20)
+ goto L_choice_join;
+
+ menu
+ @choice_n$[0], L_choice_join,
+ @choice_n$[1], L_choice_join,
+ @choice_n$[2], L_choice_join,
+ @choice_n$[3], L_choice_join,
+ @choice_n$[4], L_choice_join,
+ @choice_n$[5], L_choice_join,
+ @choice_n$[6], L_choice_join,
+ @choice_n$[7], L_choice_join,
+ @choice_n$[8], L_choice_join,
+ @choice_n$[9], L_choice_join,
+ @choice_n$[10], L_choice_join,
+ @choice_n$[11], L_choice_join,
+ @choice_n$[12], L_choice_join,
+ @choice_n$[13], L_choice_join,
+ @choice_n$[14], L_choice_join,
+ @choice_n$[15], L_choice_join,
+ @choice_n$[16], L_choice_join,
+ @choice_n$[17], L_choice_join,
+ @choice_n$[18], L_choice_join,
+ @choice_n$[19], L_choice_join,
+ @choice_n$[20], L_choice_join,
+ @choice_n$[21], L_choice_join,
+ @choice_n$[22], L_choice_join,
+ @choice_n$[23], L_choice_join,
+ @choice_n$[24], L_choice_join,
+ @choice_n$[25], L_choice_join,
+ @choice_n$[26], L_choice_join,
+ @choice_n$[27], L_choice_join,
+ @choice_n$[28], L_choice_join,
+ @choice_n$[29], L_choice_join,
+ @choice_n$[30], L_choice_join,
+ @choice_n$[31], L_choice_join;
+
+L_choice_join:
+ set @menu, @menu - 1;
+ set @item$, @choice_v$[@menu];
+ set @index, @choice_i[@menu];
+ if (@menu >= @c)
+ set @item$, "";
+ goto L_Clean;
+
+L_Clean:
+ set @menu, 0;
+ set @items_nr, 0;
+ set @c, 0;
+ set @current_index, 0;
+ set @i, 0;
+ set @current$, 0;
+ set @current_name$, "";
+ cleararray @choice_v$, "", getarraysize(@choice_v$);
+ cleararray @choice_n$, "", getarraysize(@choice_n$);
+ cleararray @choice_i, 0, getarraysize(@choice_i);
+ return;
+
+L_ArrayLengthMismatch:
+ debugmes "@items$ and @item_names$ array length mismatch";
+ mapexit;
+}
diff --git a/world/map/npc/functions/quiz.txt b/world/map/npc/functions/quiz.txt
new file mode 100644
index 00000000..ea10a3c4
--- /dev/null
+++ b/world/map/npc/functions/quiz.txt
@@ -0,0 +1,93 @@
+function|script|MultiQuiz
+{
+ if((getarraysize(@quiz_answers$) != getarraysize(@quiz_questions$)) ||
+ (@quiz_answers$[0] == "") || (@quiz_questions$[0] == "")) goto L_ArrayError;
+ set @setindex, 1;
+ set @index, rand(0,(getarraysize(@quiz_answers$) - 1));
+ set @question$, @quiz_questions$[@index];
+ mes "\""+ @question$ + "\"";
+ next;
+ mes "Pick the correct answer.";
+ callfunc "Quiz";
+ return;
+
+L_ArrayError:
+ if(@quiz_answers$[0] == "") debugmes "@quiz_answers$ is empty";
+ if(@quiz_questions$[0] == "") debugmes "@quiz_questions$ is empty";
+ if(getarraysize(@quiz_answers$) != getarraysize(@quiz_questions$)) debugmes "Size of @quiz_answers$ is not equal to size of @quiz_questions$";
+ mapexit;
+}
+
+function|script|Quiz
+{
+ if((@choices_nr < 1) || (@choices_nr > 8)) set @choices_nr, 3;
+ if(@choices_nr > getarraysize(@quiz_answers$)) set @choices_nr, getarraysize(@quiz_answers$);
+ if(@quiz_answers$[0] == "") goto L_ArrayError;
+ set @success, 0;
+ if(@setindex < 1) set @index, @answer;
+ set @good, rand(0,(@choices_nr - 1));
+ setarray @choices$, "";
+ cleararray @choices$, "", getarraysize(@choices$);
+ set @loop, 0;
+ goto L_Shuffle;
+
+L_Shuffle:
+ set @nindex, rand(0,(getarraysize(@quiz_answers$) - 1));
+ if(@nindex == @index) goto L_Shuffle; // do not get the good definition
+ set @loop2, 0;
+ goto L_Search;
+
+L_Search:
+ if(@choices$[@loop2] == @quiz_answers$[@nindex]) goto L_Shuffle; // array is already populated with this choice
+ if(@loop2 >= (@choices_nr - 1)) goto L_Shuffle2;
+ set @loop2, @loop2 + 1;
+ goto L_Search;
+
+L_Shuffle2:
+ set @choices$[@loop], @quiz_answers$[@nindex];
+ if(@loop >= (@choices_nr - 1)) goto L_Answer;
+ set @loop, @loop + 1;
+ goto L_Shuffle;
+
+L_Answer:
+ set @choices$[@good], @quiz_answers$[@index]; // set the good definition
+ menu
+ @choices$[0], L_Enter,
+ @choices$[1], L_Enter,
+ @choices$[2], L_Enter,
+ @choices$[3], L_Enter,
+ @choices$[4], L_Enter,
+ @choices$[5], L_Enter,
+ @choices$[6], L_Enter,
+ @choices$[7], L_Enter;
+
+L_Enter:
+ if(@menu != (@good + 1)) goto L_Shift;
+ set @success, 1;
+ goto L_Shift;
+
+L_Shift:
+ if(@shift < @index) set @shift, @index;
+
+ if(@shift == @index) set @quiz_answers$[@index], ""; // do not allow twice the same question
+
+ if((@quiz_questions$[0] != "") && (@shift == @index)) set @quiz_questions$[@index], "";
+ if((@quiz_questions$[0] != "") && (@quiz_questions$[(@shift + 1)] != "")) set @quiz_questions$[@shift], @quiz_questions$[(@shift + 1)];
+ if((@quiz_questions$[0] != "") && (@quiz_questions$[(@shift + 1)] != "")) set @quiz_questions$[(@shift + 1)], "";
+
+ if(@quiz_answers$[(@shift + 1)] != "") set @quiz_answers$[@shift], @quiz_answers$[(@shift + 1)];
+ if(@quiz_answers$[(@shift + 1)] != "") set @quiz_answers$[(@shift + 1)], "";
+
+ set @shift, @shift + 1;
+ if(@quiz_answers$[(@shift + 1)] != "") goto L_Shift;
+ set @shift, 0;
+ goto L_Close;
+
+L_Close:
+ set @answer, 0;
+ return;
+
+L_ArrayError:
+ if(@quiz_answers$[0] == "") debugmes "@quiz_answers$ is empty";
+ mapexit;
+}
diff --git a/world/map/npc/scripts.conf b/world/map/npc/scripts.conf
index 77e9c8a8..d9fbd64d 100644
--- a/world/map/npc/scripts.conf
+++ b/world/map/npc/scripts.conf
@@ -25,6 +25,8 @@ npc: npc/functions/undead_debug.txt
npc: npc/functions/headstyles.txt
npc: npc/functions/global_event_handler.txt
npc: npc/functions/stat_reset.txt
+npc: npc/functions/quiz.txt
+npc: npc/functions/dynamic_menu.txt
// Item Functions
npc: npc/items/magic_gm_top_hat.txt