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_moscovia.txt | 68 +++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 30 deletions(-) (limited to 'npc/quests/quests_moscovia.txt') diff --git a/npc/quests/quests_moscovia.txt b/npc/quests/quests_moscovia.txt index e49886dbd..130b497cf 100644 --- a/npc/quests/quests_moscovia.txt +++ b/npc/quests/quests_moscovia.txt @@ -2903,7 +2903,7 @@ mosk_in,148,274,1 script Anna#mos 4_F_RUSCHILD,{ mes "["+strcharinfo(PC_NAME)+"]"; mes "What am I going to ask her?"; next; - input .@AnnaInfo$; + input(.@AnnaInfo$); mes "["+strcharinfo(PC_NAME)+"]"; mes "Anna,"; mes ""+.@AnnaInfo$+"?"; @@ -3995,8 +3995,8 @@ moscovia,208,182,7 script Acorn Dealer#mos 4_M_RUSMAN1,{ mes "I'll bet you that they are very fresh!"; mes "How many acorns do you need?"; next; - while(.@input <= 0 || .@input > 500) { - input .@input; + while (true) { + input(.@input); if (.@input <= 0) { mes "[Acorn Dealer]"; mes "Do you want to cancel this trade?"; @@ -4006,7 +4006,9 @@ moscovia,208,182,7 script Acorn Dealer#mos 4_M_RUSMAN1,{ mes "[Acorn Dealer]"; mes "You can't buy more than 500."; next; + continue; } + break; } if (!checkweight(Acorn, .@input)) { mes "[Acorn Dealer]"; @@ -5349,7 +5351,7 @@ mosk_in,221,43,0 script #bowl HIDDEN_NPC,{ mes "Ok, I will stir it up this time."; mes "How many times should I..?"; next; - input .@input; + input(.@input); if (.@input == 20) { mes "-It must be 20 times.-"; next; @@ -5361,7 +5363,7 @@ mosk_in,221,43,0 script #bowl HIDDEN_NPC,{ ++.@maho; ++.@nankai; next; - } else if (!.@input) { + } else if (.@input <= 0) { mes "-I won't stir it up.-"; next; } else if (.@input > 100) { @@ -5453,7 +5455,7 @@ mosk_in,221,43,0 script #bowl HIDDEN_NPC,{ mes "Ok, I will stir it up this time."; mes "How many times should I...?"; next; - input .@input; + input(.@input); if (.@input == 15) { mes "-It must be 15 times.-"; next; @@ -5463,7 +5465,7 @@ mosk_in,221,43,0 script #bowl HIDDEN_NPC,{ ++.@maho; ++.@nankai; next; - } else if (.@input == 0) { + } else if (.@input <= 0) { mes "-I won't stir it up.-"; next; } else if (.@input > 100) { @@ -7070,7 +7072,7 @@ mosk_dun01,45,259,0 script Wall#rus04 HIDDEN_NPC,{ mes "Listen very carefully!"; mes "Left the key up, and shout '^0000ffThe Free wind blows and gets you wherever you want^000000'."; next; - input .@input$; + input(.@input$); if (.@input$ == "The Free wind blows and gets you wherever you want") { mes "["+ strcharinfo(PC_NAME) +"]"; mes "^0000ff "+ .@input$ +" !! ^000000"; @@ -7778,7 +7780,7 @@ moscovia,206,81,0 script Vassili Grandpapa#rus07 4_M_05,{ mes "[Vassili Grandpapa]"; mes "Eh? What do you want to ask me about?"; next; - input .@input$; + input(.@input$); if (.@input$ == "Red Ring") { mes "[Vassili Grandpapa]"; mes "Red Ring?! Why are you looking for that?"; @@ -8126,7 +8128,7 @@ moscovia,213,216,3 script Ryubaba#rus08 4_F_RUSWOMAN2,{ mes "Ah, I forgot asking you."; mes "Why are you here?"; next; - input .@input$; + input(.@input$); if (.@input$ == "Red Ring") { mes "[Ryubaba]"; mes "A Red Ring?!"; @@ -9036,7 +9038,7 @@ prontera,228,279,3 script Wanderer#rus24 4_M_RUSMAN2,{ mes "Ah, yes. I have been there..."; mes "By the way, the important thing is.. are you....."; next; - input .@input$; + input(.@input$); if (.@input$ == "Igor") { mes "["+ strcharinfo(PC_NAME) +"]"; mes "Ah, yes. I have been there..."; @@ -9692,7 +9694,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "["+ strcharinfo(PC_NAME) +"]"; mes "Eh, eh.. I mean.. I say.. spell..."; next; - input .@input$; + input(.@input$); if (.@input$ == "Spellshield Protection") { mes "["+ strcharinfo(PC_NAME) +"]"; mes "Eh, eh.. I mean.. I say.. spell..."; @@ -10225,19 +10227,22 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "How many do you want me to make? I can only make 100 at a time. If you don't want any, then just say '0'. Kehehehehe."; next; while(1) { - input .@input; - if (!.@input) { + input(.@input); + if (.@input <= 0) { mes "[Baba Yaga]"; mes "You don't want it?"; next; mes "[Baba Yaga]"; mes "I don't understand you. What do you want? Kehehehehe."; close; - } else if (.@input > 100) { + } + if (.@input > 100) { mes "[Baba Yaga]"; mes "I said no more then 100 at a time. Kehehehehe."; next; - } else break; + continue; + } + break; } .@redpotion_send = .@input; .@redtube_send = .@input; @@ -10312,19 +10317,22 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{ mes "How many do you want me to make? Tell me the number less than 100. If you don't want, tell me zero. Kehehehehe."; next; while(1) { - input .@input; - if (!.@input) { + input(.@input); + if (.@input <= 0) { mes "[Baba Yaga]"; mes "You don't want it?"; next; mes "[Baba Yaga]"; mes "I don't understand you. What do you want? Kehehehehe."; close; - } else if (.@input > 100) { + } + if (.@input > 100) { mes "[Baba Yaga]"; mes "I said no more then 100 at a time. Kehehehehe."; next; - } else break; + continue; + } + break; } .@yellpotion_send = .@input; .@yelltube_send = .@input; @@ -10437,7 +10445,7 @@ OnTouch: if (rand(1,4) == 3) { mes "- You almost get hit and dodge its attack and cast the spell !! -"; next; - input .@input$; + input(.@input$); if (.@input$ == "Good feed is orange-flavored") { mes "["+ strcharinfo(PC_NAME) +"]"; mes ""+ .@input$ +" !!!"; @@ -10536,7 +10544,7 @@ OnTouch: if (rand(1,4) == 3) { mes "- You almost get hit and dodge its attack and cast the spell !! -"; next; - input .@input$; + input(.@input$); if (.@input$ == "Good feed is orange-flavored") { mes "["+ strcharinfo(PC_NAME) +"]"; mes ""+ .@input$ +" !!!"; @@ -10636,7 +10644,7 @@ OnTouch: if (rand(1,4) == 3) { mes "- You almost get hit and dodge its attack and cast the spell !! -"; next; - input .@input$; + input(.@input$); if (.@input$ == "Good feed is orange-flavored") { mes "["+ strcharinfo(PC_NAME) +"]"; mes ""+ .@input$ +" !!!"; @@ -11182,7 +11190,7 @@ amatsu,233,234,3 script Momotoro Publisher#rus42 4_F_JPN2,{ mes "[Momotoro Publisher]"; mes "What? Ah, did you come here to pick up the book? Please, let me know your name?"; next; - input .@input$; + input(.@input$); if (.@input$ == "Baba Yaga") { mes "["+ strcharinfo(PC_NAME) +"]"; mes "I am "+ .@input$ +"."; @@ -11643,7 +11651,7 @@ pay_dun04,163,186,0 script Ghost Tree#rus45 HIDDEN_NPC,{ mes "Ok then, who was the first?!"; next; .@rus_kafra01 = 0; - input .@input$; + input(.@input$); if (.@input$ == "Curly Sue") { ++.@rus_kafra01; mes "["+ strcharinfo(PC_NAME) +"]"; @@ -11658,7 +11666,7 @@ pay_dun04,163,186,0 script Ghost Tree#rus45 HIDDEN_NPC,{ mes "[Ghost Tree]"; mes "Who was the second?"; next; - input .@input$; + input(.@input$); if (.@input$ == "Jasmine") { ++.@rus_kafra01; mes "["+ strcharinfo(PC_NAME) +"]"; @@ -11673,7 +11681,7 @@ pay_dun04,163,186,0 script Ghost Tree#rus45 HIDDEN_NPC,{ mes "[Ghost Tree]"; mes "Who was the third?"; next; - input .@input$; + input(.@input$); if (.@input$ == "Roxie") { ++.@rus_kafra01; mes "["+ strcharinfo(PC_NAME) +"]"; @@ -11688,7 +11696,7 @@ pay_dun04,163,186,0 script Ghost Tree#rus45 HIDDEN_NPC,{ mes "[Ghost Tree]"; mes "And then who was the forth?"; next; - input .@input$; + input(.@input$); if (.@input$ == "Pavianne") { ++.@rus_kafra01; mes "["+ strcharinfo(PC_NAME) +"]"; @@ -11703,7 +11711,7 @@ pay_dun04,163,186,0 script Ghost Tree#rus45 HIDDEN_NPC,{ mes "[Ghost Tree]"; mes "And who was the last?!"; next; - input .@input$; + input(.@input$); if (.@input$ == "Blossom") { ++.@rus_kafra01; mes "["+ strcharinfo(PC_NAME) +"]"; @@ -11768,7 +11776,7 @@ pay_dun04,163,186,0 script Ghost Tree#rus45 HIDDEN_NPC,{ mes "[Ghost Tree]"; mes "Have you heard all of them? Who broke the 'Hat of the Sun God'?!"; next; - input .@input$; + input(.@input$); if (.@input$ == "Antonio") { mes "["+ strcharinfo(PC_NAME) +"]"; mes ""+ .@input$ +" !!"; -- cgit v1.2.3-70-g09d2