summaryrefslogtreecommitdiff
path: root/npc/018-6-3/main.txt
blob: ec3d771b63c5185942b5e604e5d8dfa5cb7929c1 (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
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
// TMW2 Scripts
// Author:
//    Jesusalva
// Description:
//    Controls Forgotten Shrine

018-6-3	mapflag	nowarpto

// 01863_RelevanceCheck ( Room ID )
function	script	01863_RelevanceCheck	{
    .@id=getarg(0);
    .@q=getq(LoFQuest_Barbara);
    .@q2=getq2(LoFQuest_Barbara);
    .@q3=getq3(LoFQuest_Barbara);
    if (.@q < 3)
        Exception("INVALID QUEST STATE, REVCHECK", RB_DEFAULT|RB_ISFATAL);
    if (.@q != 3)
        return false;
    if (.@q3 & .@id)
        return false;
    return true;
}

// TODO: filler
function	script	01863_DisableAllWarps	{
    .@q=getq(LoFQuest_Barbara);
    .@q2=getq2(LoFQuest_Barbara);
    .@q3=getq3(LoFQuest_Barbara);
    if (.@q < 3)
        Exception("ERROR, INVALID WARP", RB_DEFAULT|RB_ISFATAL);

    disablenpc instance_npcname("#01863_fromNorthtoOut", .@q2);
    disablenpc instance_npcname("#01863_fromNorthtoNW", .@q2);
    disablenpc instance_npcname("#01863_fromNorthtoNE", .@q2);
    disablenpc instance_npcname("#01863_fromSouthtoOut", .@q2);
    disablenpc instance_npcname("#01863_fromSouthtoSW", .@q2);
    disablenpc instance_npcname("#01863_fromSouthtoSE", .@q2);
    disablenpc instance_npcname("#01863_fromNWtoNorth", .@q2);
    disablenpc instance_npcname("#01863_fromNWtoNC", .@q2);
    disablenpc instance_npcname("#01863_fromNWtoSW", .@q2);
    disablenpc instance_npcname("#01863_fromSWtoSouth", .@q2);
    disablenpc instance_npcname("#01863_fromSWtoSC", .@q2);
    disablenpc instance_npcname("#01863_fromSWtoNW", .@q2);
    disablenpc instance_npcname("#01863_fromNEtoNorth", .@q2);
    disablenpc instance_npcname("#01863_fromNEtoNC", .@q2);
    disablenpc instance_npcname("#01863_fromNEtoSE", .@q2);
    disablenpc instance_npcname("#01863_fromSEtoSouth", .@q2);
    disablenpc instance_npcname("#01863_fromSEtoSC", .@q2);
    disablenpc instance_npcname("#01863_fromSEtoNE", .@q2);
    disablenpc instance_npcname("#01863_fromNCtoNW", .@q2);
    disablenpc instance_npcname("#01863_fromNCtoNE", .@q2);
    //disablenpc instance_npcname("#01863_fromNCtoCC", .@q2);
    disablenpc instance_npcname("#01863_fromSCtoSW", .@q2);
    disablenpc instance_npcname("#01863_fromSCtoSE", .@q2);
    //disablenpc instance_npcname("#01863_fromSCtoCC", .@q2);
    return;
}

// Main Controller for Instanced maps
018-6-3,0,0,0	script	#01863_InstCtrl	NPC_HIDDEN,{
    end;

// Map, x1, y1, x2, y2, mob, amount
function AreaMonsterB {
    .@m$=getarg(0);
    .@x1=getarg(1);
    .@x2=getarg(3);
    .@y1=getarg(2);
    .@y2=getarg(4);
    .@mi=getarg(5);
    .@am=getarg(6);
    if (!.@am)
        return;
    areamonster(.@m$, .@x1, .@y1, .@x2, .@y2, strmobinfo(1, .@mi), .@mi, .@am);
    //, instance_npcname(.name$)+"::OnKill"+.@mi);
    return;
}

// Map, x1, y1, x2, y2, mob, bossID
function AreaMonsterBoss {
    .@m$=getarg(0);
    .@x1=getarg(1);
    .@x2=getarg(3);
    .@y1=getarg(2);
    .@y2=getarg(4);
    .@mi=getarg(5);
    .@id=getarg(6);
    areamonster(.@m$, .@x1, .@y1, .@x2, .@y2, strmobinfo(1, .@mi), .@mi, 1, instance_npcname(.name$)+"::OnKill"+.@id);
    return;
}

// BossRoom ( RoomID, x1, y1, x2, y2, adjustment )
// Adjustment is for bigger rooms. Defaults to false.
function BossRoom {
    .@id=getarg(0);
    .@x1=getarg(1);
    .@y1=getarg(2);
    .@x2=getarg(3);
    .@y2=getarg(4);
    .@ad=getarg(5, false);
    // True: Must spawn boss, False: Allow to use warps
    if (01863_RelevanceCheck(.@id)) {
        mapannounce getmap(), l("BOSS FIGHT!"), bc_map|bc_pc;
        // Spawn a boss. Aggressive chance: 33%
        AreaMonsterBoss(getmap(), .@x1, .@y1, .@x2, .@y2, any(HolyPixie, NulityPixie, VanityPixie, TerraniteProtector, GoboBear, Centaur), .@id);

        // BIG ROOM: 6~12 support units
        // SMALL ROOM: 5~10 support units
        AreaMonsterB(getmap(), .@x1, .@y1, .@x2, .@y2, BlackSlime, rand2(2,4)+.@ad);
        AreaMonsterB(getmap(), .@x1, .@y1, .@x2, .@y2, DarkLizard, rand2(1,2)+.@ad);
        AreaMonsterB(getmap(), .@x1, .@y1, .@x2, .@y2, BlackScorpion, rand2(1,2));
        AreaMonsterB(getmap(), .@x1, .@y1, .@x2, .@y2, Archant, rand2(1,2)-.@ad);
        // Only spawn the fast Hooded Ninja on big rooms
        if (.@ad) {
            AreaMonsterB(getmap(), .@x1, .@y1, .@x2, .@y2, HoodedNinja, any(0,0,1));
        }
        return false;
    }
    return true;
}

// W - West, C - Center, E - East, N - North, S - South
OnRoomNorth:
L_Room1:
    if (BossRoom(1, 62, 41, 121, 58, true)) {
        enablenpc instance_npcname("#01863_fromNorthtoNW");
        enablenpc instance_npcname("#01863_fromNorthtoNE");
        enablenpc instance_npcname("#01863_fromNorthtoOut");
    }
    end;

OnRoomNW:
L_Room2:
    if (BossRoom(2, 48, 65, 68, 85)) {
        enablenpc instance_npcname("#01863_fromNWtoNorth");
        enablenpc instance_npcname("#01863_fromNWtoNC");
        enablenpc instance_npcname("#01863_fromNWtoSW");
    }
    end;

OnRoomNC:
L_Room4:
    if (BossRoom(4, 77, 65, 103, 76)) {
        enablenpc instance_npcname("#01863_fromNCtoNW");
        enablenpc instance_npcname("#01863_fromNCtoNE");
        //enablenpc instance_npcname("#01863_fromNCtoCC");
    }
    end;

OnRoomNE:
L_Room8:
    if (BossRoom(8, 111, 65, 131, 85)) {
        enablenpc instance_npcname("#01863_fromNEtoNorth");
        enablenpc instance_npcname("#01863_fromNEtoNC");
        enablenpc instance_npcname("#01863_fromNEtoSE");
    }
    end;

OnRoomSW:
L_Room16:
    if (BossRoom(16, 48, 95, 68, 115)) {
        enablenpc instance_npcname("#01863_fromSWtoSouth");
        enablenpc instance_npcname("#01863_fromSWtoSC");
        enablenpc instance_npcname("#01863_fromSWtoNW");
    }
    end;

OnRoomSC:
L_Room32:
    if (BossRoom(32, 77, 104, 103, 115)) {
        enablenpc instance_npcname("#01863_fromSCtoSW");
        enablenpc instance_npcname("#01863_fromSCtoSE");
        //enablenpc instance_npcname("#01863_fromSCtoCC");
    }
    end;

OnRoomSE:
L_Room64:
    if (BossRoom(64, 111, 95, 131, 115)) {
        enablenpc instance_npcname("#01863_fromSEtoSouth");
        enablenpc instance_npcname("#01863_fromSEtoSC");
        enablenpc instance_npcname("#01863_fromSEtoNE");
    }
    end;

OnRoomSouth:
L_Room128:
    if (BossRoom(128, 62, 122, 121, 139, true)) {
        enablenpc instance_npcname("#01863_fromSouthtoSW");
        enablenpc instance_npcname("#01863_fromSouthtoSE");
        enablenpc instance_npcname("#01863_fromSouthtoOut");
    }
    end;

// Kill boss will use setq3 and also erase any remaining monster
// Then it'll cast again the room event to enable the warps.
OnKill1:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|1;
    killmonsterall(getmap());
    goto L_Room1;

OnKill2:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|2;
    killmonsterall(getmap());
    goto L_Room2;

OnKill4:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|4;
    killmonsterall(getmap());
    goto L_Room4;

OnKill8:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|8;
    killmonsterall(getmap());
    goto L_Room8;

OnKill16:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|16;
    killmonsterall(getmap());
    goto L_Room16;

OnKill32:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|32;
    killmonsterall(getmap());
    goto L_Room32;

OnKill64:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|64;
    killmonsterall(getmap());
    goto L_Room64;

OnKill128:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|128;
    killmonsterall(getmap());
    goto L_Room128;

OnKill256:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|256;
    killmonsterall(getmap());
    end;

}

