summaryrefslogtreecommitdiff
path: root/npc/081-1/dungeon.txt
blob: b275ad1884035cadd6632c3eeb53e7f0ddde4a86 (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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
// TMW Script.
// Author:
//    Jesusalva
// Notes:
//    Christmas 2021 - Northen Lights Dungeon Entrance

081-1,68,30,0	script	#0811Nexit	NPC_HIDDEN,0,0,{
    end;
OnTouch:
    if (!isChristmas21()) end;
    if (!X21_START()) end;
    if (!X21_DISPATCH()) { dispbottom l("This looks dangerous, I should talk with Santa before proceeding."); end; }

    /* We need to determine if instance exists and is needed */
    X21INIT();

	.@mapa$="0812@"+X21ID2();
    warp .@mapa$, 90, 298;
    end;
}

081-1,64,34,0	script	#X21_SIGN01	NPC_NO_SPRITE,{
    if (!isChristmas21()) end;
    npctalk3 l("Northern Lights Dungeon - Form a party to join or enter alone. Be careful!");
    end;
OnInit:
    .distance=5;
    end;
}

020-1,78,85,0	script	Santa Helper#Fake	NPC435,{
    function soon;
    function complete;
    function dowarp;
    // Created *after* the event begun (on test server)? Disregard.
    if (TUT_var > 1639278000) { mes l("This account is too young to participate."); close; }
    if (!isChristmas21()) soon();
    if (X21ED2_CLEAR()) complete();
    do
    {
        mesn;
        mesq l("Santa has been so worried this year... What'll I do...");
        select
            rif(X21_START(), l("Can you bring me back to Santa?")),
            l("[Information]"),
            l("Not my problem."),
            rif(X21_START(), l("What's the Frontier of Existence?"));
        mes "";
        switch (@menu) {
        case 1:
            dowarp(); end;
        case 2:
            mesn;
            mesq l("Ah, well, you see... Santa has this... uh... unique friend, let's call him.");
            next;
            mesn;
            mesq l("Actually, is it even right to call a skeleton a \"him\"? With them being undead and all... Wait, I'm getting sidetracked here.");
            next;
            mesn;
            mesq l("So, you see, Santa made this friend called %s. Creepy fella, but Santa has never been one to really judge others.", b("Gak"));
            next;
            mesn;
            mesq l("Really, to make friends with undead, I'll never understand these Sages of Kaizei... Damn, I'm really getting sidetracked today. Sorry.");
            next;
            mesn;
            mesq l("Anyway. Santa is worried about Gak. I think it is anniversary of the death of his wife or something. To be honest, how an undead would mourn the dead is so... Sidetracked. Again.");
            next;
            mesn;
            mesq l("Look, you know Santa and Nikolai are both on the same circle, the Sages of Kaizei, right? Nikolai was representing this order during the %s.", "[@@https://forums.themanaworld.org/viewtopic.php?f=1&t=20921|"+l("Doomsday's Sage Council")+"@@]");
            next;
            mesn;
            mesq l("The biggest meeting of... Sorry. Well, things changed. I don't know how, I'm not a wizard, but Santa went to investigate. Something about cheering his friend up.");
            next;
            mesn;
            mesq l("He is worried with Gak, and we are worried with him; The Sages of Kaizei specialize in transport magic, not on combat magic. If brave adventurers could help him...");
            next;
            if (X21_START()) break;
            select
                l("Why don't you go yourself?"),
                l("Don't worry, I'll help."),
                l("Not my business.");
            mes "";
            if (@menu == 1) {
                mesn;
                mesq l("Didn't you hear me earlier? The Sages of Kaizei specialize in transport magic. Geez, and I was the one getting side-tracked here!");
                next;
            }
            else if (@menu == 2) {
                X21_DOSTART();
                mesn;
                mesq l("Really? You'll do it? Thank you! That's much appreciated!");
                next;
                mesn;
                if (getcharid(1) > 0)
                    mesq l("I hope you and your friends can do it!");
                else
                    mesq l("You may consider forming a party to do it, but who am I to judge if you want to do it alone!");
                next;
                mesn;
                mesq l("I can warp you to where Santa is once you're ready. Be prepared. I believe the place is called... %s.", b(l("The Frontier Of Existence")));
                next;
            }
            break;
        case 4:
            mesn;
            mesq l("Where Santa is, obviously.");
            next;
            mesn;
            mesq l("It's the absolute limit between what exists and what doesn't. If you fall in the æther, you'll cease to exist and nothing can bring you back.");
            next;
            mesn;
            mesq l("...Normally, but whatever the %s set off in motion makes fun of the concept of existence itself.", "[@@https://forums.themanaworld.org/viewtopic.php?f=1&t=20921|"+l("Doomsday's Sage Council")+"@@]");
            next;
            mesn;
            mesq l("Just be careful, I never even heard about æther before Santa decided to help Gak, so I'm pretty sure the regular magic laws are worthless past this point.");
            next;
            break;
        }
    } while (@menu != 3);
    npctalkonce l("Merry Christmas!");
    closeclientdialog;
    close;

