summaryrefslogtreecommitdiff
path: root/localserver/npc/017-1_stranger_blackbox.txt
blob: bdd444d619c80cabe6a4df3ce428c84e7a7d3cdb (plain) (blame)
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
// TMW2 Script
// Author:
//  Jesusalva
// Description:
//  This is the “Stranger” black box.
//  It contains the answers to all the riddles.
//  This file is kept outside the main tree for translation purposes.
//  You thought you could cheat the answers, eh?

//  Syntax:
//  0171_Stranger_BlackBox( difficulty )
//  Where difficulty can be EASY, MEDIUM or HARD.
//  Returns 1 on success, 0 on failure.
function	script	0171_Stranger_BlackBox	{
    switch (getarg(0)) {
        case EASY:
            setarray .@q$, l("Are you cheating?"), l("Should we blame Saulc for bugs?");
            setarray .@r$, "no", "yes";
            setarray .@l$, l("no"), l("yes");
            break;
        case MEDIUM:
            setarray .@q$, l("Are you cheating?"), l("Should we blame Saulc for bugs?");
            setarray .@r$, "no", "yes";
            setarray .@l$, l("no"), l("yes");
            break;
        case HARD:
            setarray .@q$, l("Are you cheating?"), l("Should we blame Saulc for bugs?");
            setarray .@r$, "no", "yes";
            setarray .@l$, l("no"), l("yes");
            break;
        default: return 0;
    }

    .@e=rand(getarraysize(.@q$)-1);
    mesq .@q$[.@e];
    input .@ans$;

    return riddlevalidation(.@ans$, .@r$[.@e], .@l$[.@e]);
}