summaryrefslogtreecommitdiff
path: root/npc/001-7/homunculus.txt
blob: 8ab51ac0263f56f3581ecbf63d2d8f061c4c235e (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
// TMW2 scripts.
// Author:
//    Jesusalva
// Description:
//    001-7 Monster King's Village Configuration File
//    Part of Player Quest, see 023-3 scope and 024-16
//    (C) Moubootaur Legends, 2019

001-7,91,89,0	script	#Init0233	NPC_HIDDEN,0,0,{
    end;

OnTouch:
    .@q=getq(General_Narrator);
    .@q2=getq2(General_Narrator);
    // Cheater Detected
    if (.@q < 15) {
        warp "Save", 0, 0;
        die();
        end;
    }
    if (.@q == 15) {
        dispbottom lg("I'm not a coward! I must press forward!");
        end;
    }
	.@mapn$="023-3";
    warp .@mapn$, 48, 23;
    end;
}

001-7,59,44,0	script	#Init02331	NPC_HIDDEN,0,0,{
    end;

OnTouch:
    .@n=getq(General_Narrator);
    .@q=getq2(FrostiaQuest_Homunculus);
    // Cheater Detected
    if (.@n < 15) {
        warp "Save", 0, 0;
        die();
        end;
    }
    mesn l("Magically Sealed Gate");
    mesc l("The door is sealed. The riddle says: “I drink, I become, I am. Don't say my name, but say why you know me. For, I am the best in the world.”");
    if (!(.@q & 1)) {
        mesc l("You have no idea what that means."), 1;
        close;
    } else {
        //mesc l("You know the answer can only be @@.", getitemlink(Coffee)), 3;
        mesc l("Fortunately, we know the answer is..."), 3;
        next;
        select
            l("...Actually, I'm drawing in a blank."),
            l("...Tea."),
            l("...Coffee."),
            l("...Water."),
            l("...Potion."),
            l("...Blood."),
            l("...Cocktail."),
            l("...Poison.");
        mes "";
        if (@menu != 3) {
            mesc l("But unfortunately, whoever made this riddle disagrees with me.");
            close;
        }
    }
    next;
    mesn l("Magically Sealed Gate");
    if (!(.@q & 256)) {
        mesc l("Even after breaking the first layer, a second layer keeps active. The first layer gets back to work shortly after. What have I missed or forgotten to do?"), 1;
        close;
    } else {
        if (.@q != 511)
            Exception("Invalid quest state: "+.@q, RB_DEFAULT|RB_SPEECH|RB_ISFATAL);
        mesc l("Are you sure you want to proceed? You CANNOT COME BACK!"), 1;
        if (askyesno() == ASK_NO)
            close;
    }
    closeclientdialog;
    // We can create instance without recording the ID etc.
	// Map name limit: 4 chars (hmc1) - as of homunculus
	.@mapn$="hmc1@"+getcharid(0);
	.@map2$="hmc2@"+getcharid(0);
	.@inst = instance_create("Homunculus "+getcharid(0), getcharid(3), IOT_CHAR);
    if (.@inst >= 0) {
        instance_attachmap("023-3-1", .@inst, false, .@mapn$);
        instance_attachmap("023-3-2", .@inst, false, .@map2$);
        // Instance lasts one hour
	    instance_set_timeout(3600, 3600, .@inst);
	    instance_init(.@inst);
    }
    setq1 FrostiaQuest_Homunculus, 2;
    warp .@mapn$, any(45,46), 79;
    @instid=.@inst;
    end;
}

001-7,50,112,0	script	Abandoned Fountain#MKH	NPC_NO_SPRITE,{
    .@q=getq2(FrostiaQuest_Homunculus);
    mesn;
    mesc l("At a first glance, it seems to be full of water, but inspecting closer, it is not.");
    next;
    mesn;
    mesc l("It is difficult to describe, it is like if it was mixed with mana itself. Drinking a bit of it was enough to recover your MP.");
    percentheal 0, 100;
    if (!(.@q & .hcID))
        setq2 FrostiaQuest_Homunculus, .@q|.hcID;
    close;
OnInit:
    .hcID=1;
    .distance=2;
    end;
}


001-7,48,111,0	script	Sign#MKH	NPC_NO_SPRITE,{
    .@q=getq2(FrostiaQuest_Homunculus);
    mesn;
    mesc l("Welcome to") + " --_--_-___--__-_-_.";
    mesc l("Yes, we have @@!", getitemlink(Coffee));
    next;
    mesn;
    mesc l("The village name is difficult to read.");
    if (!(.@q & .hcID))
        setq2 FrostiaQuest_Homunculus, .@q|.hcID;
    close;
OnInit:
    .hcID=2;
    .distance=2;
    end;
}

