summaryrefslogtreecommitdiff
path: root/npc/080-1/final.txt
blob: a6eb8111635a352ec0d23a2e175f0c1edda2646a (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
// TMW Script.
// Author:
//    Jesusalva
// Notes:
//    Christmas 2021 - Mysterious Glade (Final fights, cutscene & final shops)
// CANON:
//    From now and hence forth, by the power vested to me due to mapmakers being
//    lazy and all that, I declare that it is canon that:
//      - Gak and Alissa used to live on this glade
//      - Back in 2010, Gak went to Asphodel. First event.
//      - Between 2011 and 2015, Gak found out someone built a house here
//      - aka. The Pink Boots mage. Gak also got mad at how they got
//        Zealite and were using it for petty reasons.
//      - Gak took the mask as an offense to Alissa, and the manor as well.
//      - As I forgot who is the Pink Boots mage... I can't say any further.
//      - Oh, and in 2016, Gak went to visit Asphodel again.

080-1,98,41,0	script	Alissa#ED2	NPC_ALISSA,{
    if ('XMAS21ENDING) {
        npctalkonce l("Thanks for bringing Gorrik back to me.");
    }
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
OnInit:
    .distance=4;
    .speed=125;
    npcsit;
    /* I thought in making a shop here */
    /* Valentine Dress, Love Potions, Pinkie Crystal... */
    /* Would be confusing and bad, so removed. */
    end;
}

