summaryrefslogtreecommitdiff
path: root/npc/026-0/ctrl.c
blob: bc12a502b5408786496e74310b47edec31fd9f69 (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
// TMW2 scripts.
// Author:
//    Jesusalva
// Description:
//   The Impregnable Fortress Control Files
// Quest: General_Fortress
//  (MaxFloor+1, internal, internal)

026-0,64,20,0	script	Impregnable#B0F	NPC_HIDDEN,4,0,{
    end;

OnTouch:
    if (getq(General_Fortress) > 1) goto L_Warp;
    mesc l(".:: Impregnable Fortress, %sF ::.", "B0"), 3;
    msObjective(getq(General_Fortress) == 2, l("* Solo \"The Yetifly\""));
    msObjective($MK_TEMPVAR < MKIF_LV_B0F, l("Minimum wins: %d/%d", $MK_TEMPVAR, MKIF_LV_B1F));
    mes "";
    mesc l("Hint: Stomp! Stomp! Stomp! Walk around.");
    end;

L_Warp:
    // Not unlocked
    if ($GAME_STORYLINE >= 3 && $MK_TEMPVAR < MKIF_LV_B1F) {
        mesc l("The gate is sealed shut."), 1;
        mesc l("The monster army is still strong on this floor!"), 1;
        mesc l("Minimum wins: %d/%d", $MK_TEMPVAR, MKIF_LV_B1F), 1;
        close;
    }
    warp "026-1", 32, 97;
    dispbottom l("Coming Soon, in Moubootaur Legends!");
    end;

}

026-0,40,52,0	script	Impregnable#B0F_1	NPC_HIDDEN,0,0,{
    end;
OnTouch:
    .@q=getq(General_Fortress);
    .@q2=getq2(General_Fortress);
    .@q3=getq3(General_Fortress);
    if (.@q != 1) end;

    .@n$=strnpcinfo(0, "_0");
    explode(.@ni$, .@n$, "_");
    .@id=atoi(.@ni$[1]);
    if (.@id <= 0) Exception("Unparseable switch: "+.@n$, RB_DEFAULT|RB_ISFATAL);

    if (!(.@q2 & .@id)) {
        setq2 General_Fortress, .@q2 | .@id;
    }
    end;
}

026-0,45,48,0	duplicate(Impregnable#B0F_1)	Impregnable#B0F_2	NPC_HIDDEN,0,0
026-0,90,42,0	duplicate(Impregnable#B0F_1)	Impregnable#B0F_4	NPC_HIDDEN,0,0
026-0,83,55,0	duplicate(Impregnable#B0F_1)	Impregnable#B0F_8	NPC_HIDDEN,0,0
026-0,82,64,0	duplicate(Impregnable#B0F_1)	Impregnable#B0F_16	NPC_HIDDEN,0,0
026-0,65,58,0	duplicate(Impregnable#B0F_1)	Impregnable#B0F_32	NPC_HIDDEN,0,0
026-0,64,60,0	duplicate(Impregnable#B0F_1)	Impregnable#B0F_64	NPC_HIDDEN,0,0
026-0,43,76,0	duplicate(Impregnable#B0F_1)	Impregnable#B0F_128	NPC_HIDDEN,0,0
026-0,46,77,0	duplicate(Impregnable#B0F_1)	Impregnable#B0F_256	NPC_HIDDEN,0,0
026-0,70,87,0	duplicate(Impregnable#B0F_1)	Impregnable#B0F_512	NPC_HIDDEN,0,0
026-0,84,84,0	duplicate(Impregnable#B0F_1)	Impregnable#B0F_1024	NPC_HIDDEN,0,0
026-0,84,86,0	duplicate(Impregnable#B0F_1)	Impregnable#B0F_2048	NPC_HIDDEN,0,0
026-0,85,86,0	duplicate(Impregnable#B0F_1)	Impregnable#B0F_4096	NPC_HIDDEN,0,0


026-0,99,41,0	script	Impregnable#B0F_X	NPC_HIDDEN,0,0,{
    end;
OnTouch:
    .@q=getq(General_Fortress);
    .@q2=getq2(General_Fortress);
    .@q3=getq3(General_Fortress);
    if (.@q != 1) end;
    if (.@q2 < 8191) end;

    if (getareausers("026-0", 54, 39, 77, 53) > 0) end;
    if (mobcount("026-0", "Impregnable#B0F_X::OnYetifly") > 0)
        killmonster("026-0", "Impregnable#B0F_X::OnYetifly", false);

    slide 72, 49;
    monster("026-0", 57, 44, l("The Yetifly"), Yetifly, 1, "Impregnable#B0F_X::OnYetifly");
    addtimer2(15000, "Impregnable#B0F_X::OnHeartbeat");
    end;

OnHeartbeat:
    if (getmap() != "026-0") end;
    if (ispcdead())
        warp "025-1", 100, 83;
    addtimer2(15000, "Impregnable#B0F_X::OnHeartbeat");
    end;

OnYetifly:
    .@q=getq(General_Fortress);
    .@q2=getq2(General_Fortress);
    .@q3=getq3(General_Fortress);
    if (.@q != 1) end;
    if (.@q2 < 8191) end;

    dispbottom b(l("You have defeated the Yetifly. Access to B1F granted."));
    setq General_Fortress, 2, 0;
    Zeny+=100000;
    slide 98, 41;
    end;
}