function soon {
    mesn;
    mesq l("Hey there, %s. It's not Christmas time right now, so I am just appreciating the view.", strcharinfo(0));
    next;
    mesn;
    mesq l("Christmas Event will happen from %s to %s this year. You can click %s for more details.", b(l("Dec 12th")), b(l("Dec 26th")), "[@@https://forums.themanaworld.org/viewtopic.php?f=68&t=21296|"+l("here")+"@@]");
    close;
}

function complete {
    mesn;
    mesq l("Thanks for helping Santa yet again.");
    next;
    mesn;
    mesq l("I believe he has been trading %s... Do you want to meet him again?", getitemlink(XmasTicket));
    next;
    if (askyesno() == ASK_YES) dowarp();
    close;
}

function dowarp {
    if (!isChristmas21()) end; // Fail-safe
    dispbottom l("Santa Helper : Fly awayyy!!");
    warp "081-1", 58, 103;
    closeclientdialog;
    close;
}

OnInit:
    .distance=5;
    end;
}


081-1,56,63,0	script	Santa	NPC_SANTA,{
    function accepted;
    function idiot;
    function report;
    function gotogak;
    function finished;
    if (!isChristmas21()) end;
    if (!X21_START()) end; // ??
    if (X21ED2_CLEAR()) finished();
    if (X21GAK_GOTO()) gotogak();
    if (X21ED1_CLEAR()) report();
    if (X21BC1_CLEAR()) idiot();
    if (X21_DISPATCH()) accepted();
    /* Not yet started */
    mesn;
    mesq l("ho-hum ho-hum ho-hum, why hello there, %s!", g("Young Heroine", "Young Hero"));
    next;
    mesn;
    mesq l("Welcome to the %s! Try avoiding the edges of this place, you know, æther all over the place, not really an appealing way to leave this world. Ho! Ho! Ho!", b(l("Frontier of Existence")));
    do
    {
    next;
    select
        l("Cool, I'm just taking a look around. Bye."),
        l("What's the Frontier of Existence?"),
        l("What's the æther?"),
        l("Who are you?"),
        l("What are the Sages of Kaizei?"),
        l("How come you're friend with Gak?"),
        l("What should I expect here?"),
        rif(!X21_DISPATCH(), l("I'm ready to help."));
    mes "";
    switch (@menu) {
    case 1: close;
    case 2: // Frontier?
        mesn;
        mesq l("The limit between what exists and what doesn't.");
        next;
        mesn;
        mesq l("Listen, kid, this is more of a thing of nature than magic.");
        next;
        mesn;
        mesq l("Whatever is here, still exists, and can be brought back. Even if at some point they ceased to be.");
        next;
        mesn;
        mesq l("I don't know how this works, and I suspect only a Great Dragon or an Ether Spirit truly knows. So nothing worth worrying about! Ho! Ho! Ho!");
        break;
    case 3: // æther?
        mesn;
        mesq l("Everything and Nothing. It is just a manifestation of Mana, in the end. Even if its properties are almost opposite to regular magic.");
        next;
        mesn;
        mesq l("Except, æther is much more tied to... fundamental particles and whatever. You can't really bend æther to your will.");
        next;
        mesn;
        mesq l("Well, I suspect that if you could, you would be able create stuff, not just transmute. And by \"stuff\", I mean really great stuff.");
        next;
        mesn;
        mesq l("No need to worry with it. If you do fall in an æther pit, though, you'll likely cease to exist, so please don't! Ho! Ho! Ho!");
        break;
    case 4: // you?
        mesn;
        mesq l("Me? I am Santa Claus, of course! Ho! Ho! Ho!");
        break;
    case 5: // Sages?
        mesn;
        mesq l("The %s is an order of astral mages operating in Kaizei. Snowstorms and Avalanches are common, without teleport magic we could risk settlements suddenly going in isolation.", "[@@https://wiki.themanaworld.org/index.php/Sages_of_Kaizei|"+l("Sages of Kaizei")+"@@]");
        next;
        mesn;
        mesq l("But I'm not supposed to talk about Kaizei Politics to foreigners! Ho! Ho! Ho!");
        break;
    case 6: // Gak?
        mesn;
        mesq l("Why wouldn't I be? He is not a naughty kid.");
        break;
    case 7: // Expect?
        mesn;
        mesq l("I don't know.");
        next;
        mesn;
        mesq l("Anything from puzzles to strong foes. Possibly stuff which only barely exist. If you're lucky, a skrylurker.");
        next;
        mesn;
        mesq l("Again, I don't know. But that has never stopped me before! Ho! Ho! Ho!");
        break;
    case 8:
        mesn;
        mesq l("Excellent, I knew I could count on you, %s!", g("Young Heroine", "Young Hero"));
        mesc l("Santa shakes your hand with delight.");
        next;
        mesn;
        mesq l("North of here is a cave, I call it the Northern Lights Dungeon.");
        next;
        mesn;
        mesq l("Something related to Gak's past has been brought back to existence. Go there find whatever it is, I'll wrap it for present! Ho! Ho! Ho!");
        next;
        mesn;
        mesq l("Be careful, though. It is dangerous, after all!");
        if (getcharid(1) < 1) {
            next;
            mesn;
            mesq l("And you may want to form a party, first. Otherwise, you'll have to do it alone.");
        }
        next;
        mesn;
        mesq l("If you have anything else to ask, do it now! I won't offer this chance again! Ho! Ho! Ho!");
        X21_DODISPATCH();
        break;
    }
    } while (true);
    close;

function accepted {
    mesn;
    mesq l("North of here is the entrance to the Northern Lights Dungeon.");
    next;
    mesn;
    mesq l("Something related to Gak's past has been brought past to existence.");
    next;
    mesn;
    mesq l("Go there, find whatever it is, and lets make Christmas a merry time for everyone! Ho! Ho! Ho!");
    if (getcharid(1) < 1) {
        next;
        mesn;
        mesq l("Oh, but you may want to form a party, first. Otherwise, you'll have to do it alone.");
    }
    mesc l("Note: There's a time limit, but you should not run on it unless you stall.");
    close;
}

function idiot {
    mesn;
    mesq l("Have you found anything, %s?", g("Young Heroine", "Young Hero"));
    next;
    if (askyesno() == ASK_YES) {
        mes "";
        mesn;
        mesq l("I may be old but I'm no fool, Ho! Ho! Ho!");
        next;
    }
    mes "";
    mesn;
    mesq l("Keep looking for something to cheer Gak up. Ah, also...");
    next;
    mesn;
    mesq l("I have a hint for you. Use this if you're struck:");
    // This is the solution to Alissa's puzzle
    mesc l("Candies, Identity, Fake Identity, Coup'detat, Slaughter, Proof of the living.");
    next;
    select
        l("Thanks Santa, you're the best!"),
        l("How do I use it?");
    mes "";
    if (@menu == 1) {
        mesn;
        mesq l("I know! And a Merry Christmas for you! Ho! Ho! Ho!");
    } else {
        mesn;
        mesq l("No idea! But I'm sure you'll figure something out! Ho! Ho! Ho!");
    }
    close;
}

function report {
    mesn;
    mesq l("Have you found anything, %s?", g("Young Heroine", "Young Hero"));
    mes "";
    select
        l("I've found Alissa.");
    mes "";
    mesn;
    mesq l("You WHAT?");
    next;
    select
        l("I've found Alissa.");
    mes "";
    mesn;
    mesq l("In name of the Ice, I didn't thought you would find Alissa herself! Ho! Ho! Ho!");
    next;
    mesn;
    mesq l("Congratulations, I guess.");
    next;
    select
        l("Where's Gak?");
    mes "";
    mesn;
    mesq l("Uh? He went home, obviously.");
    next;
    mesn;
    mes "\""+l("...Ah");
    mes l("I guess that's inconvenient to you, isn't it? Hohoho!")+"\"";
    next;
    select
        l("Where does he live?"),
        l("Where's his house?");
    mes "";
    mesn;
    mesq l("I have no idea, he haven't asked for a Christmas gift lately.");
    next;
    mesn;
    mesq l("Maybe you can ask someone else? Hohoho!");
    next;
    // useless Santa...
    select
        l("Where did you last seen him?");
    mes "";
    mesn;
    mesq l("Asphodel Moors. Not sure if there's any significance to him about that place, but well, maybe someone there knows.");
    next;
    mesn;
    mesq l("I also think I saw Kytty around, from Valentine's Day. She may have seen something, who knows.");
    X21GAK_DOGOTO();
    close;
}

function gotogak {
    mesn;
    mesq l("Gak went home, but maybe someone else in Asphodel Moors has seen him. Or maybe Kytty.");
    close;
}

function finished {
    mesn;
    mesq l("Have you been a very good kid this year?");
    askyesno();
    mes "";
    mesn;
    mes "\""+l("Well, whenever you explore that place, you may get some tickets.");
    mes l("I'll exchange these for rares which were featured in other Christmas Events.");
    mes l("An unique chance! Ho! Ho! Ho!")+"\"";
    next;
    mesn;
    mes "\""+l("But keep in mind, you can only get one of each.");
    mes l("So, what'll it be?")+"\"";
    next;
    openshop;
    closeclientdialog;
    close;
}

OnInit:
    .distance=5;
    setarray .prizes, ElfNightcap, TopHat, ShroomHat, FunkyHat,
                      SnowmanSnowGlobe, ChristmasTreeHat, BunnyEars,
                      SantaBeardHat, MushHat, LeatherGoggles, SantaSnowGlobe,
                      MoubooHead, Goggles, Sunglasses, ChristmasElfHat, FaceMask;
    setarray .prices,  375,  500,  625,  750,
                       775,  800,  875,
                      1000, 1050, 1075, 1100,
                      1250, 1375, 1500, 1750, 2000;
	tradertype(NST_CUSTOM);
    freeloop(true);
    for (.@i = 0; .@i < getarraysize(.prizes); .@i++) {
        sellitem(.prizes[.@i], .prices[.@i]);
    }
    freeloop(false);
    end;
OnCountFunds:
	setcurrency(countitem(XmasTicket));
	end;

OnPayFunds:
    if (!X21ED2_CLEAR()) end;
	if( countitem(XmasTicket) < @price )
		end;
    /* Verify if you're not purchasing a dupe */
    /* This requires servercode@712c09c2c6d848243c3426aeb3dbdf730c1e0b08 to work */
    for (.@i=0;.@i < getarraysize(@bought_nameid); .@i++) {
        if (debug || $@XMAS21_OVERRIDE)
            debugmes("%dx %s", @bought_quantity[.@i], getitemname(@bought_nameid[.@i]));

        .@arr = array_find(.prizes, @bought_nameid[.@i]);
        if (.@arr < 0) { dispbottom "REPORT ME: Array Error (Santa)"; end;}
        .@bit = (2 ** .@arr);

        if (#X21PRIZES_SANTA & .@bit) {
            dispbottom l("You already purchased a(n) %s during the event.", getitemlink(@bought_nameid[.@i]));
            dispbottom l("Therefore, the operation was cancelled.");
            end;
        }
    }
	delitem XmasTicket, @price;
    /* Record the items on the bitmask (far more important) */
    /* This requires servercode@712c09c2c6d848243c3426aeb3dbdf730c1e0b08 to work */
    for (.@i=0;.@i < getarraysize(@bought_nameid); .@i++) {
        .@arr = array_find(.prizes, @bought_nameid[.@i]);
        if (.@arr < 0) { dispbottom "REPORT ME: Fatal Array Error (Santa)"; end;}
        .@bit = (2 ** .@arr);
        #X21PRIZES_SANTA = #X21PRIZES_SANTA | .@bit;
    }
	purchaseok();
	end;
}