080-1,97,41,0	script	Gak#X21	NPC_GAK,{
    if (!'XMAS21FINAL)
        end;
    if (!X21ED1_CLEAR())
        end;
    if ('XMAS21CUTSCENE)
        end;
    if ('XMAS21ENDING) {
        openshop;
        closedialog;
        end;
    }
    /* Prevent rushers */
    X21INIT();
    if (getareausers(getmap(), 6) < getmapusers(getmap())) {
        dispbottom l("I wait everyone reach here, first.");
        end;
    }
    inventoryplace Carrot, 1;
    .@gak$=instance_npcname("Gak#X21");
    .@ali$=instance_npcname("Alissa#ED2");
    .@m$=getmap();

    // We're now running a cutscene, lock NPCs
    'XMAS21CUTSCENE=true;

    // Position the NPCs based on Gak's maximum distance and visible window
    enablenpc(.@ali$); // Fail-safe
    setnpcdir(.@ali$, 4); // Fail-safe
    unitwarp(getnpcid(.@ali$), .@m$, 97, 60);
    sleep2(100);
    npcwalkto(97, 42, .@ali$);
    // Look at direction 4: Automatic?
    sleep2(150*11); // Presumed at 150ms/tile, let she get in player window
    npctalk l("GAK!"), .@ali$;
    sleep2(600);
    npctalk l("Alissssa! You... You arrre alive!"), .@gak$;
    sleep2(3000);
    setnpcdir(.@ali$, 4); // Fail-safe
    npctalk l("Of course I am alive, after you did that... That stupid thing! "), .@ali$;
    sleep2(3000);
    npctalk l("Did you forgot I can defend myself?!"), .@ali$;
    sleep2(3000);
    npctalk l("Wellll... Nooo... Buttt... Yesss... I meannn..."), .@gak$;
    sleep2(2000);
    npctalk l("Stop giving excuses, I don't want to hear them!"), .@ali$;
    sleep2(3000);
    npctalk l("Alissssa..."), .@gak$;
    sleep2(2000);
    npctalk l("You idiot, did you really think I would be happy with you giving your life recklessy like that for me??"), .@ali$;
    sleep2(3000);
    npctalk l("..."), .@gak$;
    sleep2(2000);
    npctalk l("Also, where did you even got that ugly blinking mask."), .@ali$;
    sleep2(3000);
    npctalk l("You and me, we have a lot to talk."), .@ali$;
    sleep2(3000);
    npctalk l("Yes Alissssa..."), .@gak$;
    sleep2(3000);
    // Let Alissa direct to her final position
    npcwalkto(98, 41, .@ali$);
    if (X21TYPE() == IOT_PARTY)
        npctalk l("Thanksss %s. I may have now annn earful to listennn, buttt... I'm realllly thankfulll.", strcharinfo(1)), .@gak$;
    else
        npctalk l("Thanksss %s. I may have now annn earful to listennn, buttt... I'm realllly thankfulll.", strcharinfo(0)), .@gak$;
    sleep2(3500);
    npctalk l("Herrre, you cannn have ttthis %s which Eassster Bunny gave me.", b(l("Carrot"))), .@gak$;
    sleep2(500);
    setnpcdir(.@ali$, 0); // Fail-safe
    sleep2(3000);
    npctalk l("He sssaid I could tttrade forrr a rare orrr evennn level up if I gave ittt to GM Santa..."), .@gak$;
    sleep2(500);
    setnpcdir(.@ali$, 0); // Fail-safe
    npcsit(.@ali$);
    sleep2(3000);
    npctalk l("But Alissssa isss worth wayyy morrre thannn thattt. You cannn have ittt."), .@gak$;
    sleep2(2000);
    if (X21TYPE() == IOT_PARTY) {
        npctalk l("%s, in ttthe name of %s, you ssshould tttake ittt.", strcharinfo(0), strcharinfo(1)), .@gak$;
        sleep2(2000);
    }

    // We're done
    'XMAS21CUTSCENE=false;
    'XMAS21ENDING=true;
    maptimer2(getmap(), 10, instance_npcname(.name$)+"::OnFin");
    goto OnFin;

OnFin:
    // Originally not planned, but no time to finish
    // Consider this just another corner I have cut...
    if (!X21ED2_CLEAR()) {
        X21ED2_DOCLEAR();
        getitembound Carrot, 1, 4;
    }
    end;

OnInit:
    .distance=4;
    setarray .prizes, BlinkingEvilRed, BlinkingEvilPink, BlinkingEvil,
                      BlinkingEvilBlue, BlinkingEvilYellow, OperaMask,
                      JesterMask, WitchHat, GuyFawkesMask, GoblinMask;
    setarray .prices, 2050, 2050, 1875,
                      2000, 2000, 1125,
                       875,  550,  300,  300;
	tradertype(NST_CUSTOM);
    freeloop(true);
    for (.@i = 0; .@i < getarraysize(.prizes); .@i++) {
        sellitem(.prizes[.@i], .prices[.@i]);
    }
    freeloop(false);
    npcsit;
    end;

OnInstanceInit:
    npcsit;
    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 (Gak)"; end;}
        .@bit = (2 ** .@arr);

        if (#X21PRIZES_GAK & .@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 (Gak)"; end;}
        .@bit = (2 ** .@arr);
        #X21PRIZES_GAK = #X21PRIZES_GAK | .@bit;
    }
	purchaseok();
	end;
}

// But then, Gak *did* "kidnap" a zealite specialist, right?
080-1,83,136,0	script	#X21BarrierF	NPC_HIDDEN,3,0,{
    if ('XMAS21FINAL)
        end;

    if (mobcount(getmap(), "#X21BarrierF::OnKil")) {
        dispbottom strcharinfo(0) + " : " + l("This clearly is not a real gate; Most likely an illusion to prevent access. I should be able to dispel it by killing the guardians.");
        slide 84, 137;
        if (checkcell(getmap(), 84, 135, cell_chkpass))
            setcells getmap(),  81, 131,  86, 135, 1, "X21LF@"+X21ID();
        end;
    }
    delcells("X21LF@"+X21ID());
    specialeffect(FX_MAGIC_WICKED_SPAWN, AREA, getcharid(3));
    getitem XmasTicket, X21_TICKET_BOSS;
    'XMAS21FINAL = true;
    maptimer2(getmap(), 10, "#X21BarrierF::OnSesame");
    end;
OnInit:
    .distance=1;
    end;
OnSesame:
    dispbottom l("Without the guardians, the illusion is just that: An illusion. The path is clear.");
    getitem XmasTicket, X21_TICKET_SUPPORT;
    getexp X21_EXP_PUZZLE, 0;
    end;
OnKil:
    mapannounce getmap(), "One of the guardians has been eliminated by "+strcharinfo(0), 0;
    getitem XmasTicket, X21_TICKET_SUPPORT + 1;
    X21INIT();
    end;
}

027-1,105,63,0	script	#GakGate	NPC400,{
    if (!isChristmas21()) end;
    if (!X21GAK_GATE()) end;

    mes l("There are several names in fine print below this gargoyle:");
    // Note: This is the list of TMW sysadmins (past and current)
    // Some names may be missing; Apologies in advance if so.
    mes "Bjorn ~ Wushin ~ ElvenProgrammer ~ Freeyorp ~ Frost ~ Jak1 ~ Jaxad ~ Jesusalva ~ MadCamel ~ Reid ~ Gumi ~ Jenalya ~ 4144 ~ o11c ~ Platyna";
    next;
    mes l("Whose name do you press?");
    select
        l("None!"),
        l("Bjorn"),
        l("Wushin"),
        l("ElvenProgrammer"),
        l("Freeyorp"),
        l("Frost"),
        l("Jak1"),
        l("Jaxad"),
        l("Jesusalva"),
        l("MadCamel"),
        l("Reid"),
        l("Gumi"),
        l("Jenalya"),
        l("4144"),
        l("o11c"),
        l("Platyna");
    mes "";
    .@id = @menu - 2;
    if (.@id != XMAS21_KEYWORD) {
        percentheal -10, -100;
    } else {
        X21INIT();
	    .@mapa$="0801@"+X21ID2();
        warp .@mapa$, 84, 145;
    }
    closeclientdialog;
    close;
OnInit:
    .distance=2;
    end;
}

