summaryrefslogtreecommitdiff
path: root/npc/001-2-2/moon.txt
blob: e0e42e4bf7872a272e6abdbe39e6b652e3a4e4cf (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
// Evol scripts.
// Authors:
//    Reid
//    Travolta
// Description:
//    Moon, main NPC for the urchin quest.
// Variables:
//    ArtisQuests_Urchin  - quest var
// Quest stages:
//    0  - not started
//    1  - started, searching for Croc Claws
//    2  - quest finished

001-2-2,33,32,0	script	Moon#001-2-2	NPC_ELVEN_FEMALE,3,3,{

    function SayRandomGreeting {
        .@q = getq(ArtisQuests_Urchin);
        .@tick = gettimetick(1);
        if (.@tick > @ArtisQuests_Urchin_MoonMsgTick + 12)
        {
            setarray .messages$[0], l("Ouch!"), l("It hurts so bad!"),
                                    l("Help me!"), l("Hurry up!"),
                                    l("I can't wait all day!"),
                                    l("I need more Croc Claws."),
                                    l("What a relief."),
                                    l("No more pain, thanks to you."),
                                    l("I can walk again!");
            setarray .msg_first[0], 0, 3, 6;
            setarray .msg_last[0], 2, 5, 8;
            .@r = rand(.msg_first[.@q],.msg_last[.@q]);
            .@msg$ = .messages$[.@r];
            npctalk3 .@msg$;
            @ArtisQuests_Urchin_MoonMsgTick = .@tick;
        }
    }

    function CheckCrowClaw {
        if (getq(ArtisQuests_Urchin) != 1)
            return -1;

        mes "";
        mesn;
        if (countitem("CrocClaw") > 0)
        {
            delitem "CrocClaw", 1;
            if (rand(8) == 7)  // the lucky 7
            {
                mesq l("Yay, it worked! I removed a spike.");
                ArtisQuests_Urchin_ULeft--;
                next;
                if (!ArtisQuests_Urchin_ULeft)
                {
                    mesq l("It seems I got them all!");
                    next;
                    mesq l("Here is your reward.");
                    setq ArtisQuests_Urchin, 2;
                    getexp 1500, 100;
                    close2;
                    return 1;
                }
                else
                {
                    mesq l("But I still have some spikes left in my foot.");
                    next;
                    return 0;
                }
            }
            else
            {
                mesq l("This one is useless! Give me another @@.", getitemlink("CrocClaw"));
                next;
                return 0;
            }
        }
        else
        {
            mesq l("You don't have any @@, are you mocking me?", getitemlink("CrocClaw"));
            close2;
            return 1;
        }
    }

    stopnpctimer;

    .@q = getq(ArtisQuests_Urchin);
    if (.@q < 2)
    {
        mesn "Narrator";
        mesc(l("You see a young elven girl, with a strong sense of pain in her face."), 9);
        next;
    }
    else
    {
        mesn;
        mesq l("I appreciate your help, @@.", strcharinfo(0));
        goto L_Close;
    }
    if (.@q == 1) goto L_QuestStarted;

L_Story:
    select
        l("Hi, can I help you somehow?");
    mes "";
    mesn;
    mesq l("That would be great!");
    next;
    mesq l("Hi, my name is Moon. This morning I went for a walk on the beach.");
    next;
    mesq l("Walking barefoot, feeling the hot sand with my feet, daydreaming... I like such things, you know.");
    next;
    mesq l("I didn't notice that a Pikpik was in my way, and when I stepped on it, my foot was full of spikes.");
    next;
    mesq l("Luckily the beach is nearby, and somehow I made my way home.");
    next;
    mesq l("Please bring me @@s so I can pull out these spikes from my foot.", getitemlink("CrocClaw"));
    next;

    switch (select(l("Stay here, I will be back as soon as I have some."),
                   l("Maybe next time.")))
    {
        case 1:
            setq ArtisQuests_Urchin, 1;
            mes "";
            mesn;
            mesq l("It really hurts, please hurry!");

            ArtisQuests_Urchin_ULeft = rand(3,5);

            next;
            goto L_Where;
            break;
        case 2:
            mes "";
            mesn "Narrator";
            mesc(l("The girl looks desperate."),9);
    }
    goto L_Close;

L_QuestStarted:
    mesn;
    mesq l("Do you have @@s for me?", getitemlink("CrocClaw"));
    next;

    select
        l("Check out this one."),
        l("I should put more effort into this."),
        l("Where can I find some Croc Claws?");

    switch (@menu)
    {
        case 1:
            .@MustRepeat = CheckCrowClaw;
            if (!.@MustRepeat)
                goto L_CheckLoop;
            goto L_Close;
        case 2:
            mes "";
            mesn;
            mesq l("It really hurts, please hurry!");
            goto L_Close;
        case 3:
            mes "";
            mesn;
            goto L_Where;
    }

L_CheckLoop:
    while (!.@MustRepeat)
    {
        switch (select(l("Here is another one."),
                       l("I must leave to get more.")))
        {
            case 1:
                .@MustRepeat = CheckCrowClaw;
                break;
            case 2:
                goto L_Close;
        }
    }
    goto L_Close;

L_Where:
    mesq l("You can find some Crocs on the beach, you could look up at the one after the gate, on top of this city.");

    goto L_Close;

L_Close:
    initnpctimer;
    close;

OnTimer1000:
    domovestep;

OnTouch:
    SayRandomGreeting;
    end;

OnHour00:
    if (playerattached())
       @ArtisQuests_Urchin_MoonMsgTick = 0;
    end;

OnInit:
    .bodytype = BODYTYPE_2;
    .distance = 3;
    initpath "move", 41, 30,
             "dir", DOWN, 0,
             "wait", 2, 0,
             "move", 33, 32,
             "dir", DOWN, 0,
             "wait", 10, 0;
    initialmove;
    initnpctimer;
}