////////// Warp System below this file
018-6-3,86,32,0	script	#01863_fromOuttoNorth	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 86, 44;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomNorth";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
}

018-6-3,86,43,0	script	#01863_fromNorthtoOut	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 86, 31;
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,64,50,0	script	#01863_fromNorthtoNW	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 58, 67;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomNW";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,58,66,0	script	#01863_fromNWtoNorth	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 65, 50;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomNorth";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,119,50,0	script	#01863_fromNorthtoNE	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 122, 68;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomNE";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,122,67,0	script	#01863_fromNEtoNorth	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 118, 50;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomNorth";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,67,75,0	script	#01863_fromNWtoNC	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 79, 71;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomNC";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,78,71,0	script	#01863_fromNCtoNW	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 66, 75;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomNW";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,57,83,0	script	#01863_fromNWtoSW	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 57, 97;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomSW";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,57,96,0	script	#01863_fromSWtoNW	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 57, 82;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomNW";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,112,75,0	script	#01863_fromNEtoNC	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 101, 70;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomNC";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,102,70,0	script	#01863_fromNCtoNE	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 113, 75;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomNE";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,121,84,0	script	#01863_fromNEtoSE	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 121, 97;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomSE";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,121,96,0	script	#01863_fromSEtoNE	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 121, 83;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomNE";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,57,113,0	script	#01863_fromSWtoSouth	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 64, 131;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomSouth";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,63,131,0	script	#01863_fromSouthtoSW	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 57, 112;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomSW";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,123,113,0	script	#01863_fromSEtoSouth	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 119, 131;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomSouth";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,120,131,0	script	#01863_fromSouthtoSE	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 123, 112;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomSE";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,66,106,0	script	#01863_fromSWtoSC	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 79, 110;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomSC";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,78,110,0	script	#01863_fromSCtoSW	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 65, 106;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomSW";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,112,110,0	script	#01863_fromSEtoSC	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 101, 110;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomSC";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,102,110,0	script	#01863_fromSCtoSE	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 113, 110;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomSE";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,92,137,0	script	#01863_fromSouthtoOut	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 92, 151;
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,92,150,0	script	#01863_fromOuttoSouth	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 92, 136;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomSouth";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
}