080-1,97,140,0	script	#0801Exit	NPC424,0,0,{
    end;
OnTouch:
    mes l("Warp back?");
    next;
    if (askyesno() == ASK_YES)
        warp "027-2", 50, 29;
    closeclientdialog;
    end;
}

016-2,29,23,0	script	Kytty#X21	NPC430,{
    function showgak;
    if (!isChristmas21() || !X21_START() || !X21GAK_GOTO()) {
        npctalkonce l("Hey there, %s.", strcharinfo(0));
        end;
    }

    mesn;
    mesq l("I'm busy looking for %s. Damn, where are TMW Sysadmins when you need them...", .adm$[XMAS21_KEYWORD]);
    if (XMAS21_KEYWORD > 10)
        mesc l("There's a murderous intent on kytty's eye. Whatever they did was NOT nice.");
    if (!X21GAK_GATE()) showgak();
    close;

function showgak {
    select
        l("Good luck finding them."),
        l("Have you seen Gak?"),
        l("Do you know where Gak lives?");
    mes "";
    switch (@menu) {
    case 2:
        mesn;
        mesq l("Not this year, no.");
        break;
    case 3:
        mesn;
        mesq l("I believe he warps to the world during Halloween and warps back afterwards.");
        next;
        mesn;
        mesq l("...You cannot claim Halloween rewards now that Gak left. But if you must, try interacting with the Gargoyles in the Graveyard, maybe you'll see... something... in one of them, if you look very closely.");
        next;
        mesn;
        mesq l("Unfortunately, it is not a picture of my hubby, so I would rather not.");
        X21GAK_DOGATE();
        break;
    }
    return;
}

OnInit:
    .distance = 5;
    setarray .adm$, "Bjorn", "Wushin", "ElvenProgrammer", "Freeyorp", "Frost", "Jak1", "Jaxad", "Jesusalva", "MadCamel", "Reid", "Gumi", "Jenalya", "4144", "o11c", "Platyna";
    if (!isChristmas21()) goto L_Off;
    goto L_On;

OnClock0000:
    if (!isChristmas21()) goto L_Off;
    goto L_On;

L_On:
    enablenpc .name$;
    end;
L_Off:
    disablenpc .name$;
    end;
}

016-1,84,53,0	script	#X21GwenA	NPC_HIDDEN,0,0,{
end;
OnTouch:
    if (isChristmas21()) warp "016-2", 28, 31;
    end;
}
016-1,84,50,0	script	#X21GwenB	NPC_HIDDEN,0,0,{
end;
OnTouch:
    if (isChristmas21()) warp "016-2", 26, 23;
    end;
}