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
|
// TMW2 scripts.
// Authors:
// Jesusalva
// TMW Org.
// Description:
// Responsible for recovering the lost pages (SpellBookPage)
// helperBookpages*
//
// NivalisQuest_BlueSagePagefinder STRUCTURE
// FIELD 1:
// MAIN STATE
// FIELD 2:
// nº of pages found (0~31)
// FIELD 3:
// nº of duplicates found (for randomness control - capped at 60)
020-7-1,36,39,4 script Ensio NPC_BLUESAGEWORKER_MB,{
function askQuestion;
function helpLogic;
.@qt=getq2(NivalisQuest_BlueSagePagefinder);
mesn;
if (.@qt == 31)
mesq l("We'd never be able to recover our books so quickly without your help. Thanks!");
else if (.@qt >= 27)
mesq l("There are only a few pages missing.");
else if (.@qt >= 19)
mesq l("Wow, you already found quite a lot of bookpages. Please keep it up!");
else if (.@qt >= 9)
mesq l("Thanks for the pages you brought. There are still some missing.");
else if (.@qt)
mesq l("So many bookpages are still missing...");
else
mesc l("*sigh*");
if (getq(NivalisQuest_BlueSagePagefinder))
close;
next;
mesn;
mesq l("Hello. Did you come here to see the library? There isn't much left... But we're working on recovering the books by collecting the ripped out book pages, sorting them and recreating the books.");
askQuestion();
close;
function askQuestion {
do {
.@q=getq(NivalisQuest_BlueSage);
.@q2=getq2(NivalisQuest_BlueSage);
.@q3=getq3(NivalisQuest_BlueSage);
.@qs=BSQuestion(getq(NivalisQuest_BlueSage));
.@qo=getq(NivalisQuest_BlueSagePagefinder);
.@qt=getq2(NivalisQuest_BlueSagePagefinder);
next;
mes "";
select
rif(!.@qo, "Can I help you somehow?"),
rif(.@qs & BS_QVISITOR, l("Do you know anything about the strange visitor?")),
rif(.@qs & BS_QHELPER, l("What's your opinion of Peetu and his work?")),
any(l("I need to leave."), l("See you."), l("Bye."), l("Good luck with that. See you in ten years or something."));
mes "";
switch (@menu) {
case 1:
mesn;
mesq l("Oh, would you? That'd be great! You see, the slimes ate most of the books and it is difficult to retrieve the bookpages. If you feel capable of this task, you could go out to hunt the Blue and White Slimes, to get the @@ back from them.", getitemlink(SpellBookPage));
if (!countitem(SpellBookPage))
break;
helpLogic();
break;
case 2:
mesn;
mesq l("Visitor with a mask? Ah, I think I know who are you talking about. Black clothes and a golden mask. Rather strange guy.");
next;
mesn;
mesq l("He was looking around in the library a while, and then came to ask about our research. He seemed to be particularly interested in our experiments with the slimes.");
next;
mesn;
mesq l("Heh, I wonder what he would've said if he'd have visited us a little bit later. Mh, now that I think about it, the accident with the slimes happened just the night after he was here.");
if (!(.@q2 & .bsId))
setq2 NivalisQuest_BlueSage, .@q2 | .bsId;
break;
case 3:
mesn;
mesq l("Oh, I can't really tell. I'm mostly working in the library, while he's very involved in the research.");
break;
}
} while (@menu != 4);
close;
}
function helpLogic {
do {
inventoryplace ThetaBook, 1;
.@qt=getq2(NivalisQuest_BlueSagePagefinder);
.@qx=getq3(NivalisQuest_BlueSagePagefinder);
next;
mesc l("Donate 1/@@ @@ to Ensio?", countitem(SpellBookPage), getitemlink(SpellBookPage));
mes "";
// break(); works, right?
if (askyesno() == ASK_NO)
break;
delitem SpellBookPage, 1;
if (rand(90 - .@qt) < 36 && .@qx < 60) {
// Old Page
setq3 NivalisQuest_BlueSagePagefinder, .@qx+1;
mesn;
mesq "%%f " + l("Mh, let me see. We already have a copy of this page, but it's helpful nevertheless. Thank you.");
} else {
// Original Page
setq2 NivalisQuest_BlueSagePagefinder, .@qt+1;
mesn;
mesq "%%H " + l("Ah, wonderful! This is a page we haven't found yet!");
}
getexp 525, 32; // about 3% of exp table.
// Maybe you've completed the requeriment?
.@qt=getq2(NivalisQuest_BlueSagePagefinder);
if (.@qt >= 31) {
next;
mesn;
mesq l("Amazing. I think you found all the missing pages of which we didn't have a copy. This is a great help! I'll mention this to Nikolai.");
next;
mesn;
mesq l("For now, please accept this @@ as my gratitude.", getitemlink(ThetaBook));
getitem ThetaBook, 1;
setq1 NivalisQuest_BlueSagePagefinder, 1;
// Get any experience below the 60 failed pages threshold
// But you'll get only ~1% per success because it took you no page
// And you'll always get at least 1% bonus for... reasons.
.@x=60-.@qx;
.@x+=1;
getexp 175*.@x, 10*.@x;
break;
}
} while (countitem(SpellBookPage));
return;
}
OnInit:
.bsId=BS_NPC07;
.sex=G_MALE;
.distance=5;
npcsit;
end;
}
020-7-1,33,39,4 script Henriikka NPC_BLUESAGEWORKER_FA,{
function askQuestion;
mesc l("You see a helper looking through some papers that have a strange smell.");
askQuestion();
close;
function askQuestion {
next;
if (.@qt >= 255) {
mesn;
mesq l("I'm so glad we didn't have to go out to hunt the slimes! Thank you!");
} else if (.@qt) {
mesn;
mesq l("If you get any bookpages from the slimes, bring them to Ensio. Thanks for your help!");
} else {
mesn;
mesc l("*sighs*");
mesq l("Oh, hey. Welcome to the library, or what's left of it.");
}
// Mainframe Loop
do {
.@q=getq(NivalisQuest_BlueSage);
.@q2=getq2(NivalisQuest_BlueSage);
.@q3=getq3(NivalisQuest_BlueSage);
.@qs=BSQuestion(getq(NivalisQuest_BlueSage));
.@qt=getq2(NivalisQuest_BlueSagePagefinder);
next;
mes "";
select
rif(.@qt < 255, "What are you doing?"),
rif(.@qs & BS_QVISITOR, l("Do you know anything about the strange visitor?")),
rif(.@qs & BS_QHELPER, l("What's your opinion of Peetu and his work?")),
any(l("I need to leave."), l("See you."), l("Bye."));
mes "";
switch (@menu) {
case 1:
mesn;
mesq l("We're trying to repair the books by collecting the ripped out bookpages and sorting them and copying them for new books. It's a lot to do, and after being eaten by a slime they stink!");
next;
mesn;
mesq l("And a lot of pages are missing, since most of the slimes escaped. I suppose we'll have to go out and hunt them once we're done here. Unless someone else hunt them for us.");
if (!.@qt) {
next;
mesn;
mesq l("Well, these slimes are dangerous, but if you find some pages, be sure to bring them to Ensio. This will help us a lot. Eh, if you're interested in helping, that is. %%1");
}
break;
case 2:
mesn;
mesq l("With a mask? I don't really remember... We have so many visitors. Though I suppose someone wearing a mask would be noticeable... But I'm so worn out from the past few days that I'm just glad I can even recall my own name! Sorry.");
break;
case 3:
mesn;
mesq l("Oh, I never really thought about that. He was the one who failed the sealing, right? But I heard it's a quite difficult spell, so I suppose this could've happened to any mage. I don't know. Why are you asking such difficult questions?");
next;
mesn;
mesq l("I need to go on with sorting the bookpages now.");
break;
}
} while (@menu != 4);
close;
}
OnInit:
.sex=G_FEMALE;
.distance=5;
npcsit;
end;
}
020-7-1,45,39,0 script Teuvo NPC_BLUESAGEWORKER_MA,{
function askQuestion;
mesn;
mesc l("@@ seems to be upset.", .name$);
mesq l("I always thought it was a bad idea to play around with the slimes. And as if holding them in here isn't bad enough, no, they also had to mess around with magic.");
askQuestion();
close;
function askQuestion {
next;
if (.@qt >= 255) {
mesn;
mesq l("Thanks for helping out here. Do you need anything else?");
} else if (.@qt) {
mesn;
mesq l("Did you find some bookpages? Ensio will take them.");
}
// Mainframe Loop
do {
.@q=getq(NivalisQuest_BlueSage);
.@q2=getq2(NivalisQuest_BlueSage);
.@q3=getq3(NivalisQuest_BlueSage);
.@qs=BSQuestion(getq(NivalisQuest_BlueSage));
.@qt=getq2(NivalisQuest_BlueSagePagefinder);
next;
mes "";
select
rif(.@qt == 255, ""),
rif(.@qs & BS_QVISITOR, l("Do you know anything about the strange visitor?")),
rif(.@qs & BS_QHELPER, l("What's your opinion of Peetu and his work?")),
any(l("I need to leave."), l("See you."), l("Bye."));
mes "";
switch (@menu) {
case 2:
mesn;
mesq l("With a mask? Hm. I don't remember.");
break;
case 3:
mesn;
mesq l("Peetu? He's one of those magic wielders who think they can do anything. Heh, you see the result here.");
next;
mesn;
mesq l("But to be fair, from what I've seen Peetu was always very attentive and dutiful.");
if (!(.@q3 & .bsId))
setq3 NivalisQuest_BlueSage, .@q3 | .bsId;
break;
}
} while (@menu != 4);
close;
}
OnInit:
.bsId=BS_NPC07;
.sex=G_MALE;
.distance=5;
npcsit;
end;
}
|