summaryrefslogtreecommitdiff
path: root/world/map/npc/annuals/2022.txt
blob: d66aac42f2bf5d38c4346f1bfc7ec3e9b6161b32 (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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
// Evol script
// Year: 2022
//
////////////////////////////////////////////////
// Red Corsair Day

-|script|#CRC2022|32767
{
    end;

OnFirst:
    if (strcharinfo(0) != "Blanc" && GM < G_SYSOP) end;
    wgm "==> CRC Day Phase 1 Started by "+strcharinfo(0);
    set $@CRC22, 1;
    enablenpc "Red Bearer";
    initnpctimer;
    goto OnTimer30000;

OnSecond:
    if (strcharinfo(0) != "Cerise" && GM < G_SYSOP) end;
    wgm "==> CRC Day Phase 2 Started by "+strcharinfo(0);
    set $@CRC22, 2;
    disablenpc "Red Bearer";
    //enablenpc "Zax De'Kagen#CRC";
    // set the sprite (implies enablenpc)
    fakenpcname "Zax De'Kagen#CRC", "Zax De'Kagen#CRC", 1142;
    initnpctimer;
    goto L_Extra;

OnThird:
    if (strcharinfo(0) != "Cerise" && GM < G_SYSOP) end;
    wgm "==> CRC Day Phase 3 Started by "+strcharinfo(0);
    set $@CRC22, 3;
    disablenpc "Halifax";
    stopnpctimer;
    end;

OnStatus:
    if (!$@CRC22) end;
    set $@CRC22Mc, mobcount("007-1", "#CRC2022::OnDie")+
                   mobcount("008-1", "#CRC2022::OnDie")+
                   mobcount("009-1", "#CRC2022::OnDie")+
                   mobcount("011-1", "#CRC2022::OnDie")+
                   mobcount("031-1", "#CRC2022::OnDie")+
                   mobcount("018-1", "#CRC2022::OnDie")+
                   mobcount("018-3", "#CRC2022::OnDie")+
                   7;
    message strcharinfo(0), "Monsters remaining: "+$@CRC22Mc;
    if ($@CRC22Mc <= 0)
        set $@CRC22, 0;
    // TODO: Announce?
    set $@CRC22Mc, 0;
    end;

OnTimer30000:
    // Outskirts
    set $@CRC22Mc, mobcount("008-1", "#CRC2022::OnDie")+1;
    set $@CRC22Gl, 32;
    set $@CRC22M$, "008-1";
    set $@CRC22Xm, 140;
    set $@CRC22Ym, 100;
    if ($@CRC22Mc >= $@CRC22Gl) goto L_End;
    callsub S_Spawn;
    end;

L_End:
    end;

// Redundant
OnTimer15000:
    goto OnTimer30000;

// Redundant
OnTimer45000:
    goto OnTimer30000;

// Redundant
OnTimer60000:
    goto OnTimer30000;

OnTimer70000:
    // Hurnscald [LOCKED DOWN]
    set $@CRC22Mc, mobcount("009-1", "#CRC2022::OnDie")+1;
    set $@CRC22Gl, 100;
    set $@CRC22M$, "009-1";
    set $@CRC22Xm, 100;
    set $@CRC22Ym, 60;
    if ($@CRC22Mc >= $@CRC22Gl) end;
    callsub S_Spawn;
    end;

OnTimer72000:
    // Outskirts
    set $@CRC22Mc, mobcount("008-1", "#CRC2022::OnDie")+1;
    set $@CRC22Gl, 40;
    set $@CRC22M$, "008-1";
    set $@CRC22Xm, 140;
    set $@CRC22Ym, 100;
    if ($@CRC22Mc >= $@CRC22Gl) end;
    callsub S_Spawn;
    end;

// Duplicate for infinity loop bug
OnTimer74000:
    // South Forest (LOCKED DOWN)
    set $@CRC22Mc, mobcount("007-1", "#CRC2022::OnDie")+1;
    set $@CRC22Gl, 110;
    set $@CRC22M$, "007-1";
    set $@CRC22Xm, 130;
    set $@CRC22Ym, 90;
    if ($@CRC22Mc >= $@CRC22Gl) end;
    callsub S_Spawn;
    end;

OnTimer75000:
    // South Forest (LOCKED DOWN)
    set $@CRC22Mc, mobcount("007-1", "#CRC2022::OnDie")+1;
    set $@CRC22Gl, 220;
    set $@CRC22M$, "007-1";
    set $@CRC22Xm, 130;
    set $@CRC22Ym, 90;
    if ($@CRC22Mc >= $@CRC22Gl) end;
    callsub S_Spawn;
    end;

// Duplicate for infinity loop bug
OnTimer76000:
    // West Forest (LOCKED DOWN)
    set $@CRC22Mc, mobcount("011-1", "#CRC2022::OnDie")+1;
    set $@CRC22Gl, 120;
    set $@CRC22M$, "011-1";
    set $@CRC22Xm, 130;
    set $@CRC22Ym, 110;
    if ($@CRC22Mc >= $@CRC22Gl) end;
    callsub S_Spawn;
    end;

OnTimer77000:
    // West Forest (LOCKED DOWN)
    set $@CRC22Mc, mobcount("011-1", "#CRC2022::OnDie")+1;
    set $@CRC22Gl, 240;
    set $@CRC22M$, "011-1";
    set $@CRC22Xm, 130;
    set $@CRC22Ym, 110;
    if ($@CRC22Mc >= $@CRC22Gl) end;
    callsub S_Spawn;
    end;

OnTimer78000:
    // Nivalis Port (LOCKED DOWN)
    set $@CRC22Mc, mobcount("031-1", "#CRC2022::OnDie")+1;
    set $@CRC22Gl, 100;
    set $@CRC22M$, "031-1";
    set $@CRC22Xm, 110;
    set $@CRC22Ym, 130;
    if ($@CRC22Mc >= $@CRC22Gl) end;
    callsub S_Spawn;
    end;

OnTimer80000:
    if ($@CRC22 > 1) goto L_Extra;
    // Nothing at mines yet
    initnpctimer;
    end;

L_Extra:
    // Outskirts [LOCKDOWN]
    set $@CRC22Mc, mobcount("008-1", "#CRC2022::OnDie")+1;
    set $@CRC22Gl, 80;
    set $@CRC22M$, "008-1";
    set $@CRC22Xm, 140;
    set $@CRC22Ym, 100;
    if ($@CRC22Mc >= $@CRC22Gl) end;
    callsub S_Spawn;
    end;

OnTimer84000:
    // Hurnscald Mines (Outskirt)
    set $@CRC22Mc, mobcount("018-1", "#CRC2022::OnDie")+1;
    set $@CRC22Gl, 40;
    set $@CRC22M$, "018-1";
    set $@CRC22Xm, 140;
    set $@CRC22Ym, 100;
    if ($@CRC22Mc >= $@CRC22Gl) end;
    callsub S_Spawn;
    end;

// Duplicate for infinity loop bug
OnTimer86000:
    // Obelisk Cave & Mines [LOCKED DOWN]
    set $@CRC22Mc, mobcount("018-3", "#CRC2022::OnDie")+1;
    set $@CRC22Gl, 100;
    set $@CRC22M$, "018-3";
    set $@CRC22Xm, 180;
    set $@CRC22Ym, 180;
    if ($@CRC22Mc < $@CRC22Gl) end;
    callsub S_Spawn;
    end;

// Duplicate for infinity loop bug
OnTimer88000:
    // Obelisk Cave & Mines [LOCKED DOWN]
    set $@CRC22Mc, mobcount("018-3", "#CRC2022::OnDie")+1;
    set $@CRC22Gl, 200;
    set $@CRC22M$, "018-3";
    set $@CRC22Xm, 180;
    set $@CRC22Ym, 180;
    if ($@CRC22Mc < $@CRC22Gl) end;
    callsub S_Spawn;
    end;

OnTimer89000:
    // Obelisk Cave & Mines [LOCKED DOWN]
    set $@CRC22Mc, mobcount("018-3", "#CRC2022::OnDie")+1;
    set $@CRC22Gl, 300;
    set $@CRC22M$, "018-3";
    set $@CRC22Xm, 180;
    set $@CRC22Ym, 180;
    if ($@CRC22Mc < $@CRC22Gl) end;
    callsub S_Spawn;
    end;

OnTimer90000:
    initnpctimer;
    end;

// Extra wave control system [0]
S_Spawn:
    set $@CRC_IDX, rand(getarraysize($@crc_mobs));

    areamonster $@CRC22M$, 20, 20, $@CRC22Xm, $@CRC22Ym, "", $@crc_mobs[$@CRC_IDX], 1, "#CRC2022::OnDie";

    set $@CRC22Mc, $@CRC22Mc + 1;
    if($@CRC22Mc < $@CRC22Gl) goto S_Spawn;
    return;

OnDie:
    end;

OnInit:
    setarray $@crc_mobs, 1119, 1120, 1121, 1119, 1120, 1121, 1157, 1155, 1163, 1090, 1064, 1119, 1120, 1121, 1119, 1120;
    // Register commands
    registercmd "#crcstart", strnpcinfo(0)+"::OnFirst";
    registercmd "#crcnext", strnpcinfo(0)+"::OnSecond";
    registercmd "#crclast", strnpcinfo(0)+"::OnThird";
    registercmd "#crcstatus", strnpcinfo(0)+"::OnStatus";
    end;
}


020-1,78,85,0|script|Santa#X2022|200
{
    if (gettime(7) <= 2022)
        goto L_Start;
    if (gettime(6) > 1)
        goto L_Scores;
    if (gettime(5) >= 11)
        goto L_Reward;
    goto L_Start;

L_Start:
    mesn l("Santa Claus");
    mesq l("Hey folks! I was using [@@5288|@@] to foil Baltashar attempts to ruin Christmas for the poor kids, but the plan turned against me this time! Hohoho!");
    next;
    mesn l("Santa Claus");
    mesq l("That's because I forgot Jack Frost existed, hohoho! So, if you could collect the [@@5288|@@] back to me... Well, you would get a Christmas gift, that's for sure, hohoho!");
    next;
    mesn l("Santa Claus");
    mesq l("I recovered "+$XMAS2022+" [@@5288|@@]. From these, you gave me "+XMAS2022+" [@@5288|@@]. I'll start handing out the rewards tomorrow!");
    mes l("##1Date limit: Event ended. Delivery will not be ranked.##0");
    mes l("##1Rewards will only be available until January 31st, 23:59 UTC##0");
    next;
    menu
        "Deliver", L_Deliver,
        "Scoreboards", L_Scores,
        "I'll get to it.", L_Close;

L_Deliver:
    set XMAS2022, XMAS2022 + countitem(Naftalin);
    set $XMAS2022, $XMAS2022 + countitem(Naftalin);
    delitem Naftalin, countitem(Naftalin);
    goto L_Scores;

L_Scores:
    mes l("I recovered "+$XMAS2022+" [@@5288|@@]. From these, you gave me "+XMAS2022+" [@@5288|@@].");
    mes "";
    set @rank, 0;
    set @loop, 0;
    goto L_ShowNextRecord;

L_ShowNextRecord:
    if ($Record_XXXmas_Kills[@loop] == 0)
        goto L_Close;
    mes (@loop + 1) + " - " + $Record_XXXmas_Name$[@loop] + " - " + $Record_XXXmas_Kills[@loop] + " [@@5288|@@] delivered at " + $Record_XXXmas_Date$[@loop];
    set @loop, @loop + 1;
    if (MAX_HIGH_SCORES > 4 && (@loop % 5) == 0 && $Record_XXXmas_Kills[@loop] > 0)
        goto L_NextShowNextRecord;
    goto L_ShowNextRecord;

L_NextShowNextRecord:
    next;
    goto L_ShowNextRecord;

L_Full:
    mes "[Santa Claus]";
    mes "\"Your backpack seems to be full. You should get rid of some unused stuff before you get my gifts, or maybe try one super resistant red bag, my personal favorite! Hoh-hoh!\"";
    close;


L_Reward:
    if (XMAS2022 < 1) goto L_Scores;
    getinventorylist;
    if (@inventorylist_count > 80) goto L_Full;
    mes l("Ho-ho-ho, you gave me "+XMAS2022+" [@@5288|@@]! Time for late Christmas and New Year gifts!");
    mes "";
    // Individual Performance
    if (XMAS2022 >= 1) goto L_Del1;
    goto L_Del1_Return;

L_Del1_Return:
    if (XMAS2022 >= 100) goto L_Del100;
    goto L_Del100_Return;

L_Del100_Return:
    if (XMAS2022 >= 500) goto L_Del500;
    goto L_Del500_Return;

L_Del500_Return:
    if (XMAS2022 >= 1000) goto L_Del1000;
    goto L_Del1000_Return;

L_Del1000_Return:
    if (XMAS2022 >= 2500) goto L_Del2500;
    goto L_Del2500_Return;

L_Del2500_Return:
    if (XMAS2022 >= 5000) goto L_Del5000;
    goto L_Del5000_Return;

L_Del5000_Return:
    if (XMAS2022 >= 10000) goto L_Del10000;
    goto L_Del10000_Return;

L_Del10000_Return:
    // Santa gift for global performance
    if ($XMAS2022 >= 10000) goto L_Global10k;
    goto L_Global10k_Return;

L_Global10k_Return:
    if ($XMAS2022 >= 25000) goto L_Global25k;
    goto L_Global25k_Return;

L_Global25k_Return:
    if ($XMAS2022 >= 50000) goto L_Global50k;
    goto L_Global50k_Return;

L_Global50k_Return:
    if ($XMAS2022 >= 75000) goto L_Global75k;
    goto L_Global75k_Return;

L_Global75k_Return:
    if ($XMAS2022 >= 100000) goto L_Global100k;
    goto L_Global100k_Return;

L_Global100k_Return:
    if ($XMAS2022 >= 150000) goto L_Global150k;
    goto L_Global150k_Return;

L_Global150k_Return:
    if ($XMAS2022 >= 200000) goto L_Global200k;
    goto L_Global200k_Return;

L_Global200k_Return:
    // Scoreboard performance
    set XMAS2022, 0;
    set @loop, 0;
    goto L_ScoreGift;

L_ScoreGift:
    if (@loop == MAX_HIGH_SCORES)
        goto L_Finish;
    if (strcharinfo(0) == $Record_XXXmas_Name$[@loop])
        goto L_LoopReward;
    set @loop, @loop + 1;
    goto L_ScoreGift;

L_LoopReward:
    if (@loop < 15) goto L_Rank15;
    goto L_LoopReward15;
L_LoopReward15:
    if (@loop < 10) goto L_Rank10;
    goto L_LoopReward10;
L_LoopReward10:
    if (@loop < 5) goto L_Rank5;
    goto L_LoopReward5;
L_LoopReward5:
    if (@loop < 2) goto L_Rank2;
    goto L_LoopReward2;
L_LoopReward2:
    goto L_Finish;

L_Finish:
    set @loop, 0;
    mesn;
    mesq l("Ho-ho-ho! Thanks for helping me to retrieve the Naphtalene! See you next year, ho-ho-ho!");
    next;
    goto L_Scores;

L_Del1:
    // Minimum 20 gp, Maximum 125,000 Naphtalenes
    set @gp, min(XMAS2022 * 20, 2500000);
    set Zeny, Zeny + @gp;
    getexp @gp, 0;
    mes l("##9Gained "+@gp+" GP!##0");
    mes l("##9Gained "+@gp+" Experience points.##0");
    set @gp, 0;
    goto L_Del1_Return;

L_Del100:
    getitem IronPotion, 10;
    getitem ConcentrationPotion, 10;
    goto L_Del100_Return;

L_Del500:
    getitem IronPotion, 20;
    getitem ConcentrationPotion, 20;
    getitem MediumManaElixir, 10;
    goto L_Del500_Return;

L_Del1000:
    // Minimum 40 boss points, Maximum 5,000 boss points
    set @bp, min(XMAS2022 / 25, 5000);
    set BOSS_POINTS, BOSS_POINTS + @bp;
    mes l("Gained "+@bp+" Boss points!");
    set @bp, 0;
    goto L_Del1000_Return;

L_Del2500:
    getitem IronPotion, 20;
    getitem ConcentrationPotion, 20;
    getitem MediumManaElixir, 15;
    goto L_Del2500_Return;

L_Del5000:
    getitem MediumManaElixir, 25;
    getitem GumiCandy, 25;
    goto L_Del5000_Return;

L_Del10000:
    getitem LovePotion, 50;
    getitem BlueRose, 1;
    goto L_Del10000_Return;

L_Global10k:
    setarray @oldstock$, "PlushMouboo", "StickReinboo", "Doll", "LeatherBall", "SantaSnowGlobe", "SnowmanSnowGlobe", "RedOrnament", "YellowOrnament", "GreenOrnament", "AquaOrnament", "BlueOrnament", "MagentaOrnament";
    getitem @oldstock$[rand(getarraysize(@oldstock$))], 1;
    cleararray @oldstock$, "", getarraysize(@oldstock$);
    goto L_Global10k_Return;

L_Global25k:
    setarray @oldstock$, "PlushMouboo", "StickReinboo", "Doll", "LeatherBall", "SantaSnowGlobe", "SnowmanSnowGlobe", "RedOrnament", "YellowOrnament", "GreenOrnament", "AquaOrnament", "BlueOrnament", "MagentaOrnament", "RawTalisman", "FlightTalisman";
    getitem @oldstock$[rand(getarraysize(@oldstock$))], 1;
    cleararray @oldstock$, "", getarraysize(@oldstock$);
    goto L_Global25k_Return;

L_Global50k:
    setarray @oldstock$, "PlushMouboo", "StickReinboo", "Doll", "LeatherBall", "SantaSnowGlobe", "SnowmanSnowGlobe", "RedOrnament", "YellowOrnament", "GreenOrnament", "AquaOrnament", "BlueOrnament", "MagentaOrnament", "RawTalisman", "FlightTalisman", "StrangeCoin";
    getitem @oldstock$[rand(getarraysize(@oldstock$))], 1;
    cleararray @oldstock$, "", getarraysize(@oldstock$);
    goto L_Global50k_Return;

L_Global75k:
    setarray @oldstock$, "PlushMouboo", "StickReinboo", "Doll", "LeatherBall", "SantaSnowGlobe", "SnowmanSnowGlobe", "RedOrnament", "YellowOrnament", "GreenOrnament", "AquaOrnament", "BlueOrnament", "MagentaOrnament", "RawTalisman", "FlightTalisman", "StrangeCoin", "RedChristmasStocking";
    getitem @oldstock$[rand(getarraysize(@oldstock$))], 1;
    cleararray @oldstock$, "", getarraysize(@oldstock$);
    goto L_Global75k_Return;

L_Global100k:
    setarray @oldstock$, "MoubooHead", "MushHat", "ChristmasElfHat", "FunkyHat", "ShroomHat", "ElfNightcap", "BowlerHat", "TopHat";
    getitem @oldstock$[rand(getarraysize(@oldstock$))], 1;
    cleararray @oldstock$, "", getarraysize(@oldstock$);
    goto L_Global100k_Return;

L_Global150k:
    setarray @oldstock$, "PlushMouboo", "StickReinboo", "Doll", "LeatherBall", "SantaSnowGlobe", "SnowmanSnowGlobe", "RedOrnament", "YellowOrnament", "GreenOrnament", "AquaOrnament", "BlueOrnament", "MagentaOrnament", "RawTalisman", "FlightTalisman", "StrangeCoin", "RedChristmasStocking";
    getitem @oldstock$[rand(getarraysize(@oldstock$))], 1;
    cleararray @oldstock$, "", getarraysize(@oldstock$);
    goto L_Global150k_Return;

L_Global200k:
    setarray @oldstock$, "PlushMouboo", "StickReinboo", "Doll", "LeatherBall", "SantaSnowGlobe", "SnowmanSnowGlobe", "RedOrnament", "YellowOrnament", "GreenOrnament", "AquaOrnament", "BlueOrnament", "MagentaOrnament", "RawTalisman", "FlightTalisman", "StrangeCoin", "RedChristmasStocking";
    getitem @oldstock$[rand(getarraysize(@oldstock$))], 1;
    cleararray @oldstock$, "", getarraysize(@oldstock$);
    goto L_Global200k_Return;

L_Rank15:
    setarray @oldstock, ChristmasElfHat, Towel, ElfNightcap, PaperBag, ChristmasTreeHat, MovieCap, FourLeafClover, BlueWolfHelmet;
    getitem @oldstock[rand(getarraysize(@oldstock))], 1;
    cleararray @oldstock, 0, getarraysize(@oldstock);
    goto L_LoopReward15;

L_Rank10:
    setarray @oldstock, ChristmasElfHat, Towel, ElfNightcap, PaperBag, Earmuffs, FunkyHat, ScarabArmlet, SantaBeardHat, MovieCap, AFKCap, FourLeafClover, ChicSantaHat, BlueWolfHelmet;
    getitem @oldstock[rand(getarraysize(@oldstock))], 1;
    cleararray @oldstock, 0, getarraysize(@oldstock);
    goto L_LoopReward10;

L_Rank5:
    setarray @oldstock, Earmuffs, FunkyHat, ScarabArmlet, ChristmasTreeHat, TamOShanter, SantaBeardHat, GroovyHat, JazzyHat, AFKCap, DarkHelm, ChicSantaHat, PilotHat;
    getitem @oldstock[rand(getarraysize(@oldstock))], 1;
    cleararray @oldstock, 0, getarraysize(@oldstock);
    goto L_LoopReward5;

L_Rank2:
    setarray @oldstock, TamOShanter, GroovyHat, JazzyHat, DarkHelm, PilotHat;
    getitem @oldstock[rand(getarraysize(@oldstock))], 1;
    cleararray @oldstock, 0, getarraysize(@oldstock);
    goto L_LoopReward2;
L_Close:
    close;
}

// Override mapflags for Christmas 2022
033-1|mapflag|town
034-1|mapflag|town
046-1|mapflag|town
047-1|mapflag|town