summaryrefslogtreecommitdiff
path: root/npc/018-6-3/main.txt
blob: e0c8ffdc45aa41bc5edfc7350e00489dc040c96d (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
// 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;

}