From 5026fb3faf01db18209d1bbe85cbd16762b01027 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 28 May 2021 13:08:47 -0300 Subject: Optimize Luca script further --- npc/002-1/luca.txt | 179 ++++++++--------------------------------------------- 1 file changed, 27 insertions(+), 152 deletions(-) diff --git a/npc/002-1/luca.txt b/npc/002-1/luca.txt index 747ea0f8..ce36175a 100644 --- a/npc/002-1/luca.txt +++ b/npc/002-1/luca.txt @@ -7,33 +7,35 @@ if (BaseLevel >= 25) goto L_Teach_soon; mesn l("Luca the Hunter"); - mes "\"Ouch! It hurts, this wound I got from battle.\""; + mesq l("Ouch! It hurts, this wound I got from battle."); next; - menu "Tell me about it",L_Exp,"Nevermind",L_Nev; + menu + l("Tell me about it"), L_Exp, + l("Nevermind"), L_Nev; L_Exp: mesn l("Luca the Hunter"); - mes "\"I was just coming back from a long journey. I ran into a group of scorpions and started fighting them for experience.\""; + mesq l("I was just coming back from a long journey. I ran into a group of scorpions and started fighting them for experience."); next; mesn l("Luca the Hunter"); - mes "\"Then, out of a cave came a BLACK one! I had NEVER seen it before!\""; + mesq l("Then, out of a cave came a BLACK one! I had NEVER seen it before!"); next; mesn l("Luca the Hunter"); - mes "\"Luckily I had a camera with me! Here's a picture of it... Let me find it, I put it in my pocket somewhere...\""; + mesq l("Luckily I had a camera with me! Here's a picture of it... Let me find it, I put it in my pocket somewhere..."); next; mesn l("Luca the Hunter"); - mes "\"Oh man! My pockets have been ripped clean off!\""; - goto L_close; + mesq l("Oh man! My pockets have been ripped clean off!"); + close; L_Nev: mesn l("Luca the Hunter"); - mes "\"Hmpf!\""; - goto L_close; + mesq l("Hmpf!"); + close; L_Teach_soon: mesn l("Luca the Hunter"); - mes "\"You've grown quite a bit stronger since I first saw you, strolling around town like that! You know, if you train a little more, maybe we can help each other out a little?\""; - goto L_close; + mesq l("You've grown quite a bit stronger since I first saw you, strolling around town like that! You know, if you train a little more, maybe we can help each other out a little?"); + close; L_Teach: if (getskilllv(SKILL_POOL)) goto L_Teachmore; @@ -132,12 +134,12 @@ L_Teach0_follow: L_wronganswer: mesn l("Luca the Hunter"); - mes "\"No, that was wrong. I suppose you're not as experienced as I thought you'd be.\""; - goto L_close; + mesq l("No, that was wrong. I suppose you're not as experienced as I thought you'd be."); + close; L_Explain: mesn l("Luca the Hunter"); - mes "\"Alright, what do you want to know?\""; + mesq l("Alright, what do you want to know?"); next; goto L_Explain_loop; @@ -271,104 +273,17 @@ L_Teachmore: } goto L_Teachmore; /* - goto L_Teachmore2; - -L_Teachmore2: - setarray @choices, 0,0,0,0,0; - setarray @choice$, "", "", "", "", ""; - @choice_nr = 0; - - @C_focus = 1; - @C_unfocus = 2; - @C_teachbrawling = 3; - @C_teachnothing = 4; - @C_explainagain = 5; - @C_nvm = 6; - @C_focusoverview = 7; - - getactivatedpoolskilllist; - if (!((getskilllv(SKILL_POOL) - @skilllist_count) > 0)) goto L_Teachmore2_nof; - getunactivatedpoolskilllist; - if (@skilllist_count == 0) goto L_Teachmore2_nof; - @choices[@choice_nr] = @C_focus; - @choice$[@choice_nr] = "I would like to focus."; - @choice_nr = @choice_nr + 1; - goto L_Teachmore2_nof; - -L_Teachmore2_nof: - getactivatedpoolskilllist; - if (@skilllist_count == 0) goto L_Teachmore2_nounf; - @choices[@choice_nr] = @C_unfocus; - @choice$[@choice_nr] = "I would like to unfocus."; - @choice_nr = @choice_nr + 1; - goto L_Teachmore2_nounf; - -L_Teachmore2_nounf: - if (!(getskilllv(SKILL_BRAWLING))) - @choices[@choice_nr] = @C_teachbrawling; - if (getskilllv(SKILL_BRAWLING)) - @choices[@choice_nr] = @C_teachnothing; - @choice$[@choice_nr] = "Can you teach me a skill?"; - @choice_nr = @choice_nr + 1; - - @choices[@choice_nr] = @C_explainagain; - @choice$[@choice_nr] = "Can you explain skills again?"; - @choice_nr = @choice_nr + 1; - - if (!(getskilllv(SKILL_POOL))) goto L_Teachmore2_noovv; - @choices[@choice_nr] = @C_focusoverview; - @choice$[@choice_nr] = "Can you tell me what skills I'm currently focused on?"; - @choice_nr = @choice_nr + 1; - goto L_Teachmore2_noovv; - -L_Teachmore2_noovv: - @choices[@choice_nr] = @C_nvm; - @choice$[@choice_nr] = "I'm done for now, thanks!"; - @choice_nr = @choice_nr + 1; - - menu - @choice$[0],L_MenuItems, - @choice$[1],L_MenuItems, - @choice$[2],L_MenuItems, - @choice$[3],L_MenuItems, - @choice$[4],L_MenuItems; - L_MenuItems: @menu = @menu - 1; - if (@choices[@menu] == 0) goto L_close; + if (@choices[@menu] == 0) goto L_Nev;; if (@choices[@menu] == @C_focus) goto L_Focus; if (@choices[@menu] == @C_unfocus) goto L_Unfocus; if (@choices[@menu] == @C_teachbrawling) goto L_Teach_brawling; if (@choices[@menu] == @C_teachnothing) goto L_Teach_nothing; if (@choices[@menu] == @C_explainagain) goto L_Teachmore_explain; if (@choices[@menu] == @C_focusoverview) goto L_Focus_overview; - if (@choices[@menu] == @C_nvm) goto L_close; - goto L_close; - -L_Teachmore_explain: - goto L_Explain; - -L_Focus: - getunactivatedpoolskilllist; - @skilllist_id[@skilllist_count] = 0; - @skilllist_name$[@skilllist_count] = "Nevermind"; - @skilllist_name$[@skilllist_count + 1] = ""; - menu - @skilllist_name$[0], L_MenuItems1, - @skilllist_name$[1], L_MenuItems1, - @skilllist_name$[2], L_MenuItems1, - @skilllist_name$[3], L_MenuItems1, - @skilllist_name$[4], L_MenuItems1, - @skilllist_name$[5], L_MenuItems1, - @skilllist_name$[6], L_MenuItems1, - @skilllist_name$[7], L_MenuItems1; - -L_MenuItems1: - @menu = @menu - 1; - if (@skilllist_id[@menu] == 0) goto L_Teachmore2; - - poolskill @skilllist_id[@menu]; - goto L_Teachmore2; + if (@choices[@menu] == @C_nvm) goto L_Nev;; + goto L_Nev;; L_Unfocus: if (countitem("GrimaceOfDementia") > 0) goto L_Unfocus_menu; @@ -387,8 +302,8 @@ L_Unfocus: mes "\"The potion is called Grimace of Dementia. So the alchemist will know for sure.\""; MAGIC_FLAGS = MAGIC_FLAGS | MFLAG_KNOWS_UNFOCUS_RECIPE; menu - "Ok, I will get a Grimace of Dementia potion", L_close, - "Alright, be right back!", L_close; + "Ok, I will get a Grimace of Dementia potion", L_Nev;, + "Alright, be right back!", L_Nev;; L_Nopotion: mesn l("Luca the Hunter"); @@ -427,34 +342,7 @@ L_MenuItems2: delitem "GrimaceOfDementia", 1; unpoolskill @skilllist_id[@menu]; - goto L_close; - -L_Focus_overview: - getactivatedpoolskilllist; - - if (@skilllist_count != 0) goto L_Focus_overview1; - mesn l("Luca the Hunter"); - mes "\"You aren't focused on a skill at the moment.\""; - next; - goto L_Teachmore2; - -L_Focus_overview1: - mesn l("Luca the Hunter"); - .@message$ = "\"At the moment you are focused on "; - goto L_Focus_overview2; - -L_Focus_overview2: - @skilllist_count = @skilllist_count-1; - .@message$ = .@message$ + @skilllist_name$[@skilllist_count]; - if (@skilllist_count == 0) goto L_Focus_overview3; - .@message$ = .@message$ + ", "; - goto L_Focus_overview2; - -L_Focus_overview3: - .@message$ = .@message$ + ".\""; - mes .@message$; - next; - goto L_Teachmore2; + goto L_Nev;; L_Teach_brawling: mesn l("Luca the Hunter"); @@ -476,7 +364,11 @@ L_Teach_brawling: @SUP_name$ = "Brawling"; @SUP_xp = .Exp_BRAWLING; callfunc "SkillUp"; - goto L_close; + @SUP_id = 0; + @SUP_lvl = 0; + @SUP_name$ = ""; + @SUP_xp = 0; + goto L_Nev;; L_Teach_nothing: mesn l("Luca the Hunter"); @@ -487,23 +379,6 @@ L_Teach_nothing: goto L_Teachmore2; */ -L_close: - @SUP_id = 0; - @SUP_lvl = 0; - @SUP_name$ = ""; - @SUP_xp = 0; - cleararray @choices[0], 0, 4; - cleararray @choice$[0], "", 4; - @choice_nr = 0; - @C_focus = 0; - @C_unfocus = 0; - @C_teachbrawling = 0; - @C_teachnothing = 0; - @C_explainagain = 0; - @C_nvm = 0; - @C_focusoverview = 0; - close; - OnInit: .Exp_BRAWLING = 2000; .distance=5; -- cgit v1.2.3-60-g2f50