diff options
author | mekolat <mekolat@gmail.com> | 2015-01-27 13:18:55 -0500 |
---|---|---|
committer | mekolat <mekolat@gmail.com> | 2015-01-27 13:18:55 -0500 |
commit | af5304828c259d500f7c6d93b5ffa735bc1695f5 (patch) | |
tree | 5ec1959e201ae8f9aa6340b7e7b86c616cd6ff93 /world/map | |
parent | 034a1c899c49bb6d11bd4080bb27d068ba72e3bc (diff) | |
download | serverdata-af5304828c259d500f7c6d93b5ffa735bc1695f5.tar.gz serverdata-af5304828c259d500f7c6d93b5ffa735bc1695f5.tar.bz2 serverdata-af5304828c259d500f7c6d93b5ffa735bc1695f5.tar.xz serverdata-af5304828c259d500f7c6d93b5ffa735bc1695f5.zip |
make selim use the dynamic menu
Diffstat (limited to 'world/map')
-rw-r--r-- | world/map/npc/009-2/selim.txt | 299 | ||||
-rw-r--r-- | world/map/npc/010-2/loratay.txt | 6 | ||||
-rw-r--r-- | world/map/npc/functions/dynamic_menu.txt | 11 |
3 files changed, 49 insertions, 267 deletions
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/010-2/loratay.txt b/world/map/npc/010-2/loratay.txt index 8936acad..324f953a 100644 --- a/world/map/npc/010-2/loratay.txt +++ b/world/map/npc/010-2/loratay.txt @@ -487,6 +487,8 @@ 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; + 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."; @@ -542,6 +544,8 @@ L_trim: mes "\"Alright. What is it that you want trimmed?\""; next; + 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"; callfunc "DynamicItemMenu"; @@ -599,6 +603,8 @@ L_lengthen: mes "\"Now, let me see. What is it that you want lengthened?\""; next; + 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"; diff --git a/world/map/npc/functions/dynamic_menu.txt b/world/map/npc/functions/dynamic_menu.txt index 2205cff7..a2a735d6 100644 --- a/world/map/npc/functions/dynamic_menu.txt +++ b/world/map/npc/functions/dynamic_menu.txt @@ -28,12 +28,14 @@ L_pick_choice_loop: 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; @@ -125,6 +127,7 @@ L_MenuItems1: 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; @@ -136,8 +139,9 @@ L_Clean: set @i, 0; set @current, 0; set @current_name$, ""; - cleararray @choice_v, "", getarraysize(@choice_v); + cleararray @choice_v, 0, getarraysize(@choice_v); cleararray @choice_n$, "", getarraysize(@choice_n$); + cleararray @choice_i, 0, getarraysize(@choice_i); return; L_ArrayLengthMismatch: @@ -175,12 +179,14 @@ L_pick_choice_loop: 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; @@ -272,6 +278,7 @@ L_MenuItems1: 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; @@ -280,11 +287,13 @@ 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: |