summaryrefslogtreecommitdiff
path: root/npc/008-1/jack.txt
blob: fdce7fe616531a3436485326b779264a32358bd0 (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
// Evol scripts.
// Author:
//    gumi
// Quest states (forest bow):
//    [1] 0 - cannot do the quest
//    [1] 1 - can do the quest
//    [1] 2 - alan wants to ask jack
//    [1] 3 - jack explained problem
//    [1] 4 - alan asks to find wood
//    [1] 5 - found perfect wood
//    [1] 6 - got the bow
//    [2] fail count
//    [3] unused
//    [t] unused
// Quest states (wooden shield):
//    [1] 0 - cannot do the quest
//    [1] 1 - can do the quest
//    [1] 2 - jack proposes shield
//    [1] 3 - player accepted quest
//    [1] 4 - got the shield
//    [2] unused
//    [3] unused
//    [t] unused
// Description:
//    Jack Lumber, the handsome lumberjack


008-1,241,116,0	script	Jack	NPC_LUMBERJACK,{

     function bow_intro {
        speech(4,
            l("Why not?!"),
            l("I value my life, that's why!"));

        selectd(l("What do you mean?"));

        speech(4,
            l("A week ago, I was going to chop down one of those twigleaf trees in the forest to the southwest."),
            l("These twigleafs are the trees that give me the living wood you speak of."), // XXX: were Log Heads named "Twigleaf" at some point in the past?
            l("I was just chopping away with my axe, and guess what happened?"),
            l("One of its branches hit me!"),
            l("At first, I thought it fell down or the wind blew it, but it hurt!"),
            l("After I shook it off and struck the tree again with my axe, another branch hit me!"),
            l("I got angry and started to chop off all the low-hanging branches so this couldn't happen anymore."),
            l("Even after all that though, I still can't believe what happened next."));

        selectd(l("What happened?"));

        speech(4,
            l("You'll think I'm insane if I tell you..."));

        selectd(l("I won't. I promise."));

        speech(4,
            l("Alright, well..."),
            l("After I chopped off a few branches, the whole tree started to move!"),
            l("Its roots tore out of the earth, all the branches started to wave around, and a face appeared on the trunk."),
            l("The whole tree CAME TO LIFE! It was mad!"));

        selectd(l("Did you run away?"), l("Did you fight it?"));

        speech(4,
            l("I fought it, of course!"),
            l("I took my axe and attacked the beast!"),
            l("It hit me here *points at a bruise on his shoulder*, here *lifts his trouser leg to show another bruise*, and here *lifts his shirt and reveals even worse bruises*."), // XXX: that's kinda dirty imho... maybe we could use the narrator?
            l("But I didn't give up!"),
            l("I chopped away at it, branch after branch, and in the end I chopped off its roots, and it fell to the ground, motionless."));

        selectd(l("So you beat the monster? Then why are you so scared?"));

        speech(4,
            l("Well, I was exhausted and had to rest."),
            l("A few minutes passed, and suddenly I was practically surrounded by a dozen or more of these living trees!"));

        selectd(l("Did you fight them too?"));

        speech(4,
            l("Are you crazy?"),
            l("I barely destroyed one of those beasts."),
            l("I was in no shape to fight again!"),
            l("I ran away as fast as I could, and lucky for me the monsters aren't that fast on their tiny root legs, Ha!"));

        selectd(l("So, I guess you aren't chopping down trees anymore?"));

        speech(4,
            l("I still do; it's my job."),
            l("But I'll no longer chop those twigleafs, I'll tell you that."),
            l("I know the bow master wants some twigleaf wood, but I don't care."),
            l("I won't risk MY life for a few gold pieces!"),
            l("If you really want to, just go to the southwest, but I  can't help you."),
            l("I won't go there ever again."));

        selectd(l("Southwest you say? OK, thank you."));

        speech(l("Don't say I didn't warn you!"));

        // What a huge text wall, I feel sorry for the players

        close2;
        setq(.quest_bow, 3);
        end;
    }

    function bow_good_luck {
        if (getq(.quest_inspector) == 2)
        {
            speech(4,
                l("Good luck hunting those tree monsters – you'll need it."));

            selectd(l("Have you seen anything that might be connected to the recent robberies in town?"));

            speech(l("Sorry, no."));
            close;
        }

        npctalk3(l("Good luck hunting those tree monsters – you'll need it."));
        end;
    }

    function shield_intro {
        speech(4,
            l("I have an idea."),
            l("What would you say about a new shield?"));

        setq(.quest_shield, 2);

        selectd(
            l("No thanks."),
            l("Yes, please!"),
            rif(getq(.quest_inspector) == 2, l("Have you seen anything that might be connected to the recent robberies in town?")));

        switch (@menu)
        {
            case 1: closeclientdialog(); close;
            case 2:
                speech(
                    l("All I need is %d %s.", .logs_amount, getitemlink(.logs_item)),
                    l("This needn't be high quality wood; pretty much any log you can find should work."),
                    l("Oh, and I'll also need %s E for other materials.", format_number(.shield_cost)));

                close2;
                setq(.quest_shield, 3);
                end;
            case 3: speech(l("Sorry, no.")); close;
        }
    }

    function bow_congrats {
        speech(4,
            l("You've finally found that perfect piece of living wood that Alan needs to make a Forest Bow, haven't you?"));

        selectd(
            l("I couldn't afford the bow, though..."),
            l("No, I'm still looking."),
            l("Yes, I've got the Forest bow now."),
            l("I'm a melee warrior, I don't need bows."),
            rif(getq(.quest_inspector) == 2, l("Have you seen anything that might be connected to the recent robberies in town?")));

        switch (@menu)
        {
        case 3:
            if (getq(.quest_bow) <= 5)
            {
                speech(4,
                    l("Hrmph."),
                    l("I'm someone who respects those speaking the truth."));
            }
            // fallthrough
        case 1:
        case 4:
            speech(4,
                l("You no doubt remember how I struggled with those beasts, fighting for my life."),
                l("Scared me, those seven-branched little stumps did!"),
                l("Never since that day have I strayed near them, and yet there you are, cutting them down one by one."),
                l("I'm proud of you – to dare to fight those trunks is admirable indeed."),
                l("You're as strong as if you were my own child!"));

            shield_intro;
            break;
        case 2: speech(l("You should go talk to Alan again.")); close;
        case 5: speech(l("Sorry, no.")); close;
        }
    }

    function shield_make {
        speech(4,
            l("Do you have the %d %s and %s E for the shield?",
                .logs_amount, getitemlink(.logs_item), format_number(.shield_cost)));

        selectd(
            rif(countitem(.logs_item) >= .logs_amount && Zeny >= .shield_cost,
                l("Here it is.")),
            l("I'll come back later."));

        if (@menu != 1) {
            closeclientdialog();
            close;
        }

        speech(4,
            l("Have a seat."));

        narrator(4,
            l("Jack saws the logs into pieces and then sands them until they are smooth to the touch."),
            l("Applying some strong-smelling liquid, he tans them to a darker hue."),
            l("Grabbing one of two leftover pieces, he begins to carve it into a round shape, then repeats this with the second piece – shield handles from what you can tell."),
            l("Meanwhile, the sun has dried the other pieces."),
            l("Jack places them next to each other, adds a frame, and nails everything together."),
            l("The resulting shield looks usable already, but Jack applies another liquid to it and leaves it to dry for a few moments."),
            l("Finally, he hands the shield to you."));

        if (checkweight(.shield_item, 1) != true)
        {
            speech(
                l("It seems you can't carry the %s.", getitemlink(.shield_item)),
                l("Come back when you do."));
            close;
        }

        if (Zeny < .shield_cost || countitem(.logs_item) < .logs_amount)
            close; // double-check

        setq(.quest_shield, 4);
        delitem(.logs_item, .logs_amount);
        getitem(.shield_item, 1);
        Zeny -= .shield_cost;
        getexp(.shield_exp, 0);

        speech(
            l("Enjoy your new shield!"));

        close;
    }

    function wood_daily {
        speech(4,
            l("I hope that my shield will serve you well!"));

        selectd(
            l("Me too."),
            rif(getq(.quest_inspector) == 2, l("Have you seen anything that might be connected to the recent robberies in town?")));

        switch (@menu)
        {
        case 2: speech(l("Sorry, no.")); close;
        }

        closeclientdialog(); // TODO: daily quest (needs the generic daily quest script)
        close;
    }

    // OnTalk:
    switch (getq(.quest_shield))
    {
    case 2: shield_intro; break;
    case 3: shield_make; break;
    case 4: wood_daily; break;
    }

    switch (getq(.quest_bow))
    {
    case 3:
    case 4: bow_good_luck; break;
    case 5:
    case 6: bow_congrats; break;
    }

    // initial intro
    {
        speech(4,
            l("Hello there!"),
            l("My name is Jack Lumber, the enemy of all trees."),
            l("If you need some firewood, just let me know."));

        selectd(
            l("I'll keep that in mind."),
            rif(getq(.quest_inspector) == 2, l("Have you seen anything that might be connected to the recent robberies in town?")),
            rif(getq(.quest_bow) == 2, l("I heard you aren't delivering any more living wood. Why not?")));

        switch (@menu)
        {
        case 2: speech(l("Sorry, no.")); close;
        case 3: bow_intro; break;
        }

    }

    closeclientdialog();
    close;

OnInit:
    .logs_item = RawLog;
    .logs_amount = 40; // XXX: maybe nlogn?
    .shield_cost = 5000; // XXX: maybe nlogn?
    .shield_exp = 2500;
    .shield_item = WoodenShield;

    .quest_bow = HurnscaldQuests_ForestBow;
    .quest_shield = HurnscaldQuests_WoodenShield;
    .quest_inspector = HurnscaldQuests_Inspector;
    .quest_debug = .quest_bow;
    .bodytype = BODYTYPE_3;
    .distance = 3;

////////// UNFINISHED //////////
////////////////////////////////
// REMOVE THIS CODE WHEN THIS //
// NPC IS NO LONGER A WIP //////
////////////////////////////////
//if (!debug) disablenpc(.name$);
///////// UNFINISHED ///////////

    end;
}