summaryrefslogtreecommitdiff
path: root/npc/020-7/elias.txt
blob: 2c60ce4659580844d5c5c4ec816c1d221438713d (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
// TMW2 scripts.
// Authors:
//    Jesusalva
//    TMW Org.
// Description:
//    Controls access to Blue Sage Residence
//    Minimum level: 36 (implicit)
//    Minimum jblvl: 16 (implicit)

// NivalisQuest_BlueSage STRUCTURE
//  FIELD 1:
//      INVESTIGATION
//      1 - ACCESS GRANTED
//      2~11 - FOLLOW LOGIC
//      12 - COMPLETE
//      13 - STDBY OUTSIDE
//      14 - STDBY INSIDE
//  FIELD 2:
//      Bitwise (BS_QVISITOR)
//  FIELD 3:
//      Bitwise (BS_QHELPER)

020-7,44,41,0	script	#BlueSageEntry	NPC_HIDDEN,1,1,{
OnTouch:
    .@q=getq(NivalisQuest_BlueSage);
    if (!.@q || .@q == 13) {
        slide 42, 43;
        doevent "Elias::OnAccessDenied";
    }
    end;
}

// Here we start
020-7,40,41,0	script	Elias	NPC_BLUESAGEWORKER_MB,{
    function eliasWorry;
    function eliasQuestion;
    function eliasThankyou;
    function eliasConfirmed;
    mesn;
    mesq l("Hello, and welcome to Blue Sage's Residence, Library, and Nivalis Townhall.");
    // TODO
    .@q=getq(NivalisQuest_BlueSage);
    if (.@q && .@q != 13)
        goto L_Main;
    next;
    mesn;
    mesq l("Due to a recent incident involving slimes, the building is closed to public visits.");
    .@qn=getq(General_Narrator);
    mes "";
    select
        l("That's sad to hear."),
        rif(.@qn == 10 && !.@q, l("I have a letter from Rakinorf.")),
        rif(.@q == 13, l("So? How was it?")),
        l("What happened?");
    mes "";
    switch (@menu) {
        case 2:
            mesn;
            mesq l("Oh, you must be from Hurnscald Household, then. Hand me the letter, I'll have it delivered.");
            next;
            mesn;
            mesq l("Please wait here a short while.");
            setq NivalisQuest_BlueSage, 13, 0, 0;
            break;
        case 3:
            mesn;
            mesq l("Yes, the Blue Sage will see you.");
            next;
            mesn;
            mesq l("Please don't mind the mess, there are slimes everywhere, thanks to Peetu.");
            next;
            mesn;
            mesq l("You may pass. The Sage is on the library waiting for you.");
            setq NivalisQuest_BlueSage, 14, 0, 0;
            break;
        case 4:
            mesn;
            mesq l("Slimes are on the loose. They have escaped, ate several books, and some are still in the building.");
            next;
            mesn;
            mesq l("Some are dangerous, too. Even if you look capable of fighting, the Blue Sage instructed me to prevent anyone from visiting until the mess is cleared.");
            break;
    }
    //goodbye;
    close;

L_Main:
    next;
    // .@q is preserved when you use goto
    switch (.@q) {
        case 1:
        //case 12:
            eliasQuestion();
            break;
        case 3:
        case 6:
        case 9:
            eliasWorry();
            break;
        case 4:
        case 7:
        case 10:
            eliasConfirmed();
            break;
        case 11:
            eliasThankyou();
            break;
        default:
            mesn;
            mesq l("I heard you have been assisting the household staff. For that, I am thankful.");
            break;
    }
    close;

function eliasWorry {
    mesn;
    mesq l("After your questions I'm really getting worried about this guy with the mask. In retrospect it really seems suspicous.");
    next;
    mesn;
    mesq l("It might be a good idea to ask around if anyone else observed something odd connected to this person.");
    return;
}

function eliasConfirmed {
    mesn;
    mesq l("I heard your investigations reminded other people that they observed suspicious behaviour too.");
    next;
    mesn;
    mesq l("It's all my fault, I should've paid more attention! You should talk to Chief Oskari about this.");
    return;
}

function eliasThankyou {
    mesn;
    mesq l("Now that Chief Oskari knows about the sequence of events, the Sage will take care of it. It's really a shame how malicious people can be.");
    next;
    mesn;
    mesq l("Thanks a lot for your help revealing the truth.");
    return;
}

function eliasQuestion {
    select
        l("Can you tell me if there were any unusual visitors before the accident?"),
        l("Thanks, pal. I still got some matters to discuss with the Blue Sage if you excuse me.");
    mes "";
    if (@menu == 2) {
        mesn;
        mesq l("Yes, of course. We have good relations with Hurnscald Town, so you're welcome.");
        close;
    }
    mesn;
    mesq l("Now that Chief Oskari knows about the sequence of events, the Sage will take care of it. It's really a shame how malicious people can be.");
    next;
    mesn;
    mesq l("Mh, let me think. There were quite a few visitors with different concerns, but that's usual at this time of the year.");
    next;
    mesn;
    mesq l("One of them was a bit odd, they were wearing a mask and had a strange way of talking. They said they came from Frostia, which is an elven town in the north. Elves are usually shy, so I thought it would have been rude to ask them to remove the mask.");
    next;
    mesn;
    mesq l("If I remember correctly they wanted to see the library. They looked like a man, but you never know.");
    next;
    mesn;
    mesc l("Elias gets a bit excited.");
    mesq l("Do you think he may have had something to do with the accident? We're a very hospitable house, so I didn't see a reason to deny him the entrance. I mean, his mask might have been a bit unusual, but hey, there could've been many reasons why someone would wear a mask, don't you think?");
    setq1 NivalisQuest_BlueSage, .@q + 1;
    return;
}


OnAccessDenied:
    npctalk3 l("You can't go in there!");
    end;

OnInit:
    .sex=G_MALE;
    .distance=5;
    end;

}