viewing paste Unknown #53556 | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
prontera,155,155,4  script  Swordsman Guildsman 1_M_YOUNGKNIGHT,{
    if (quest_random == 0) {
        mes("[Swordsman Guildsman]");
        mes("Last Question.");
        mes("If.....");
        next();
        quest_random = rand(1, 2); // First interaction. Set quest_random randomly to 1 or 2.
    }
 
    mes("[Swordsman Guildsman]");
    .@correct_answer = 0; // Helper variable to determine if the question was answered correctly. (Defaults to 0 -> wrong answer!)
 
    switch (quest_random) {
    case 1: // Ask question 1.
        mes("1+3+5 = ???");
        input(.@guess);
 
        if (.@guess == 9)
            .@correct_answer = 1; // Question was answered correctly.
 
        quest_random = 2; // Question 1 answered. Ask question 2 upon next interaction. (Even if answer was wrong.)
        break;
    case 2: // Ask question 2.
        mes("5+9+5 = ???");
        input(.@guess);
 
        if (.@guess == 19)
            .@correct_answer = 1; // Question was answered correctly.
 
        quest_random = 1; // Question 2 answered. Ask question 1 upon next interaction. (Even if answer was wrong.)
        break;
    default: // Value of quest_random is not supported/defined.
        close();
    }
 
    next();
    mes("[Swordsman Guildsman]");
 
    if (.@correct_answer == 1) { // Question was answered correctly.
        mes("Then I'll end your training process and send you to the Swordsman Guild.");
        callfunc("F_NvErase", 1);
        savepoint("izlude", 128, 98); // Old coordinates: (95,104)
        close2();
        warp("izlude_in", 74, 167);
        end;
    }
 
    // Question was not answered correctly.
    mes("Sorry.");
    close();
}
Viewed 1004 times, submitted by Guest.