summaryrefslogtreecommitdiff
path: root/npc/019-1-1/miler.txt
blob: 9d1f03c0ecd44437a05f8d2e5f59a9a47015b0d8 (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
// TMW2/LOF Script.
// Author:
//    Jesusalva
// Description:
//  Part from the EPISODE and the Well Quest
//  TODO: Walking NPC, clothes, etc;

019-1-1,41,24,0	script	Miler	NPC_PLAYER,{
    .@q=getq(LoFQuest_EPISODE);
    .@w=getq(NivalisQuest_Well);

    // Force players upon Cordo quest
    if (!THIEF_RANK && !MERC_RANK)
        goto L_Rejected;

    mesn;
    if (MERC_RANK)
        mesq l("Hello, @@.", mercrank());
    else
        mesq l("Hello, @@.", thiefrank());
    mes "";
    menu
        l("Hello."), -,
        rif(.@w == 1, l("I need help.")), L_Well,
        rif(.@q == 3 && countitem(HerbalTea), l("The Doctor sent you some tea.")), L_Doctor,
        rif(.@q == 5 && countitem(PresentBox), l("I have a present box to you open.")), L_Box,
        rif(.@q == 4, l("So, could I help you?")), L_Quest;

    close;

// Well Quest Subplot
L_Well:
    mes "";
    mesn;
    mesq l("What's the problem?");
    next;
    select
        l("Someone fell into the well.");
    mes "";
    mesn;
    mesq l("Ho! I'll help them!");
    getexp (BaseLevel * 111), 0;
    setq NivalisQuest_Well, 2;
    close;

// Well Quest Subplot
L_Doctor:
    mes "";
    delitem HerbalTea, 1;
    getexp 111, 11;
    setq LoFQuest_EPISODE, 4;
    mesn;
    mesq l("Many thanks, the Doctor always know what's best for you."); // you or your health? Are you sure?
    next;
    mesn;
    mesq l("Lemme just fetch a small something for you....");
    next;
    mesn;
    mesq l("Oh dear, oh dear, where could I have possibly left it?!");
    close;

// Not on Cordo quest
L_Rejected:
    mesn;
    mesq l("Hey, did you know there are two mouboos which constantly fight against themselves?!");
    next;
    mesn;
    mesq l("One claims to be a constable and teach people to sell high and buy low.");
    mesq l("The other one claims to be a dangerous bandit and to teach how to steal from monsters!");
    next;
    mesn;
    mesq l("Well, I heard you needed to have some Job levels to sign up with them, and couldn't resign later.");
    mesq l("But it is a so silly fight, that whoever you join with shouldn't do much difference.");
    next;
    mesn;
    mesq l("Anyway, I heard both were disciples from Cordo-whatever, a powerful person from LoF Village.");
    mesq l("I think you should get initiated on any side before speaking to me again.");
    close;

// Main Quest
L_Quest:
    mes "";
    mesn;
    mesq l("I lost the precious ring they gave me as a gift... Who could have taken it...?");
    next;
    mesn;
    mesq l("...Of course. It was THEM. It gotta to be them!");
    next;
    mesn strcharinfo(0);
    select l("'Them' whom?");
    mes "";
    mesn;
    mesq l("They came in the night, always taking what does not belong to them.... The SLIMES!");
    next;
    mesn;
    mesq l("The ones around here are specially nasty. They steal stuff and seal them on 'present boxes', just to amuse as people try to open those...");
    next;
    mesn;
    mesq l("...But worry not, I have the right screwdriver for the job. So, are you up to bring me some Present Boxes?");
    next;
    mesn strcharinfo(0);
    select
        l("Yes, I'll help you."),
        l("Nah, not now. Slimes ruin your clothes, after all.");
    mes "";
    if (@menu == 2) {
        mesn;
        mesq l("Ah, I see, I imagine you'll wear something different then... But please come back.");
        close;
    }
    setq LoFQuest_EPISODE, 5, 0;
    mesn;
    mesq l("Great, just bring me several boxes, once one of them have the ring I'm looking for.");
    close;

// Open Present Box Loop
L_Box:
    inventoryplace NPCEyes, 1;
    .@q2=getq2(LoFQuest_EPISODE);
    delitem PresentBox, 1;
    setq2 LoFQuest_EPISODE, .@q2+1;
    mesn;
    mesc l("@@ uses his screwdriver and open the sealed gift box like a pro.", .name$);
    // Handle result
    if (.@q2 >= 70) {
        goto L_Success;
    } else if (.@q2 >= 50) {
        .@id=any(WhiteFur, Candy, Milk, Lockpicks, MaggotSlime, CandyCane, ChocolateBar, XmasCake, GingerBreadMan, CherryCake, Plushroom, Moss, Chagashroom, BugLeg, Acorn, Manana, Mashmallow, HardSpike, SilkCoocon, IceCube);
        getitem .@id, 1;
        mesc l("But there was only a(n) @@ inside.", getitemlink(.@id));
    } else if (.@q2 >= 30) {
        if (rand(1,50) < .@q2) {
            .@id=any(Candy, MaggotSlime, Plushroom, Chagashroom, BugLeg, Acorn, MauveHerb);
            getitem .@id, 1;
            mesc l("But there was only a(n) @@ inside.", getitemlink(.@id));
        } else {
            .@id=rand(2,4)+.@q2;
            Zeny=Zeny+.@id;
            mesc l("But there was only @@ GP inside.", .@id);
        }
    } else if (.@q2 >= 10) {
        .@id=rand(3,5)+.@q2;
        Zeny=Zeny+.@id;
        mesc l("But there was only @@ GP inside.", .@id);
    } else {
        mesc l("But the box was empty.");
    }

    // Try again!
    if (countitem(PresentBox)) {
        mesn;
        mesq l("You have more boxes. Wanna try again?");
        if (askyesno() == ASK_YES)
            goto L_Box;
    }
    close;
// Quest Complete
L_Success:
    setq LoFQuest_EPISODE, 6, 0;
    // TODO: Experience? Gold? Pre-Requisite Item? (eg. Lazurite or Bent Neddle)
    mesc l("His golden ring pops right out of it.");
    next;
    mesn;
    mesq l("Many thanks. I couldn't live without it. Here, take this reward. Please come back later.");
    close;

OnInit:
    .@npcId = getnpcid(0, .name$);
    setunitdata(.@npcId, UDT_HEADTOP, KnitHat);
    setunitdata(.@npcId, UDT_HEADMIDDLE, CreasedShirt);
    setunitdata(.@npcId, UDT_HEADBOTTOM, NPCEyes);
    setunitdata(.@npcId, UDT_WEAPON, JeansShorts);
    setunitdata(.@npcId, UDT_HAIRSTYLE, rand(2,15));
    setunitdata(.@npcId, UDT_HAIRCOLOR, rand(4,14));

    .sex = G_MALE;
    .distance = 5;
    end;
}