018-6-3,90,84,0	script	#01863_fromCCtoNC	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 90, 73;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomNC";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}

018-6-3,90,96,0	script	#01863_fromCCtoSC	NPC_SUMMONING_CIRC,0,0,{
    dispbottom l("I should be prepared before walking on this.");
    end;

OnTouch:
    // Disable any other active portal
    01863_DisableAllWarps();

    // Warp you to next room coordinates
    slide 90, 106;

    // Execute the next room code and finish
    doevent instance_npcname("#01863_InstCtrl", .@q2)+"::OnRoomSC";
    end;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}
/////////////////////////////
/////////////////////////////
/////////////////////////////
// Critical Room
// NCCC: 90.74 → 90,85
// SCCC: 90.105 → 90,95
// Altar: 90,90
// Room: 74,83 ~ 106,97

018-6-3,90,90,0	script	Mana Stone#01863	NPC_MANA_STONE,{
    mesn;
    mes l("The mighty Mana Stone does not reacts against you.");
    mes l("It's")+b(l("small, red, round and shiny."));
    mes l("If you fell ready, perhaps you should touch it?");
    mes "";
    select
        l("Touch it!"),
        l("Take it!"),
        l("Break it!"),
        l("Leave it alone!");
    mes "";
    @difficulty_modulus=10;
    switch (@menu) {
        case 1:
            mesc l("Curiously, you try to touch the Mana Stone.");
            next;
        case 2:
            mesc l("Determinately, you move your hand to grab it.");
            next;
        case 3:
            mesc l("Are you out of your mind?!");
            mesc l("If you break that, you will never go to the World's Edge!");
            next;
            mesc l("Attempt to break the Mana Stone?"), 1;
            if (askyesno() == ASK_NO)
                close;
            mes "";
            @difficulty_modulus+=10;
            break;
        default:
            close;
    }
    mes "";
    mes ".:: " + l("The Mana Stone") + " ::.";
    mesq l("Do you think yourself worthy of my power?");
    next;
    // Both choices are valid, actually.
    askyesno();
    mes ".:: " + l("The Mana Stone") + " ::.";
    if (@menu == ASK_YES)
        mesq l("Then prove yourself!");
    else
        mesq l("But that's no excuse for cowardice!");
    next;
    mes ".:: " + l("The Mana Stone") + " ::.";
    mesq l("Foolish mortal, who doesn't knows what you are doing!");
    next;
    setnpcdisplay instance_npcname("Mana Stone#01863"), NPC_LIGHTBRINGER;
    mes ".:: " + l("The Mana Stone") + " ::.";
    mesq l("I shall decide here and now, if you are worth of living in this world!");
    next;
    mes ".:: " + l("The Mana Stone") + " ::.";
    mesq l("I am the Judge, and I shall make Judgment upon you!");
    mesc l("WARNING: ")+l("If you die or logout here, the quest will be reset!"), 1;
    next;
    //doevent
    //disablenpc
    Exception("Could not begin the Boss Fight!", RB_SPEECH|RB_ISFATAL);
    close;

// Mana Stone is the initial NPC, not hidden
OnInit:
    disablenpc .name$;
    end;
}

018-6-3,90,90,0	script	???#01863	NPC_NO_SPRITE,{
    mesc l("You see a red apple here. It is ")+b(l("small, red, round and shiny."));
    next;
    mesc l("Take it?");
    if (askyesno() == ASK_YES) {
        inventoryplace MagicApple, 1;
        getitem MagicApple, 1;
        //setq
        mes "";
        mesc l("You take the @@. It seems to be the stolen item.", getitemlink(MagicApple));
        disablenpc instance_npcname(.name$);
    }
    close;

// NPC must remain hidden.
OnInit:
    disablenpc .name$;
    end;
OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}