001-7,41,104,0	script	Abandoned House#MKH1	NPC_NO_SPRITE,{
    .@q=getq2(FrostiaQuest_Homunculus);
    mesn;
    mesc l("The door won't budge.");
    if (!(.@q & .hcID))
        setq2 FrostiaQuest_Homunculus, .@q|.hcID;
    close;
OnInit:
    .hcID=4;
    .distance=2;
    end;
}

001-7,59,104,0	script	Abandoned House#MKH2	NPC_NO_SPRITE,{
    .@q=getq2(FrostiaQuest_Homunculus);
    mesn;
    mesc l("It seems to have been abandoned a long time ago, but the chimney is still going?");
    if (!(.@q & .hcID))
        setq2 FrostiaQuest_Homunculus, .@q|.hcID;
    close;
OnInit:
    .hcID=8;
    .distance=2;
    end;
}


001-7,41,99,0	script	Abandoned House#MKH3	NPC_NO_SPRITE,{
    .@q=getq2(FrostiaQuest_Homunculus);
    mesn;
    mesc l("The knob has... melted down? What?");
    if (!(.@q & .hcID))
        setq2 FrostiaQuest_Homunculus, .@q|.hcID;
    close;
OnInit:
    .hcID=16;
    .distance=1;
    end;
}

001-7,59,99,0	script	Abandoned House#MKH4	NPC_NO_SPRITE,{
    .@q=getq2(FrostiaQuest_Homunculus);
    mesn;
    mesc l("There seems to be signs of a fight long forgotten, but it still reeks blood.");
    if (!(.@q & .hcID))
        setq2 FrostiaQuest_Homunculus, .@q|.hcID;
    close;
OnInit:
    .hcID=32;
    .distance=1;
    end;
}

001-7,33,89,0	script	Apple Trees#MKH1	NPC_NO_SPRITE,{
    .@q=getq2(FrostiaQuest_Homunculus);
    mesn;
    mesc l("It seems to be growing apples, but by the amount of magic particles...");
    next;
    mesn;
    mesc l("A close inspection reveals nothing out of ordinary. It seems to be well kept.");
    next;
    if (!(.@q & 1)) {
        mesn strcharinfo(0);
        mesc l("You're hesitant to pick one, they could be dangerous.");
        close;
    }
    mesn strcharinfo(0);
    mesc l("You carefully pick a @@. It looks delicious! You feel you'll need it sooner than you expect.", getitemlink(MagicApple));
    if (!(.@q & .hcID)) {
        inventoryplace MagicApple, 1;
        getitem MagicApple, 1;
        setq2 FrostiaQuest_Homunculus, .@q|.hcID;
    }
    close;
OnInit:
    .hcID=64;
    .distance=2;
    end;
}

001-7,40,88,0	script	Abandoned House#MKH6	NPC_NO_SPRITE,{
    .@q=getq2(FrostiaQuest_Homunculus);
    if (!(.@q & 64)) {
        mesn strcharinfo(0);
        mesc l("I should check the Apple Garden first.");
        close;
    }
    // I hope this is right
    if (!(
        (.@q & 4) &&
        (.@q & 8) &&
        (.@q & 16) &&
        (.@q & 32)) ) {
        mesn strcharinfo(0);
        mesc l("I better not disturb the hut owner.");
        close;
    }

    mesn;
    mesc l("It's locked. But a close inspection reveals a small key under the rug.");
    next;
    mesn;
    mesc l("Maybe there's a locked door somewhere, and this key will fit?");
    if (!(.@q & .hcID))
        setq2 FrostiaQuest_Homunculus, .@q|.hcID;
    close;
OnInit:
    .hcID=128;
    .distance=1;
    end;
}

001-7,50,99,0	script	Abandoned House#MKH5	NPC_NO_SPRITE,{
    .@q=getq2(FrostiaQuest_Homunculus);
    if (!(.@q & 128)) {
        mesn;
        mesc l("It's locked.");
        next;
        mesn strcharinfo(0);
        mesc l("Maybe there is a key somewhere near. I should keep looking.");
        close;
    }
    mesn;
    mesc l("It's locked.");
    next;
    mesn;
    mesc l("You use the small key from the apple garden hut. It fits neatly.");
    next;
    mesn;
    mesc l("The hut is... empty. And it doesn't have a fireplace, either.");
    next;
    mesn;
    mesc l("You don't know how the chimney keeps producing smoke. It must be using hiding magic.");
    next;
    mesn;
    mesc l("Whoever took control of this village is no ordinary mage. There's a switch on the wall.");
    next;
    mesn;
    mesc l("You flip the switch. Nothing happens.");
    // You can unflip it :>
    setq2 FrostiaQuest_Homunculus, .@q^.hcID;
    mesc l("Strange switch status: @@", (.@q&.hcID ? l("Inactive") : l("Active"))), 3;
    close;
OnInit:
    .hcID=256;
    .distance=1;
    end;
}