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

// 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;
}

// 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, amount, bossID
function AreaMonsterBoss {
    .@m$=getarg(0);
    .@x1=getarg(1);
    .@x2=getarg(3);
    .@y1=getarg(2);
    .@y2=getarg(4);
    .@mi=getarg(5);
    .@am=getarg(6);
    .@id=getarg(7);
    areamonster(.@m$, .@x1, .@y1, .@x2, .@y2, strmobinfo(1, .@mi), .@mi, .@am, instance_npcname(.name$)+"::OnKill"+.@id);
    return;
}

OnRoomA:
    // True: Must spawn boss, False: Allow to use warps
    if (01863_RelevanceCheck(1)) {
        mapannounce getmap(), l("BOSS FIGHT!"), bc_map|bc_pc;
        AreaMonsterBoss(getmap(), 62, 41, 121, 58, any(HolyPixie, NulityPixie, VanityPixie, TerraniteProtector, GoboBear, Centaur), 1, 1); // Aggressive: 33%
        // 6~12 support units
        AreaMonsterB(getmap(), 62, 41, 121, 58, BlackSlime, rand2(3,5));
        AreaMonsterB(getmap(), 62, 41, 121, 58, DarkLizard, rand2(2,3));
        AreaMonsterB(getmap(), 62, 41, 121, 58, BlackScorpion, rand2(1,2));
        // 620ms, AD18, tk710 hp 8.7
        AreaMonsterB(getmap(), 62, 41, 121, 58, Archant, rand2(0,1));
        // 200ms, AD21, tk630 hp 6.4
        AreaMonsterB(getmap(), 62, 41, 121, 58, HoodedNinja, any(0,0,1));
    }
    end;

// Kill boss will use setq3 and also erase any remaining monster
OnKill1:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|1;
    killmonsterall(getmap());
    end;

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

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

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

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

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

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

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

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

}