From 371d056df80b6f83484534f64883c3d020c4112d Mon Sep 17 00:00:00 2001 From: Emistry Haoyan Date: Sun, 16 Jun 2019 18:44:45 +0800 Subject: Sanitize handling of the input() values. - avoid potential hacks for old scripts that use `input()` script commands. Signed-off-by: Haru --- npc/quests/quests_nameless.txt | 52 ++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 27 deletions(-) (limited to 'npc/quests/quests_nameless.txt') diff --git a/npc/quests/quests_nameless.txt b/npc/quests/quests_nameless.txt index 55f5c319c..69c0ad902 100644 --- a/npc/quests/quests_nameless.txt +++ b/npc/quests/quests_nameless.txt @@ -1494,13 +1494,13 @@ sec_in02,15,15,4 script boss::boss_aru_monas 1_M_SIGNMONK,{ mes ""+aru_monas; close; case 2: - input .@input,0,1000; + input(.@input, 0, 1000); aru_monas = .@input; mes " "; mes ""+aru_monas; close; case 3: - input .@input,0,1000; + input(.@input, 0, 1000); prt_curse = .@input; mes " "; mes ""+prt_curse; @@ -3873,7 +3873,7 @@ cmd_fild01,55,160,0 script Heap of Earth CLEAR_NPC,{ mes "Mystic Heater de Elegance"; mes "operates? Hmm? Well?"; next; - input .@input$; + input(.@input$); if (.@input$ == "3 Centrifuge Wavelength Theory") { mes "[Dorian]"; mes "That's right. My apologies."; @@ -3917,16 +3917,14 @@ cmd_fild01,55,160,0 script Heap of Earth CLEAR_NPC,{ diamond_edq = 9; close; } - else { - mes "[Dorian]"; - mes "Oh? You sound dissatisfied"; - mes "with my explanation. Well..."; - mes "I surely can't let you use the"; - mes "machine unless you fathom"; - mes "how it works. Otherwise,"; - mes "you just might break it."; - close; - } + mes "[Dorian]"; + mes "Oh? You sound dissatisfied"; + mes "with my explanation. Well..."; + mes "I surely can't let you use the"; + mes "machine unless you fathom"; + mes "how it works. Otherwise,"; + mes "you just might break it."; + close; case 2: mes "[Dorian]"; mes "Were you too bored while"; @@ -6884,7 +6882,7 @@ in_rogue,359,116,3 script Marybell 4_F_ROGUE,{ mes "Come a little closer,"; mes "and talk right in my ear."; next; - input .@input$; + input(.@input$); if (.@input$ == "The dawn is yet to come.") { mes "[Marybell]"; mes "Valdes sent you?!"; @@ -7387,8 +7385,8 @@ payon,244,62,3 script Moonho Ahn 4_M_HUGRANFA,{ next; while(1) { .@number = rand(1,2); - input .@input$; - if (((.@input$ == "Odd") && (.@number == 1)) || ((.@input$ == "Even") && (.@number == 2))) { + input(.@input$); + if ((.@input$ == "Odd" && .@number == 1) || (.@input$ == "Even" && .@number == 2)) { ++.@number_right; mes "[Moonho Ahn]"; mes "^0000ff"+.@input$+"^000000?"; @@ -7401,7 +7399,7 @@ payon,244,62,3 script Moonho Ahn 4_M_HUGRANFA,{ next; } } - else if (((.@input$ == "Odd") && (.@number == 2)) || ((.@input$ == "Even") && (.@number == 1))) { + else if ((.@input$ == "Odd" && .@number == 2) || (.@input$ == "Even" && .@number == 1)) { ++.@number_false; mes "[Moonho Ahn]"; mes "Well, it's ^0000FFEven^000000."; @@ -7434,7 +7432,7 @@ payon,244,62,3 script Moonho Ahn 4_M_HUGRANFA,{ next; break; } - if ((.@input$ != "Even") && (.@input$ !="Odd")) { + if (.@input$ != "Even" && .@input$ !="Odd") { mes "[Moonho Ahn]"; mes "You can only declare"; mes "your guess as ^0000FFOdd^000000 or ^0000FFEven^000000."; @@ -7626,8 +7624,8 @@ payon,244,62,3 script Moonho Ahn 4_M_HUGRANFA,{ next; while(1) { .@number = rand(1,2); - input .@input$; - if (((.@input$ == "Odd") && (.@number == 1)) || ((.@input$ == "Even") && (.@number == 2))) { + input(.@input$); + if ((.@input$ == "Odd" && .@number == 1) || (.@input$ == "Even" && .@number == 2)) { ++.@number_right_3; mes "[Moonho Ahn]"; mes "^0000FF"+.@input$+"^000000?"; @@ -7640,7 +7638,7 @@ payon,244,62,3 script Moonho Ahn 4_M_HUGRANFA,{ next; } } - else if (((.@input$ == "Odd") && (.@number == 2)) || ((.@input$ == "Even") && (.@number == 1))) { + else if ((.@input$ == "Odd" && .@number == 2) || (.@input$ == "Even" && .@number == 1)) { ++.@number_false_3; mes "[Moonho Ahn]"; mes "Well, it's ^0000FF"+.@input$+"^000000."; @@ -7668,7 +7666,7 @@ payon,244,62,3 script Moonho Ahn 4_M_HUGRANFA,{ next; break; } - if ((.@input$ != "Even") && (.@input$ !="Odd")) { + if (.@input$ != "Even" && .@input$ !="Odd") { mes "[Moonho Ahn]"; mes "You can only declare"; mes "your guess as ^0000FFOdd^000000 or ^0000FFEven^000000."; @@ -8559,7 +8557,7 @@ moc_fild17,209,235,0 script Odd Slab HIDDEN_NPC,4,4,{ mes "Well, I guess"; mes "I should talk to it. Um..."; next; - input .@input$; + input(.@input$); if (.@input$ == "Weii arr prowd Z G gna") { mes "[Odd Slab]"; mes "^FF0000*Creak Creak*"; @@ -8571,7 +8569,7 @@ moc_fild17,209,235,0 script Odd Slab HIDDEN_NPC,4,4,{ mes "I must be doing alright."; mes "Now what do I say?"; next; - input .@input$; + input(.@input$); if (.@input$ == "Aynoen hwo sspotp uys") { mes "[Odd Slab]"; mes "^FF0000*Creak Creak*"; @@ -8581,7 +8579,7 @@ moc_fild17,209,235,0 script Odd Slab HIDDEN_NPC,4,4,{ mes "Heh! I'm on the right"; mes "track. Now what do I say?"; next; - input .@input$; + input(.@input$); if (.@input$ == "wlil eb kckide on htier ssa!") { mes "[Odd Slab]"; mes "*Creak Creak*"; @@ -10169,11 +10167,11 @@ moc_fild18,108,116,0 script #treasure CLEAR_NPC,{ mes "to remove the chest's magical"; mes "protection to get the treasure.^000000"; next; - input .@input$; + input(.@input$); getpartymember(getcharid(CHAR_ID_PARTY)); .@partymembercount = $@partymembercount; if (.@partymembercount > 1) { - if (((.@input$ == "OpenSesame") && (treasure_nd == 9)) || ((.@input$ == "UnlockTreasure") && (treasure_nd == 10))) { + if ((.@input$ == "OpenSesame" && treasure_nd == 9) || (.@input$ == "UnlockTreasure" && treasure_nd == 10)) { mes "^3355FFThe Z Gang must have split"; mes "the spell document in two"; mes "parts because one person"; -- cgit v1.2.3-60-g2f50