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
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
|
// Evol script
// Controls Doomsday Event
//
// A really long event (months), controlling and being written by
// every event which happens since doomsday program officialy started
// in Halloween 2019 with Tormenta's release.
//
// This file history is written by GMs and players as the events happen
// and therefore it is not possible to predict or add code for things which
// are too far away from happening.
//
// Please keep Doomsday System simple.
// Revert it to anything to stage once it is over.
// It can be epic. But it doesn't needs to be.
// But above all, this should NOT affect the merge.
// The event purpose is to give players background history.
function|script|DoomsdayDebug
{
mes "$DOOMSDAY: "+$DOOMSDAY; // Event Status
mes "";
mes "Act 2:";
mes "Amount of slain Mana Guardians:";
mes "$DOOMSDAY_CNT: "+$DOOMSDAY_CNT;
mes "";
mes "Act 3:";
mes "Situation of the towns (0 - standing, n - fallen n times)";
mes "$DOOMSDAY_TOWN[0] (Tulim): "+$DOOMSDAY_TOWN[0];
mes "$DOOMSDAY_TOWN[1] (Hurns): "+$DOOMSDAY_TOWN[1];
mes "$DOOMSDAY_TOWN[2] (Nival): "+$DOOMSDAY_TOWN[2];
mes "$DOOMSDAY_SCORE: "+$DOOMSDAY_SCORE;
mes "$DOOMSDAY_CLUES: "+$DOOMSDAY_CLUES;
mes "";
mes "Act 4:";
mes "Can players summon Mana Guardians? "+if_then_else($DOOMSDAY_SUMMON, "Yes", "No");
mes "Is TMW under Jande's control? "+if_then_else($DOOMSDAY_TAKENOVER, "Yes", "No");
mes "Zealite Upgrade? "+if_then_else($DOOMSDAY_SUMMON > 1, "Yes", "No");
mes "";
mes "Act 5:";
mes "Warp to fake Keshlam? "+if_then_else($DOOMSDAY_TWARP, "No", "Yes");
mes "Vanilla Mode? "+if_then_else($DOOMSDAY_VANILLA, "Yes", "No");
//($DOOMSDAY_SUMMON ? "Yes" : "No");
next;
// Only GM 80 and above can modify Doomsday
// ...Yes, G_ADMIN is 80 while G_SYSOP is 99.
if (GM < G_ADMIN) goto L_Close;
mes "Setting $DOOMSDAY event state";
mes "[DOOMSDAY][ACT][STATE]";
menu
"[0][1][0] Tormenta's Seal",L_Seal,
"[1][2][0] Jande's Army",L_Army,
"[1][2][1] Toggle Mana Guardian Skill",L_Summon,
"[1][2][2] Surrender TMW to Jande",L_Surrender,
"[1][3][0] The Great War - First Wave",L_War,
"[2][3][1] The Great War - Additional Wave",L_GreatWar,
"[2][4][0] Wumpus Great Egg Hunt - DEBUG",L_Wumpus,
"[2][4][1] Council - Tulimshar's Guild",L_TulimCouncil,
"[2][4][2] Council - Celestia's Residence",L_HurnsCouncil,
"[2][4][3] Council - Blue Sage's Residence",L_NivalCouncil,
"[2][4][4] Toggle Zealite Upgrade",L_Zealite,
"[3][5][0] Keshlam Warps",L_Keshlam,
"[3][5][1] Kage's Final Battle",L_Kage,
"[3][5][2] Vanilla Mode",L_Vanilla,
"[-] Close",L_Close;
L_Close:
return;
// Act 1: Tormenta's Seal
L_Seal:
set $DOOMSDAY, 0;
donpcevent "Doomsday::OnJanitor";
gmlog strcharinfo(0) + " changed doomsday to Act 1: Tormenta's Seal.";
return;
// Act 2: Jande's Army
L_Army:
set $DOOMSDAY, 1;
donpcevent "Doomsday::OnJanitor";
gmlog strcharinfo(0) + " changed doomsday to Act 2: Jande's Army.";
return;
L_Summon:
set $DOOMSDAY_SUMMON, (!$DOOMSDAY_SUMMON);
gmlog strcharinfo(0) + " changed the availability of #jande spell.";
return;
L_Surrender:
set $DOOMSDAY_TAKENOVER, 1;
donpcevent "Doomsday::OnDoomsday2Restart";
gmlog strcharinfo(0) + " surrendered The Mana World to Jande.";
return;
// Act 3: The Great War
L_War:
set $@DOOMSDAY_SKIP, 1; // Skip the next scheduled siege
donpcevent "Doomsday::OnDoomsday3First"; // Forces a doomsday to begin now
gmlog strcharinfo(0) + " changed doomsday to Act 3: The Great War.";
return;
L_Wumpus:
set $@DOOMSDAY_SKIP, 0;
donpcevent "Doomsday::OnClock1830"; // Forces a doomsday act 4 check
gmlog strcharinfo(0) + " manually triggered debug function. Doomsday Act 4.";
return;
// Act 4: The Great War Council
L_GreatWar:
disablenpc "Wizard#1";
disablenpc "Wizard#2";
disablenpc "Wizard#3";
disablenpc "Wizard#4";
disablenpc "Wizard#5";
disablenpc "Wizard#6";
disablenpc "Wizard#7";
disablenpc "Wizard#8";
disablenpc "Arch-Wizard#9";
set $DOOMSDAY, 2;
set $@DOOMSDAY_SKIP, 0;
donpcevent "Doomsday::OnJanitor";
gmlog strcharinfo(0) + " changed doomsday to Act 4: The Great War Council.";
return;
L_CouncilRefusal:
mes "##1Cowardly refusing to meet in a town destroyed five times.";
next;
return;
L_TulimCouncil:
if ($DOOMSDAY_TOWN[0] >= 5)
goto L_CouncilRefusal;
enablenpc "Arch-Wizard#_DT";
gmlog strcharinfo(0) + " called the Council to Tulimshar.";
return;
L_HurnsCouncil:
if ($DOOMSDAY_TOWN[1] >= 5)
goto L_CouncilRefusal;
enablenpc "Arch-Wizard#_DH";
gmlog strcharinfo(0) + " called the Council to Hurnscald.";
return;
L_NivalCouncil:
if ($DOOMSDAY_TOWN[2] >= 5)
goto L_CouncilRefusal;
enablenpc "Arch-Wizard#_DN";
gmlog strcharinfo(0) + " called the Council to Nivalis.";
return;
L_Zealite:
set $DOOMSDAY_SUMMON, 2;
disablenpc "Soul Menhir#deadmire";
disablenpc "Soul Menhir#hurnscald";
disablenpc "Soul Menhir#nivalis";
disablenpc "Soul Menhir#tulimshar";
enablenpc "Chest#Zealite";
//disablenpc "Soul Menhir#candor";
gmlog strcharinfo(0) + " changed the availability of #manatez and Savior Armor.";
return;
// Act 5: The Doomsday
L_Keshlam:
mes "//-- TODO --//";
enablenpc "Wizard#1";
enablenpc "Wizard#2";
enablenpc "Wizard#3";
enablenpc "Wizard#4";
enablenpc "Wizard#5";
enablenpc "Wizard#6";
enablenpc "Wizard#7";
enablenpc "Wizard#8";
enablenpc "Arch-Wizard#9";
enablenpc "Chest#DarkRose";
set $DOOMSDAY, 3;
set $DOOMSDAY_TWARP, 0;
set $DOOMSDAY_VANILLA, 0;
donpcevent "Doomsday::OnJanitor"; // TODO
gmlog strcharinfo(0) + " changed doomsday to Act 5: The Doomsday.";
gmlog strcharinfo(0) + " changed doomsday warp to Keshlam Maze";
return;
L_Kage:
set $DOOMSDAY_TWARP, 1;
donpcevent "Doomsday::OnJanitor"; // TODO
gmlog strcharinfo(0) + " changed doomsday warp to Abandoned Building";
return;
L_Vanilla:
set $DOOMSDAY_VANILLA, 1;
donpcevent "Doomsday::OnJanitor"; // TODO
gmlog strcharinfo(0) + " disabled rewards from final showdown (VANILLA).";
return;
}
// Doomsday script controller
-|script|Doomsday|32767
{
close;
// Destroy any artifact as doomsday mode changes
OnJanitor:
// TODO: Act 2: Kill monsters?
// Act 3: Clean eventually on-going Doomsday
set $@DOOMSDAY_SKIP, 0;
set $@DD_NUMWAVES, 0;
set $@DoomsdayLoc, 0;
set $@DoomsdayMc, 0;
set $@DD_LOC$, "";
// Act 4: Disable council puppets
disablenpc "Sagatha#_DT";
disablenpc "Elanore#_DT";
disablenpc "Nikolai#_DT";
disablenpc "Morgan#_DT";
disablenpc "Valia#_DT";
disablenpc "Waric#_DT";
disablenpc "Golbenez#_DT";
disablenpc "Sagatha#_DH";
disablenpc "Elanore#_DH";
disablenpc "Nikolai#_DH";
disablenpc "Morgan#_DH";
disablenpc "Valia#_DH";
disablenpc "Waric#_DH";
disablenpc "Golbenez#_DH";
disablenpc "Sagatha#_DN";
disablenpc "Elanore#_DN";
disablenpc "Nikolai#_DN";
disablenpc "Morgan#_DN";
disablenpc "Valia#_DN";
disablenpc "Waric#_DN";
disablenpc "Golbenez#_DN";
disablenpc "Arch-Wizard#_DT";
disablenpc "Arch-Wizard#_DH";
disablenpc "Arch-Wizard#_DN";
// Act 5: Cleanup
if ($DOOMSDAY == 3 && !$DOOMSDAY_TWARP)
donpcevent "Keshlam Maze::OnInit"; // Spawn monsters if needed
// Clear timers
setnpctimer 0;
stopnpctimer;
goto OnInit;
// Check for our current doomsday state
OnInit:
setarray $@doomsday_mobs, 1140, 1141, 1143, 1140, 1141, 1143, 1140, 1141, 1143;
setarray $@doomsday_boss, 1146, 1147, 1146, 1147, 1146, 1147, 1146, 1147, 1146, 1147;
if ($DOOMSDAY == 1)
goto L_Doomsday1;
if ($DOOMSDAY == 2)
goto L_Doomsday2;
if ($DOOMSDAY == 3)
goto L_Doomsday5;
// goto L_Check2;
end;
////////////////////////////////////////////////////////////////////////////////
L_Doomsday1:
// 1138 - Mana Guardian
// Argaes Invasion (1)
areamonster "017-1", 169, 49, 198, 77, "", 1138, 1, "Doomsday::OnDeathMapname";
// Argaes Invasion (2)
areamonster "012-1", 20, 47, 74, 77, "", 1138, 3, "Doomsday::OnDeathMapname";
// Argaes Invasion (3)
areamonster "057-1", 115, 50, 140, 75, "", 1138, 4, "Doomsday::OnDeathMapname";
// Kaizei Invasion (I)
areamonster "046-1", 58, 49, 92, 70, "", 1138, 2, "Doomsday::OnDeathMapname";
// Kaizei Invasion (II)
areamonster "034-1", 83, 51, 121, 98, "", 1138, 6, "Doomsday::OnDeathMapname";
// Tonori Invasion
areamonster "003-4", 20, 20, 85, 60, "", 1138, 7, "Doomsday::OnDeathMapname";
end;
L_Doomsday1Respawn:
// Argaes Invasion (1)
set $@DoomsdayMc, mobcount("017-1", "Doomsday::OnDeathMapname")+1;
if ($@DoomsdayMc < 1)
areamonster "017-1", 169, 49, 198, 77, "", 1138, 1-$@DoomsdayMc, "Doomsday::OnDeathMapname";
// Argaes Invasion (2)
set $@DoomsdayMc, mobcount("012-1", "Doomsday::OnDeathMapname")+1;
if ($@DoomsdayMc < 3)
areamonster "012-1", 20, 47, 74, 77, "", 1138, 3-$@DoomsdayMc, "Doomsday::OnDeathMapname";
// Argaes Invasion (3)
set $@DoomsdayMc, mobcount("057-1", "Doomsday::OnDeathMapname")+1;
if ($@DoomsdayMc < 4)
areamonster "057-1", 115, 50, 140, 75, "", 1138, 4-$@DoomsdayMc, "Doomsday::OnDeathMapname";
// Kaizei Invasion (I)
set $@DoomsdayMc, mobcount("046-1", "Doomsday::OnDeathMapname")+1;
if ($@DoomsdayMc < 2)
areamonster "046-1", 58, 49, 92, 70, "", 1138, 2-$@DoomsdayMc, "Doomsday::OnDeathMapname";
// Kaizei Invasion (II)
set $@DoomsdayMc, mobcount("034-1", "Doomsday::OnDeathMapname")+1;
if ($@DoomsdayMc < 6)
areamonster "034-1", 83, 51, 121, 98, "", 1138, 6-$@DoomsdayMc, "Doomsday::OnDeathMapname";
// Tonori Invasion
set $@DoomsdayMc, mobcount("003-4", "Doomsday::OnDeathMapname")+1;
if ($@DoomsdayMc < 7)
areamonster "003-4", 20, 20, 85, 60, "", 1138, 7-$@DoomsdayMc, "Doomsday::OnDeathMapname";
// goto L_TimerCheck2;
goto L_TimerFinish;
////////////////////////////////////////////////////////////////////////////////
// Disable Tulimshar Magic Council
L_Doomsday2:
addnpctimer 1000, "Doomsday::OnDoomsday2Restart";
end;
OnDoomsday2Restart:
disablenpc "Wizard#1";
disablenpc "Wizard#2";
disablenpc "Wizard#3";
disablenpc "Wizard#4";
disablenpc "Wizard#5";
disablenpc "Wizard#6";
disablenpc "Wizard#7";
disablenpc "Wizard#8";
disablenpc "Arch-Wizard#9";
// TODO: Maybe the town was taken over?
if (!$DOOMSDAY_TAKENOVER)
end;
fakenpcname "Constable Bob", "Constable Bob#_D", 421;
fakenpcname "Inspector#Hurnscald", "Inspector#Hurnscald_D", 420;
//fakenpcname "Richard", "Guardian Richard#_D", 420;
fakenpcname "Selim", "Guardian Selim#_D", 420;
fakenpcname "General Store#hurnscald", "Guardian Store#hurns_D", 420;
fakenpcname "General Store#dimond", "Guardian Store#dimond_D", 420;
fakenpcname "Sabine", "Mana Tourist#_D", 420;
fakenpcname "Apprentice", "Apprentice#_D", 420;
fakenpcname "Entertainer", "Entertainer#_D", 420;
fakenpcname "Drinker#2", "Drinker#2_D", 420;
fakenpcname "Bartender#Duels", "Bartender#Duels_D", 420;
fakenpcname "Jerry", "Mana Singer#_D", 420;
fakenpcname "Constable Perry Graf", "Constable Perry#_D", 420; // Name too long
fakenpcname "Guard#school", "Guard#school_D", 420;
fakenpcname "Guard#castle", "Guard#castle_D", 420;
fakenpcname "Guard#east3", "Guard#east3_D", 420;
fakenpcname "Guard#govt_out", "Guard#govtout_D", 420;
fakenpcname "Guard#govt_in", "Guard#govtin_D", 420;
fakenpcname "Guard#port1", "Guard#port1_D", 420;
fakenpcname "Guard#port2", "Guard#port2_D", 420;
fakenpcname "Guard#east1", "Guard#east1_D", 420;
fakenpcname "Mede", "Mana Shopkeeper#_D", 420;
fakenpcname "Bracco", "Mana Shopkeeper#2_D", 420;
if ($DOOMSDAY_SUMMON == 2)
goto L_MenhirUpdate;
end;
L_MenhirUpdate:
disablenpc "Soul Menhir#deadmire";
disablenpc "Soul Menhir#hurnscald";
disablenpc "Soul Menhir#nivalis";
disablenpc "Soul Menhir#tulimshar";
enablenpc "Chest#Zealite";
end;
/////// Act 3 sieges
// Variables:
// $@DoomsdayLoc / 100 = Town Code (0: Tulim, 1: Hurns, 2: Nivalis)
// Fake label for the first Zax's movement
OnDoomsday3First:
set $@DoomsdayLoc, 1;
goto L_Doomsday3;
// Setup a siege
L_Doomsday3Init:
set $@DoomsdayLoc, rand(300) / 100;
// Announce based on location
if ($@DoomsdayLoc == 0)
announce "Jande : Zax De'Kagen's army is marching to ##BTULIMSHAR##b in 10 minutes! (Attack by south gate)", 0;
if ($@DoomsdayLoc == 1)
announce "Jande : Zax De'Kagen's army is marching to ##BHURNSCALD##b in 10 minutes! (Attack by the mines)", 0;
if ($@DoomsdayLoc == 2)
announce "Jande : Zax De'Kagen's army is marching to ##BNIVALIS##b in 10 minutes! (Attack by east entrance)", 0;
end;
// This siege will be skipped
L_Doomsday3Skip:
set $@DOOMSDAY_SKIP, 0;
end;
// Operational label, handles sieges
L_Doomsday3:
// At this point it is no longer possible to skip the event.
// Based on $@DoomsdayLoc go to a town-specific label
// One wave every 5 minutes, until 6 waves were called (~30 min)
// Then stop the timer, and check for survivor mobs 45 minutes after
// If survivors are found, the town will be overrun
set $@DD_NUMWAVES, 0;
// Set the map for other labels (could use an array but meh)
if ($@DoomsdayLoc == 0)
set $@DD_LOC$, "002-1";
if ($@DoomsdayLoc == 1)
set $@DD_LOC$, "018-1";
if ($@DoomsdayLoc == 2)
set $@DD_LOC$, "031-1";
// Set the map coordinates for spawns
// Tulimshar
if ($@DoomsdayLoc == 0)
setarray $@DD_XPOS, 98, 97, 91, 75, 56, 44, 76, 54;
if ($@DoomsdayLoc == 0)
setarray $@DD_YPOS, 75, 86, 99,104, 81, 63, 76, 96;
// Hurnscald
if ($@DoomsdayLoc == 1)
setarray $@DD_XPOS,138,136,133,111, 95, 79, 67, 88;
if ($@DoomsdayLoc == 1)
setarray $@DD_YPOS, 63, 71, 79, 74, 75, 64, 82, 90;
// Nivalis
if ($@DoomsdayLoc == 2)
setarray $@DD_XPOS, 90, 62, 63, 56, 70, 36, 62, 85;
if ($@DoomsdayLoc == 2)
setarray $@DD_YPOS, 47, 49, 61, 83, 41, 37, 26, 30;
// Make an extra announce for those whom missed
if ($@DoomsdayLoc == 0)
announce "Jande : Zax De'Kagen's army reached ##BTULIMSHAR##b! (Attack by south gate)", 0;
if ($@DoomsdayLoc == 1)
announce "Jande : Zax De'Kagen's army reached ##BHURNSCALD##b! (Attack by the mines)", 0;
if ($@DoomsdayLoc == 2)
announce "Jande : Zax De'Kagen's army reached ##BNIVALIS##b! (Attack by east entrance)", 0;
goto L_DDAdvanceWave;
// Advance wave (max. 10->6 waves)
L_DDAdvanceWave:
set $@DD_NUMWAVES, $@DD_NUMWAVES+1;
if ($@DD_NUMWAVES > 6)
end; // TODO: Maybe a final wave announcement?
// Variable initialization
set $@DD_INT, 0;
set $@DD_UNITS, getmapusers($@DD_LOC$)+$DOOMSDAY_SCORE;
// Spawns
if ($@DoomsdayLoc == 0)
goto L_DD3Tulim;
if ($@DoomsdayLoc == 1)
goto L_DD3Hurns;
if ($@DoomsdayLoc == 2)
goto L_DD3Nival;
// Fallback
debugmes "DOOMSDAY/ACT3: Unrecognized town: "+$@DoomsdayLoc;
goto L_DDAdvanceTimers;
// Restart timers and advance wave
L_DDAdvanceTimers:
initnpctimer;
if ($@DD_INT < $@DD_UNITS*2)
goto L_DDAdvanceTimers2;
goto L_DDAdvanceWavePost;
// If we have more users than possible, waves come faster
L_DDAdvanceTimers2:
set $@ADD_TIME, (($@DD_UNITS*2-$@DD_INT)*500); // ±1 second per player/victory
// Cap to 90s (to prevent skipping first third)
if ($@ADD_TIME > 90000)
set $@ADD_TIME, 90000;
setnpctimer $@ADD_TIME;
set $@ADD_TIME, 0;
// If we have clues, we will cause a few extra spawns
if ($DOOMSDAY_CLUES)
goto L_DD3WaveReinforcements;
goto L_DDAdvanceWavePost;
// Reinforcements on waves, to ensure Kage never really weaken their attacks
L_DD3WaveReinforcements:
set $@DD_UNITS, $@DD_UNITS-$@DD_INT;
set $@DD_UNITS, $@DD_UNITS*$DOOMSDAY_CLUES/3;
set $@DD_INT, 0;
if ($@DD_UNITS > 0)
goto L_DD3WRCallsub;
goto L_DDAdvanceWavePost;
L_DD3WRCallsub:
callsub S_DD3ThirdSpawns;
goto L_DDAdvanceWavePost;
// Clear temporary variables and broadcast
L_DDAdvanceWavePost:
set $@DD_IDX, 0;
set $@DD_INT, 0;
set $@DD_UNITS, 0;
// Tell users
mapannounce $@DD_LOC$, "Jande : Watch out, another wave! Only "+(6-$@DD_NUMWAVES)+" waves left!", 0;
// Prepare optional boss
set $@DD_IDX1, rand(getarraysize($@DD_XPOS));
set $@DD_IDX2, rand(getarraysize($@doomsday_boss));
// Spawn optional boss if req. is met
if ($@DD_NUMWAVES > 6-$DOOMSDAY_CLUES)
monster $@DD_LOC$, $@DD_XPOS[$@DD_IDX1], $@DD_YPOS[$@DD_IDX1], "", $@doomsday_boss[$@DD_IDX2], 1, "Doomsday::OnDeathAct3";
end;
// Tulimshar Siege points
L_DD3Tulim:
// Compulsory spawns
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "002-1", 98, 75, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "002-1", 97, 86, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
// Non-compulsory spawns
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "002-1", 91, 99, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "002-1", 75, 104, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "002-1", 56, 81, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "002-1", 44, 63, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "002-1", 76, 76, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "002-1", 54, 96, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
// No extra spawns possible
goto L_DDAdvanceTimers;
// Hurnscald Siege points
L_DD3Hurns:
// Compulsory spawns
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "018-1", 138, 63, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "018-1", 136, 71, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
// Non-compulsory spawns
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "018-1", 133, 79, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "018-1", 111, 74, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "018-1", 94, 75, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "018-1", 79, 64, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "018-1", 67, 82, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "018-1", 88, 90, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
// No extra spawns possible
goto L_DDAdvanceTimers;
// Nivalis Siege points
L_DD3Nival:
// Compulsory spawns
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "031-1", 90, 47, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "031-1", 62, 49, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
// Non-compulsory spawns
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "031-1", 63, 61, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "031-1", 56, 83, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "031-1", 70, 41, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "031-1", 36, 37, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "031-1", 62, 26, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "031-1", 85, 30, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
// No extra spawns possible
goto L_DDAdvanceTimers;
// Extra wave control system [0]
S_DD3ThirdSpawns:
set $@DD_IDX1, rand(getarraysize($@DD_XPOS));
set $@DD_IDX2, rand(getarraysize($@doomsday_mobs));
monster $@DD_LOC$, $@DD_XPOS[$@DD_IDX1], $@DD_YPOS[$@DD_IDX1], "", $@doomsday_mobs[$@DD_IDX2], 1, "Doomsday::OnDeathAct3";
set $@DD_INT, $@DD_INT+1;
if($@DD_INT < $@DD_UNITS) goto S_DD3ThirdSpawns;
return;
// Extra wave control system [1]
L_DD3FirstThird:
set $@DD_UNITS, getmapusers($@DD_LOC$)-mobcount($@DD_LOC$, "Doomsday::OnDeathAct3")+1;
set $@DD_INT, 0;
// Difficulty adjustment: Invoke -1 mob per player and +1 mob per 2 score points
set $@DD_UNITS, $@DD_UNITS-getmapusers($@DD_LOC$)+($DOOMSDAY_SCORE/2);
// Monsters already overpower players
if ($@DD_UNITS < 0)
goto L_DD3EndThird;
// Prepare optional boss
set $@DD_IDX1, rand(getarraysize($@DD_XPOS));
set $@DD_IDX2, rand(getarraysize($@doomsday_boss));
// Spawn optional boss
if ($@DD_NUMWAVES == 5 && $DOOMSDAY_SCORE > 6)
monster $@DD_LOC$, $@DD_XPOS[$@DD_IDX1], $@DD_YPOS[$@DD_IDX1], "", $@doomsday_boss[$@DD_IDX2], 1, "Doomsday::OnDeathAct3";
// Spawn first third's wave
callsub S_DD3ThirdSpawns;
goto L_DD3EndThird;
// Extra wave control system [2]
L_DD3SecondThird:
set $@DD_UNITS, getmapusers($@DD_LOC$)-mobcount($@DD_LOC$, "Doomsday::OnDeathAct3")+1;
set $@DD_INT, 0;
// Intensity control
if ($DOOMSDAY_SCORE < 12-$DOOMSDAY_CLUES)
goto L_DD3EndThird;
// Difficulty adjustment: Invoke -1 mob per player and +1 mob per 3 score points
set $@DD_UNITS, $@DD_UNITS-getmapusers($@DD_LOC$)+($DOOMSDAY_SCORE/3);
// Prepare optional boss
set $@DD_IDX1, rand(getarraysize($@DD_XPOS));
set $@DD_IDX2, rand(getarraysize($@doomsday_boss));
// Spawn optional boss
if ($@DD_NUMWAVES == 5)
monster $@DD_LOC$, $@DD_XPOS[$@DD_IDX1], $@DD_YPOS[$@DD_IDX1], "", $@doomsday_boss[$@DD_IDX2], 1, "Doomsday::OnDeathAct3";
// Monsters already overpower players
if ($@DD_UNITS < 0)
goto L_DD3EndThird;
// Spawn second third's wave
callsub S_DD3ThirdSpawns;
goto L_DD3EndThird;
// Extra wave control system [3]
L_DD3EndThird:
set $@DD_UNITS, 0;
set $@DD_IDX1, 0;
set $@DD_IDX2, 0;
set $@DD_INT, 0;
end;
// Timer controls (5 minutes between waves);
// It only fires after first wave
L_TimerCheck2:
if ($@DD_NUMWAVES > 0)
goto L_DDAdvanceWave;
end;
// Siege one hour condition fully elapsed
L_Doomsday3Check:
set $@DoomsdayMc, mobcount($@DD_LOC$, "Doomsday::OnDeathAct3")+1;
if ($@DoomsdayMc > 0)
goto L_Doomsday3Defeat;
goto L_Doomsday3Victory;
// Town was defeated
L_Doomsday3Defeat:
// Warn players that town is in danger
mapannounce $@DD_LOC$, "Jande : Oh noes, "+$@DoomsdayMc+" monsters passed the barricate!!", 0;
// Move the monsters to town
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
if ($@DoomsdayLoc == 0)
areamonster "001-1", 52, 35, 119, 113, "", $@doomsday_mobs[$@DD_IDX], $@DoomsdayMc;
if ($@DoomsdayLoc == 1)
areamonster "009-1", 25, 25, 96, 53, "", $@doomsday_mobs[$@DD_IDX], $@DoomsdayMc;
if ($@DoomsdayLoc == 2)
areamonster "020-1", 24, 32, 99, 96, "", $@doomsday_mobs[$@DD_IDX], $@DoomsdayMc;
// Update defeat counter and advance
set $DOOMSDAY_TOWN[$@DoomsdayLoc], $DOOMSDAY_TOWN[$@DoomsdayLoc]+1;
set $@DD_IDX, 0;
goto L_Doomsday3Cleanup;
// Siege was cleared up
L_Doomsday3Victory:
set $DOOMSDAY_SCORE, $DOOMSDAY_SCORE+1;
mapannounce $@DD_LOC$, "Jande : That was a close call, but we did it! We defended "+$DOOMSDAY_SCORE+" times.", 0;
goto L_Doomsday3Cleanup;
// Clean up temporary variables (except skip)
L_Doomsday3Cleanup:
killmonster $@DD_LOC$, "Doomsday::OnDeathAct3";
set $@DD_NUMWAVES, 0;
set $@DoomsdayLoc, 0;
set $@DoomsdayMc, 0;
set $@DD_LOC$, "";
cleararray $@DD_XPOS, 0, 8;
cleararray $@DD_YPOS, 0, 8;
end;
// Bonus spawn
L_Doomsday3Bonus:
announce "Jande : Stray minions from Zax De'Kagen army were sighted all over the world!", 0;
set $@DD_UNITS, 2+($DOOMSDAY_SCORE/5);
// Cap value (to prevent huge spikes)
if ($@DD_UNITS > 5)
set $@DD_UNITS, 3+($DOOMSDAY_SCORE/10);
// Sum the permanent clues
set $@DD_UNITS, $@DD_UNITS+$DOOMSDAY_CLUES;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "031-1", 62, 49, "", $@doomsday_mobs[$@DD_IDX], 1+$DOOMSDAY_CLUES;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "018-1", 136, 71, "", $@doomsday_mobs[$@DD_IDX], 1+$DOOMSDAY_CLUES;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
monster "002-1", 97, 86, "", $@doomsday_mobs[$@DD_IDX], 1+$DOOMSDAY_CLUES;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
areamonster "017-1", 169, 49, 198, 77, "", $@doomsday_mobs[$@DD_IDX], 1+$DOOMSDAY_CLUES;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
areamonster "012-1", 20, 47, 74, 77, "", $@doomsday_mobs[$@DD_IDX], $@DD_UNITS;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
areamonster "057-1", 115, 50, 140, 75, "", $@doomsday_mobs[$@DD_IDX], $@DD_UNITS;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
areamonster "046-1", 58, 49, 92, 70, "", $@doomsday_mobs[$@DD_IDX], $@DD_UNITS;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
areamonster "034-1", 83, 51, 121, 98, "", $@doomsday_mobs[$@DD_IDX], $@DD_UNITS;
set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
areamonster "003-4", 20, 20, 85, 60, "", $@doomsday_mobs[$@DD_IDX], $@DD_UNITS;
// Tormenta
if (rand(10) <= $DOOMSDAY_CLUES)
monster "057-1", 126, 64, "", 1137, 1;
set $@DD_UNITS, 0;
set $@DD_IDX, 0;
end;
// Act 4 System
L_Doomsday4Check:
// Magic number: 21
if ($DOOMSDAY_SCORE >= 20-$DOOMSDAY_CLUES)
goto L_DD4WarnSeq;
end;
L_DD4WarnSeq:
areatimer 0, $@DD_LOC$, 20, 20, 500, 500, 100, "Doomsday::OnDD4Warning1";
announce "Jande : ##1##BWarning: ##bZax's Golem spawning! Defeat it!!", 0;
addnpctimer 7500, "Doomsday::OnDD4Spawn";
end;
OnDD4Warning1:
mapmask 1 | 2;
music "Dramatic.ogg";
areatimer 0, $@DD_LOC$, 20, 20, 500, 500, 600, "Doomsday::OnDD4Warning2";
end;
OnDD4Warning2:
misceffect 51, strcharinfo(0);
areatimer 0, $@DD_LOC$, 20, 20, 500, 500, 7000, "Doomsday::OnDD4Warning3";
end;
OnDD4Warning3:
mapmask 1;
end;
OnDD4Spawn:
set $@DD_IDX1, rand(getarraysize($@DD_XPOS));
monster $@DD_LOC$, $@DD_XPOS[$@DD_IDX1], $@DD_YPOS[$@DD_IDX1], "", 1145, 1, "Doomsday::OnDeathAct4";
//debugmes "Success "+$@DD_LOC$+" ("+$@DD_XPOS[$@DD_IDX1]+", "+$@DD_YPOS[$@DD_IDX1]+")";
mapannounce $@DD_LOC$, "Golem : FRAIL SMALL PEOPLE, ME SMASH!!!", 0;
// Spawn a few mobs
set $@DD_INT, 0;
set $@DD_UNITS, $DOOMSDAY_CLUES*4;
callsub S_DD3ThirdSpawns;
goto OnDD4Smash;
// Could use a new optional skill: FRAIL NOOBS, ZAX RULES! (causes new wave of 6 monsters)
OnDD4Smash:
// Golem got itself smashed D:
if ($@DD_LOC$ == "")
end;
if (!(mobcount($@DD_LOC$, "Doomsday::OnDeathAct4")+1))
end;
// TODO: Do not keep repeating the announce
//mapannounce $@DD_LOC$, "Golem : FRAIL SMALL PEOPLE, ME SMASH!!!", 0;
areatimer 0, $@DD_LOC$, 20, 20, 500, 500, 100, "Doomsday::OnDD4Smashed";
addnpctimer rand(12000, 18000), "Doomsday::OnDD4Smash";
end;
OnDD4Smashed:
misceffect 52, strcharinfo(0);
heal -70-BaseLevel, 0;
end;
// For surviving
OnDD4SurvivorReward:
getexp 10000, 0;
end;
////////////////////////////////////////////////////////////////////////////////
// Act 5 utils
L_Doomsday5:
enablenpc "Chest#DarkRose";
if ($DOOMSDAY_SUMMON == 2)
goto L_MenhirUpdate;
end;
////////////////////////////////////////////////////////////////////////////////
// Respawn logic (5 minutes)
OnTimer100000:
if ($DOOMSDAY == 2)
goto L_DD3FirstThird;
end;
OnTimer200000:
if ($DOOMSDAY == 2)
goto L_DD3SecondThird;
end;
OnTimer300000:
if ($DOOMSDAY == 1)
goto L_Doomsday1Respawn;
if ($DOOMSDAY == 2)
goto L_TimerCheck2;
goto L_TimerFinish;
// Once all timer checks are over
L_TimerFinish:
set $@DoomsdayMc, 0;
setnpctimer 0;
stopnpctimer;
end;
// Act 3 clock handlers [1]
OnClock1750:
if ($@DOOMSDAY_SKIP)
end;
if ($DOOMSDAY == 2)
goto L_Doomsday3Init;
end;
OnClock1800:
if ($@DOOMSDAY_SKIP)
end;
if ($DOOMSDAY == 2)
goto L_Doomsday3;
end;
OnClock1830:
if ($@DOOMSDAY_SKIP)
end;
if ($DOOMSDAY == 2)
goto L_Doomsday4Check;
end;
// 19h -> 18h45
OnClock1845:
if ($@DOOMSDAY_SKIP)
goto L_Doomsday3Skip;
if ($DOOMSDAY == 2)
goto L_Doomsday3Check;
end;
// Act 3 clock handlers [2]
OnClock2350:
if ($@DOOMSDAY_SKIP)
end;
if ($DOOMSDAY == 2)
goto L_Doomsday3Init;
end;
OnClock0000:
if ($@DOOMSDAY_SKIP)
end;
if ($DOOMSDAY == 2)
goto L_Doomsday3;
end;
OnClock0030:
if ($@DOOMSDAY_SKIP)
end;
if ($DOOMSDAY == 2)
goto L_Doomsday4Check;
end;
OnClock0045:
if ($@DOOMSDAY_SKIP)
goto L_Doomsday3Skip;
if ($DOOMSDAY == 2)
goto L_Doomsday3Check;
end;
// Act 3 clock handlers [3]
OnClock0900:
if ($DOOMSDAY == 2)
goto L_Doomsday3Bonus;
end;
////////////////////////////////////////////////////////////////////////////////
// Puppet labels
OnDeathMapname:
if ($DOOMSDAY == 1)
set $DOOMSDAY_CNT, $DOOMSDAY_CNT+1;
startnpctimer;
end;
OnDeathAct3:
end;
OnDeathAct4:
set $DOOMSDAY_SCORE, 0;
set $DOOMSDAY_CLUES, $DOOMSDAY_CLUES+1;
announce "Jande : Golem destroyed, crisis averted. I'll be resetting the number of victories.", 0;
if ($@DD_LOC$ == "")
end;
areatimer 0, $@DD_LOC$, 20, 20, 500, 500, 100, "Doomsday::OnDD4SurvivorReward";
end;
}
// Control puppets for Doomsday Council Meetings
-|script|Doomsday Council|32767
{
if (GM >= G_DEV)
mes "["+strnpcinfo(0)+"]";
mes "You probably should try talking to them normally.";
if (GM >= G_DEV)
mes "##9 Use: @npctalk \""+strnpcinfo(0)+"\" \"your message goes here\"##0";
close;
OnInit:
// Tulimshar room (Doomsday Tulim: _DT)
if (puppet("001-2", 99, 22, "Sagatha#_DT", 167) < 1) mapexit;
if (puppet("001-2", 92, 24, "Elanore#_DT", 108) < 1) mapexit;
if (puppet("001-2", 92, 30, "Nikolai#_DT", 362) < 1) mapexit;
if (puppet("001-2", 99, 32, "Morgan#_DT", 355) < 1) mapexit;
if (puppet("001-2", 110, 22, "Valia#_DT", 370) < 1) mapexit;
if (puppet("001-2", 117, 24, "Waric#_DT", 153) < 1) mapexit;
if (puppet("001-2", 117, 30, "Golbenez#_DT", 307) < 1) mapexit;
if (puppet("001-2", 110, 32, "Numa#_DT", 393) < 1) mapexit;
// Hurnscald room (Doomsday Hurns: _DH)
if (puppet("069-2", 101, 85, "Sagatha#_DH", 167) < 1) mapexit;
if (puppet("069-2", 94, 87, "Elanore#_DH", 108) < 1) mapexit;
if (puppet("069-2", 94, 93, "Nikolai#_DH", 362) < 1) mapexit;
if (puppet("069-2", 101, 95, "Morgan#_DH", 355) < 1) mapexit;
if (puppet("069-2", 112, 85, "Valia#_DH", 370) < 1) mapexit;
if (puppet("069-2", 119, 87, "Waric#_DH", 153) < 1) mapexit;
if (puppet("069-2", 119, 93, "Golbenez#_DH", 307) < 1) mapexit;
if (puppet("069-2", 112, 95, "Numa#_DH", 393) < 1) mapexit;
// Nivalis room (Doomsday Nivalis: _DN)
if (puppet("048-2", 113, 86, "Sagatha#_DN", 167) < 1) mapexit;
if (puppet("048-2", 112, 87, "Elanore#_DN", 108) < 1) mapexit;
if (puppet("048-2", 114, 87, "Nikolai#_DN", 362) < 1) mapexit;
if (puppet("048-2", 113, 88, "Morgan#_DN", 355) < 1) mapexit;
if (puppet("048-2", 118, 85, "Valia#_DN", 370) < 1) mapexit;
if (puppet("048-2", 117, 86, "Waric#_DN", 153) < 1) mapexit;
if (puppet("048-2", 119, 86, "Golbenez#_DN", 307) < 1) mapexit;
if (puppet("048-2", 118, 87, "Numa#_DN", 393) < 1) mapexit;
// Disable puppets
disablenpc "Sagatha#_DT";
disablenpc "Elanore#_DT";
disablenpc "Nikolai#_DT";
disablenpc "Morgan#_DT";
disablenpc "Valia#_DT";
disablenpc "Waric#_DT";
disablenpc "Golbenez#_DT";
disablenpc "Numa#_DT";
disablenpc "Sagatha#_DH";
disablenpc "Elanore#_DH";
disablenpc "Nikolai#_DH";
disablenpc "Morgan#_DH";
disablenpc "Valia#_DH";
disablenpc "Waric#_DH";
disablenpc "Golbenez#_DH";
disablenpc "Numa#_DH";
disablenpc "Sagatha#_DN";
disablenpc "Elanore#_DN";
disablenpc "Nikolai#_DN";
disablenpc "Morgan#_DN";
disablenpc "Valia#_DN";
disablenpc "Waric#_DN";
disablenpc "Golbenez#_DN";
disablenpc "Numa#_DN";
end;
}
// 114,80
-|script|Doomsday Council Master|32767
{
mes "The wizard seems to ignore you.";
if (GM < G_DEV)
close;
goto L_Main;
L_Main:
explode @n$, strnpcinfo(0), "#";
// @n$[1] = _DT/_DH/_DN for dismissal
mes "";
menu
"[GM 40] Enable Sagatha", L_Sagatha,
"[GM 40] Enable Elanore", L_Elanore,
"[GM 40] Enable Nikolai", L_Nikolai,
"[GM 40] Enable Morgan", L_Morgan,
"[GM 40] Enable Valia", L_Valia,
"[GM 40] Enable Waric", L_Waric,
"[GM 40] Enable Golbenez", L_Golbenez,
"[GM 98] Enable Numa", L_Numa,
"[GM 40] Disable Sagatha", L_NoSagatha,
"[GM 40] Disable Elanore", L_NoElanore,
"[GM 40] Disable Nikolai", L_NoNikolai,
"[GM 40] Disable Morgan", L_NoMorgan,
"[GM 40] Disable Valia", L_NoValia,
"[GM 40] Disable Waric", L_NoWaric,
"[GM 40] Disable Golbenez", L_NoGolbenez,
"[GM 98] Disable Numa", L_NoNuma,
"[GM 60] Cancel Next Siege", L_SkipSiege,
"[GM 80] Dismiss the council", L_Dismiss;
L_Sagatha:
enablenpc "Sagatha#"+@n$[1];
goto L_Main;
L_NoSagatha:
disablenpc "Sagatha#"+@n$[1];
goto L_Main;
L_Elanore:
enablenpc "Elanore#"+@n$[1];
goto L_Main;
L_NoElanore:
disablenpc "Elanore#"+@n$[1];
goto L_Main;
L_Nikolai:
enablenpc "Nikolai#"+@n$[1];
goto L_Main;
L_NoNikolai:
disablenpc "Nikolai#"+@n$[1];
goto L_Main;
L_Morgan:
enablenpc "Morgan#"+@n$[1];
goto L_Main;
L_NoMorgan:
disablenpc "Morgan#"+@n$[1];
goto L_Main;
L_Valia:
enablenpc "Valia#"+@n$[1];
goto L_Main;
L_NoValia:
disablenpc "Valia#"+@n$[1];
goto L_Main;
L_Waric:
enablenpc "Waric#"+@n$[1];
goto L_Main;
L_NoWaric:
disablenpc "Waric#"+@n$[1];
goto L_Main;
L_Golbenez:
enablenpc "Golbenez#"+@n$[1];
goto L_Main;
L_NoGolbenez:
disablenpc "Golbenez#"+@n$[1];
goto L_Main;
L_Numa:
if (GM < G_SYSOP)
mes "Your GM level does not authorizes you to perform this operation.";
if (GM < G_SYSOP)
close;
enablenpc "Numa#"+@n$[1];
goto L_Main;
L_NoNuma:
if (GM < G_SYSOP)
mes "Your GM level does not authorizes you to perform this operation.";
if (GM < G_SYSOP)
close;
disablenpc "Numa#"+@n$[1];
goto L_Main;
L_Dismiss:
if (GM < G_ADMIN)
mes "Your GM level does not authorizes you to perform this operation.";
if (GM < G_ADMIN)
close;
disablenpc "Sagatha#"+@n$[1];
disablenpc "Elanore#"+@n$[1];
disablenpc "Nikolai#"+@n$[1];
disablenpc "Morgan#"+@n$[1];
disablenpc "Valia#"+@n$[1];
disablenpc "Waric#"+@n$[1];
disablenpc "Golbenez#"+@n$[1];
disablenpc "Arch-Wizard#"+@n$[1];
gmlog strcharinfo(0) + " dismissed the Council.";
close;
L_SkipSiege:
if (GM < G_GM)
mes "Your GM level does not authorizes you to perform this operation.";
if (GM < G_GM)
close;
set $@DOOMSDAY_SKIP, 1;
announce "Jande : I do not believe the enemy army will move this time. We should be safe for now.", 0;
gmlog strcharinfo(0) + " cancelled the scheduled doomsday attack.";
close;
OnInit:
// Tulimshar room (Doomsday Tulim: _DT)
if (puppet("001-2", 104, 27, "Arch-Wizard#_DT", 354) < 1) mapexit;
if (puppet("069-2", 106, 90, "Arch-Wizard#_DH", 354) < 1) mapexit;
if (puppet("048-2", 114, 80, "Arch-Wizard#_DN", 354) < 1) mapexit;
// Disable puppets
disablenpc "Arch-Wizard#_DT";
disablenpc "Arch-Wizard#_DH";
disablenpc "Arch-Wizard#_DN";
end;
}
009-1,53,40,0|script|Chest#Zealite|111
{
if ($DOOMSDAY_SUMMON < 2) end;
if ((gettimetick(2)-TUT_var < 3*7*86400) || (BaseLevel < 25)) //player must be created at least 3 weeks ago
goto L_EndTooYoung;
if (#DOOMSDAY_ARMOR)
goto L_EndTooYoung;
mes "[Chest]";
mes "Inside this chest, Jande left us some Zealite based armor.";
next;
mes "[Chest]";
mes "The @@5254|@@ can be really powerful. It'll be taken away once Doomsday Event ends.";
next;
mes "[Chest]";
mes "Should we take it? (Max. 1 per account)";
next;
mes "Event Details: [@@https://forums.themanaworld.org/viewtopic.php?t=20921|@@]";
menu
"Yes, take it", L_Yes,
"No, I don't trust it", L_No;
L_Yes:
message strcharinfo(0), "Chest : You took the Savior Armor from the chest. It will be lost once event ends.";
getitem "SaviorArmor", 1;
set #DOOMSDAY_ARMOR, 1;
close;
L_No:
close;
L_EndTooYoung:
message strcharinfo(0), "Chest : It is empty!";
end;
OnInit:
disablenpc "Chest#Zealite";
end;
}
008-1,97,28,0|script|#Haystack|400
{
if ($DOOMSDAY != 3) end;
if ((gettimetick(2)-TUT_var < 5*7*86400) || (BaseLevel < 40)) //player must be created at least 5 weeks ago
goto L_EndTooYoung;
if (gettimetick(2) < #HAYSTACKTIMEPENALTY)
goto L_EndRateLimit;
set #HAYSTACKTIMEPENALTY, gettimetick(2) + 5;
message strcharinfo(0), "Haystack : What exactly are you looking for?";
// 5% chance (was 1% on 2010)
if (rand(20) == 0)
goto L_GetNeedle;
close;
L_GetNeedle:
set #HAYSTACKTIMEPENALTY, gettimetick(2) + 3600; // 1 hours delay
getitem "BentNeedle", 1;
end;
L_EndTooYoung:
end;
L_EndRateLimit:
message strcharinfo(0), "Haystack : I just searched this haystack... Gimme a break.";
end;
}
// This function controls death, both on Zax Domains as with Black Rose
// Undead cannot use the Black Rose :>
function|script|DoomsdayAct5
{
if ($DOOMSDAY != 3 || Class == 6)
goto L_Return;
if (getmap() == "099-8")
goto L_Return;
if (getmap() == "099-5")
goto L_WaitRoom;
if (getmap() == "099-1" || getmap() == "099-2" || getmap() == "099-3" || getmap() == "099-4" || getmap() == "099-6")
goto L_WarpOut;
if (countitem("BlackRose"))
goto L_WarpTo;
goto L_Return;
L_WarpTo:
delitem "BlackRose", 1;
getitem "DarkPetal", 1;
heal 100000, 10000;
if ($DOOMSDAY_TWARP == 0)
goto L_KeshlamMaze;
else
goto L_KeshlamAbandoned;
return;
L_WarpOut:
if (countitem("DarkPetal") < 1)
goto L_Failure;
if (rand(9) == 6)
goto L_Failure;
delitem "DarkPetal", 1;
heal 100000, 10000;
warp "009-1", 52, 40;
message strcharinfo(0), "The Dark Petal has protected you from certain death!";
return;
L_WaitRoom:
heal 100000, 10000;
warp "099-4", 50, 49;
message strcharinfo(0), "You were defeated in combat and warped to a parallel dimension where Zax does not exist.";
message strcharinfo(0), "Try to survive and provide support to your friends from the backline!";
return;
L_Failure:
heal 100000, 10000;
warp "009-1", 52, 40;
message strcharinfo(0), "You returned to life as an undead!";
set Class, 6;
return;
L_Return:
return;
///////////////////////////////////
L_KeshlamMaze:
if (rand(10) % 2 == 1)
warp "099-8", 23, 378;
else
warp "099-8", 379, 378;
return;
L_KeshlamAbandoned:
warp "099-1", 34, 34;
return;
}
009-1,30,43,0|script|Chest#DarkRose|111
{
if ($DOOMSDAY != 3) end;
if ((gettimetick(2)-TUT_var < 2*7*86400) || (BaseLevel < 35)) //player must be created at least 2 weeks ago
goto L_EndTooYoung;
if (#DOOMSDAY_FREEROSE > gettimetick(2))
goto L_Cooldown;
mes "[Old Woman]";
mes "Hello. I've been picking up some @@666|@@, they are growing in my garden.";
next;
mes "[Old Woman]";
mes "The last time this happened was 10 years ago. They give me an ominous feeling.";
next;
mes "[Old Woman]";
mes "Do you want one? I don't like them. (Max. 1 per account)";
next;
mes "Event Details: [@@https://forums.themanaworld.org/viewtopic.php?t=20921|@@]";
menu
"Yes, take it", L_Yes,
"No, it sounds dangerous", L_No;
L_Yes:
message strcharinfo(0), "Chest : You can get another black rose for free in 23 hours.";
getitem "BlackRose", 1;
set #DOOMSDAY_FREEROSE, gettimetick(2)+82800;
close;
L_No:
close;
L_EndTooYoung:
message strcharinfo(0), "Chest : It is locked.";
end;
L_Cooldown:
message strcharinfo(0), "Chest : You can only claim a free rose every 23 hours, please come back later.";
end;
OnInit:
disablenpc "Chest#DarkRose";
end;
}
|