summaryrefslogtreecommitdiff
path: root/npc/048-2/sageNikolai.txt
blob: f5bb9919f188297784c0142344d5edcb5038e517 (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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
048-2,98,106,0	script	Nikolai	NPC362,{
    @halloween_npc_id = $@halloween_npc_nikolai;
    callfunc "TrickOrTreat";

    @bookpages = ((QUEST_BlueSage & $@Q_BlueSageBookPages_MASK) >> $@Q_BlueSageBookPages_SHIFT);
    @slimes = ((QUEST_BlueSage & $@Q_BlueSageSlimes_MASK) >> $@Q_BlueSageSlimes_SHIFT);
    @material = ((QUEST_BlueSage & $@Q_BlueSageMaterial_MASK) >> $@Q_BlueSageMaterial_SHIFT);

    if ((@bookpages == 31)
            && (QUEST_BlueSage & $@Q_BlueSageMaterialInk)
            && (QUEST_BlueSage & $@Q_BlueSageMaterialClaw)
            && (QUEST_BlueSage & $@Q_BlueSageMaterialReed)
            && (QUEST_BlueSage & $@Q_BlueSageMaterialSilk)
            && !(QUEST_BlueSage & $@Q_BlueSageGrimoire))
        goto L_GrimoireReward;

    if ((@slimes == 255) && !(QUEST_BlueSage & $@Q_BlueSageIceSword))
        goto L_SlimesReward;

    if ((QUEST_BlueSage & $@Q_BlueSageGrimoire) && (QUEST_BlueSage & $@Q_BlueSageIceSword))
        goto L_Done;

    if (QUEST_BlueSage > 0)
        goto L_Hints;

    mes "You see a very reputable looking man who is going through some papers. He looks up as you approach.";
    mesn;
    mes "\"Welcome to my mansion. I am Nikolai, member of the Sages of Kaizei.";
    mes "I assume you came to see our famous library? As you can see, it isn't in very good shape due to some... misfortunes. I'm very sorry.\"";
    if (BaseLevel < $@Q_BlueSageMinimumLevel)
        goto L_close;
    next;
    mes "\"You seem to be quite an experienced adventurer. I usually wouldn't ask for this, but since my dear friend Santa mentioned his good experiences with hiring additional helpers in times of pressure, I reconsidered.";
    mes "If you don't mind, every bit of help with our current situation would be appreciated.\"";
    next;
    mes "\"There are many things to take care of at the moment, so if you'd like to aid us, the helpers will be able to tell you what they need.\"";
    goto L_close;

L_Hints:
    mesn;
    mes "\"I heard you started to help out a bit. That's very kind.\"";

    cleararray @choice_idx, 0, 10;
    cleararray @choice$, "", 10;

    @C_startBookpages = 1;
    @C_bookpages = 2;
    @C_startMaterials = 3;
    @C_materials = 4;
    @C_startSlimes = 5;
    @C_slimes = 6;
    @C_startInvestigate = 7;
    @C_investigate = 8;
    @C_investigate2 = 9;
    @C_nevermind = 10;

    // counter of available answers
    @choices_nr = 0;

    if (@bookpages > 0)
        goto L_NoStartBookpages;
    @choice_idx[@choices_nr] = @C_startBookpages;
    @choice$[@choices_nr] = "I heard the slimes ate most of the books...";
    @choices_nr = @choices_nr + 1;
    goto L_NoStartBookpages;

L_NoStartBookpages:
    if ((@bookpages == 0) || (@bookpages == 31))
        goto L_NoBookpages;
    @choice_idx[@choices_nr] = @C_bookpages;
    @choice$[@choices_nr] = "I'm collecting lost bookpages.";
    @choices_nr = @choices_nr + 1;
    goto L_NoBookpages;

L_NoBookpages:
    if (@material > 0)
        goto L_NoStartMaterials;
    @choice_idx[@choices_nr] = @C_startMaterials;
    @choice$[@choices_nr] = "There were many valuable books in your library, right?";
    @choices_nr = @choices_nr + 1;
    goto L_NoStartMaterials;

L_NoStartMaterials:
    if ((@material == 0) || (@material == 15))
        goto L_NoMaterials;
    @choice_idx[@choices_nr] = @C_materials;
    @choice$[@choices_nr] = "I brought some material to repair the books.";
    @choices_nr = @choices_nr + 1;
    goto L_NoMaterials;

L_NoMaterials:
    if (@slimes > 0)
        goto L_NoStartSlimes;
    @choice_idx[@choices_nr] = @C_startSlimes;
    @choice$[@choices_nr] = "Those slimes really caused a mess!";
    @choices_nr = @choices_nr + 1;
    goto L_NoStartSlimes;

L_NoStartSlimes:
    if ((@slimes == 0) || (@slimes == 255))
        goto L_NoSlimes;
    @choice_idx[@choices_nr] = @C_slimes;
    @choice$[@choices_nr] = "I'm hunting the remaining slimes in the library.";
    @choices_nr = @choices_nr + 1;
    goto L_NoSlimes;

L_NoSlimes:
    if (QL_BSAGE_INVESTIGATE > 0 && QL_BSAGE_INVESTIGATE < 13)
        goto L_NoStartInvestigate;
    @choice_idx[@choices_nr] = @C_startInvestigate;
    @choice$[@choices_nr] = "How did this all happen?";
    @choices_nr = @choices_nr + 1;
    goto L_NoStartInvestigate;

L_NoStartInvestigate:
    if ((QL_BSAGE_INVESTIGATE < 2) || (QL_BSAGE_INVESTIGATE > 11 && QL_BSAGE_INVESTIGATE < 13))
        goto L_NoInvestigate;
    @choice_idx[@choices_nr] = @C_investigate;
    @choice$[@choices_nr] = "I'm trying to find out how that accident could've happened.";
    @choices_nr = @choices_nr + 1;
    goto L_NoInvestigate;

L_NoInvestigate:
    if (QL_BSAGE_INVESTIGATE != 11)
        goto L_NoInvestigate2;
    @choice_idx[@choices_nr] = @C_investigate2;
    @choice$[@choices_nr] = "I told Chief Oskari what I found out about the accident.";
    @choices_nr = @choices_nr + 1;
    goto L_NoInvestigate2;

L_NoInvestigate2:
    @choice_idx[@choices_nr] = @C_nevermind;
    @choice$[@choices_nr] = "Nevermind.";

    menu
        @choice$[0],L_MenuChoice,
        @choice$[1],L_MenuChoice,
        @choice$[2],L_MenuChoice,
        @choice$[3],L_MenuChoice,
        @choice$[4],L_MenuChoice,
        @choice$[5],L_MenuChoice,
        @choice$[6],L_MenuChoice,
        @choice$[7],L_MenuChoice,
        @choice$[8],L_MenuChoice,
        @choice$[9],L_MenuChoice;

L_MenuChoice:
    @menu = @menu - 1;
    if (@choice_idx[@menu] == 0)
        goto L_close;
    if (@choice_idx[@menu] == @C_startBookpages)
        goto L_StartPagesAdvice;
    if (@choice_idx[@menu] == @C_bookpages)
        goto L_PagesAdvice;
    if (@choice_idx[@menu] == @C_startMaterials)
        goto L_StartMaterialAdvice;
    if (@choice_idx[@menu] == @C_materials)
        goto L_MaterialAdvice;
    if (@choice_idx[@menu] == @C_startSlimes)
        goto L_StartSlimesAdvice;
    if (@choice_idx[@menu] == @C_slimes)
        goto L_SlimesAdvice;
    if (@choice_idx[@menu] == @C_startInvestigate)
        goto L_StartInvAdvice;
    if (@choice_idx[@menu] == @C_investigate)
        goto L_InvestigateAdvice;
    if (@choice_idx[@menu] == @C_investigate2)
        goto L_InvestigateAdvice2;
    if ((@choice_idx[@menu] == @C_nevermind))
        goto L_close;
     goto L_close;

L_StartPagesAdvice:
    // I heard the slimes ate most of the books...
    mesn;
    mes "\"This is true. But while hunting the slimes we discovered that they occasionaly drop bookpages that are still legible.";
    mes "Since we had several copies of nearly all the books, we might be able to recreate most of them if we can get at least one copy of each page.\"";
    goto L_close;

L_PagesAdvice:
    // I'm collecting lost bookpages.
    mesn;
    mes "\"Excellent! This will save us a lot of time. Ensio coordinates the sorting of the pages.\"";
    goto L_close;

L_StartMaterialAdvice:
    // There were many valuable books in your library, right?
    mes "He sighs.";
    mesn;
    mes "\"Yes. There were some really old and rare pieces.\"";
    next;
    mes "\"We're going to recreate some of them, but I'm not sure if we have all the needed materials. If you'd like to help you could ask around if someone is missing something.\"";
    goto L_close;

L_MaterialAdvice:
    // I brought some material to repair the books.
    mesn;
    mes "\"That's very generous! Though I think not everyone has all they need yet.\"";
    goto L_close;

L_StartSlimesAdvice:
    // Those slimes really caused a mess!
    mesn;
    mes "\"Indeed. My helpers did great work to clean the worst of it, but there are still some remaining slimes in the deeper parts of the library.\"";
    goto L_close;

L_SlimesAdvice:
    // I'm hunting the remaining slimes in the library.
    mesn;
    mes "\"You're a great help! All helpers who would be capable of dealing with the slimes are occupied with other tasks.\"";
    goto L_close;

L_StartInvAdvice:
    // How did this all happen?
    mesn;
    mes "\"We're not sure yet. The helper who was responsible for sealing away the slimes has been sent to his room until the situation calms down and we can start an investigation.\"";
    goto L_close;

L_InvestigateAdvice:
    // I'm trying to find out how that accident could've happened.
    mesn;
    mes "\"I see. Well, we were too busy to start with that ourselves, but having someone unbiased looking at this case might be a good thing.\"";
    next;
    mes "\"It might be good if you talk to Elias at the reception. He usually has a very good overview of all the things going on and especially about visitors.\"";
    goto L_close;

L_InvestigateAdvice2:
    // I told Chief Oskari what I found out about the accident.
    mesn;
    mes "\"Yes, he already let me know. Your investigations were very helpful! This is surely something we need to look into further.\"";
    next;
    mes "\"Did you already talk to Peetu? I'm sure he'll be glad to know about your results as well.\"";
    goto L_close;

L_GrimoireReward:
    mesn;
    mes "\"Ah, " + strcharinfo(0) + "! We're making excellent progress with our attempts to recover the important and valuable of the destroyed books, all thanks to you.\"";
    next;
    mes "\"I'd like you to have this as a reward for your help.\"";
    getinventorylist;
    if ((checkweight("Grimoire", 1) == 0) || (@inventorylist_count == 100))
        goto L_Full_Inv;
    getitem "Grimoire", 1;
    QUEST_BlueSage = QUEST_BlueSage | $@Q_BlueSageGrimoire;
    mes "He hands you a very precious book.";
    next;
    mes "\"This is an artifact of great power, and holding it while attempting to use magic will allow you to access your inner magic power much better. Use it wisely.\"";
    goto L_close;

L_SlimesReward:
    mesn;
    mes "\"Ah, I heard you took care of the remaining slimes in the library!\"";
    next;
    mes "\"While looking through some old artifacts that we found during the cleaning, we found this sword. We don't really have a use for it.\"";
    getinventorylist;
    if ((checkweight("IceGladius", 1) == 0) || (@inventorylist_count == 100))
        goto L_Full_Inv;
    getitem "IceGladius", 1;
    QUEST_BlueSage = QUEST_BlueSage | $@Q_BlueSageIceSword;
    mes "He gives you a sword with a shimmering blue blade.";
    next;
    mes "\"I'm sure you can use this well.\"";
    goto L_close;

L_Full_Inv:
    mesn;
    mes "\"You have a very full backback. Please come back when you have more room available.\"";
    goto L_close;

L_Done:
    mesn;
    mesq l("Thanks for all of your help.");
    if (get_nibble(##03_TMWQUEST, 0) == 2 &&
        (##01_MLWORLD & MLP_TMW_YETIKING) &&
        getvaultid()) goto L_VaultQuest;
    goto L_close;

L_VaultQuest:
    mes "";
    mesn strcharinfo(0);
    select
        l("Ask the Blue Sage about Cindy."),
        l("Don't ask");
    if (@menu == 2) close;
    mes "";
    mesn;
    mesq l("Cindy? Never heard of.");
    next;
    mesn strcharinfo(0);
    select
        l("Press."),
        l("Don't press.");
    if (@menu == 2) close;
    mes "";
    mesn;
    mesq l("Look, this is not Nivalis. This is Thermin. If I say I know nothing, I know nothing. Stop wasting my time.");
    next;
    mesn strcharinfo(0);
    select
        l("Press."),
        l("Don't press.");
    if (@menu == 2) close;
    mes "";
    mesn;
    mesq l("Are you deaf?");
    next;
    mesn strcharinfo(0);
    select
        l("Press."),
        l("Don't press.");
    if (@menu == 2) close;
    mes "";
    mesn;
    mesc l("*sigh*");
    next;
    mesn;
    mesq l("Alright, alright, you win. But to make clear, this is NOT my fault. It's Santa's.");
    next;
    mesn;
    mesq l("So, you know about the Sages of Kaizei, right? We used to be twelve, but then Balthasar left after fighting with Santa, and now we're only eleven.");
    next;
    mesn;
    mesq l("Seems like Balthasar is bent on revenge. If you cannot harm a sage, aim at the things they hold dear, they say.");
    next;
    mesn;
    mesq l("Christmas for Santa, the library for myself, and... Well, you guessed it: Cindy.");
    next;
    mesn;
    mesq l("But please don't tell Angela this. She is already a worrywart, knowing Balthasar is after her husband will only makes things worse.");
    next;
    mesn;
    mesq l("Listen, I'll give you either a Wizard Hat or a Wooden Staff for your silence. Do we have a deal?");
    next;
    select
        l("I'll think on it later."),
        l("Deal - Give me a Wizard Hat."),
        l("Deal - Give me a Wooden Staff.");
    mes "";
    if (@menu == 1) close;
    if (@menu == 2) .@it = any(2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209);
    if (@menu == 3) .@it = WoodenStaff;
    inventoryplace .@it, 1;
    getitem .@it, 1;
    set_nibble(##03_TMWQUEST, 0, 3);
    getvaultexp(50);
    mesn;
    mesq l("Here, take this %s. Tell Angela just that I've heard about it and I'll investigate, and she has nothing to worry about.", getitemlink(.@it));
    next;
    mesn;
    mesq l("And thanks. I'll inform her father with telepathy as well.");
    goto L_close;

L_close:
    @inventorylist_count = 0;
    @bookpages = 0;
    @slimes = 0;
    close;
}