summaryrefslogtreecommitdiff
path: root/npc/014-5-1/sagratha.txt
blob: 35cef5faabd2d058956f98598759d7c0cd27e0f4 (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
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Sagratha (variables SAGRATHA_SCORE and SAGRATHA_FRIENDSHIP)

// SaggyScoreUpdate( amount )
function	script	SaggyScoreUpdate	{
    .@val=getarg(0);
    SAGRATHA_SCORE=max(-50, min(50, SAGRATHA_SCORE+.@val));
    return;
}

function	script	SaggyMobCount	{
    switch (killedrid) {
        // She gets angry
        case Mouboo:
        case AlphaMouboo:
            SaggyScoreUpdate(-5);
            break;
        case Pollet:
        case Fluffy:
        case IcedFluffy:
            SaggyScoreUpdate(-3);
            break;
        case PoisonSpikyMushroom:
        case LogHead:
        case ForestMushroom:
            SaggyScoreUpdate(-2);
            break;
        case Squirrel:
        case SpringSquirrel:
        case LofSquirrel:
        case FrozenSquirrel:
        case FairysSquirrel:
        case MananaTree:
            SaggyScoreUpdate(-1);
            break;

        // She may get happy. Who knows.
        case ViciousSquirrel:
        case WickedMushroom:
        case Bluepar:
        case BlackScorpion:
        case Bandit:
        case RobinBandit:
            SaggyScoreUpdate(any(0,0,0,0,1));
            break;
    }
    return;
}

014-5-1,33,37,0	script	Sagratha	NPC_SAGRATHA,{
    if (array_find(.SaggyHats, getequipid(EQI_HEAD_TOP)) >= 0)
        goto L_HatAttack;
    if (SAGRATHA_SCORE < 0)
        goto L_Unhappy;

    .@q=getq(HurnscaldQuest_Sagratha);
    .@m=getq(HurnscaldQuest_InjuriedMouboo);

    // Safety - Impossible Situation
    if (.@m < 2 || .@m > 3 || .@q < 6) {
        Exception("Player found cheating/breaking the rules. Character banned. Please contact GM Staff if you believe this is an error.", RB_DEFAULT|RB_SPEECH);
        atcommand "@jail 7h "+strcharinfo(0);
        close;
    }

    mesn;

    if (SAGRATHA_FRIENDSHIP >= 2)
        mesc l("@@ nods as she notices you.", .name$);
    else if (SAGRATHA_FRIENDSHIP == 1)
        mesc l("@@ raises an eyebrow as you address her.", .name$);
    else
        mesc l("@@ glances at you, suspicion evident in her eyes.", .name$);

    mesq l("Hello.");
    next;

    if (.@m == 2 && .@q == 6)
        goto L_Reward;
    if (.@q == 6)
        goto L_Finish;

    do
    {
        select
            l("Can I return to the shrine?"),
            l("I would like some Mouboo Milk."),
            l("Good bye.");
        mes "";
        switch (@menu) {
        // XXX: Sealed Shrine
        case 1:
            mesn;
            mesq l("Why would you want to go back there?");
            mesc l("@@ snarls.", .name$);
            next;
            mesn;
            mesq l("That was a Moubootaur's temple. It is not the kind of place to give a stroll on the park.");
            next;
            mesn;
            mesq l("Did you noticed how no monster got close to it?");
            next;
            select
                l("You're right. Sorry."),
                l("Don't worry, I'll stay at the caves."),
                l("I want to pay my respects as a fellow Pink Mouboo cult member."),
                l("But I need to!");
            mes "";
            if (@menu == 3) {
                mesn;
                mesq l("As a what?");
                next;
            }
            else if (@menu == 4) {
                mesn;
                mesq l("No you don't. Don't disturb the forest for no reason.");
                close;
            }
            else if (@menu == 1) {
                mesn;
                mesq l("Hmpf. Wise choice.");
                next;
                break; // Return to the while loop
            }
            mesn;
            mesq l("As you wish. But do not mess with things you don't understand.");
            next;
            closeclientdialog;
            warp "015-8", 99, 178;
            close;
        // XXX: Mouboo Milk
        case 2:
            if (SAGRATHA_SCORE < 50) {
                mesn;
                mesq l("You don't need, nor deserve it.");
                next;
                mesn;
                mesq l("Learn milking a Mouboo. And if you harm them, I'll cast a lightning bolt at you!");
                next;
                break;
            }
            if (SAGRATHA_MILK > gettimeparam(GETTIME_HOUR)) {
                mesn;
                mesq l("I just gave you it. Come back later.");
                next;
                break;
            }
            inventoryplace Milk, 2;
            SAGRATHA_SCORE-=8; // :o
            SAGRATHA_MILK=gettimeparam(GETTIME_HOUR)+4;
            getitem Milk, 2;
            mesn;
            mesq l("Here. You know that milking Mouboos won't cause them harm, right? It's a different story with @@.", getitemlink(MoubooSteak));
            close;
            break;
        default:
            close;
        }
        // TODO: Learn Magic
        // TODO: Request help with stuff (eg. protecting mouboos?)
    } while (true);

    close;

L_Finish:
    // WHAT
    if (.@m != 3) {
        Exception("Player found cheating/breaking the rules. Character banned. Please contact GM Staff if you believe this is an error.", RB_DEFAULT|RB_SPEECH);
        atcommand "@jail 7h "+strcharinfo(0);
        close;
    }
    mesn;
    mesq l("I haven't thanked you yet.");
    next;
    select
        l("You're welcome."),
        l("For the rescue? You didn't seemed to be in need of aid."),
        l("Yes, I'm awesome, praise me more."),
        l("For the mouboo? I was only doing my duty.");
    mes "";
    mesn;
    if (@menu != 4)
        mesq l("Not for that! For helping out the injuried mouboo, of course.");
    else
        mesq l("Hmpf, it's good to see you're at least trying to follow Wyara's example.");
    next;
    mesn;
    mesq l("Anyway, Wyara told me about the assassins. I'm surprised they followed me until the ruins.");
    next;
    mesn;
    mesq l("I thought I would be safe in the shrine, but seems like they are after the Moubootaur. Great danger will befall all forest creatures if they accomplish that.");
    next;
    mesn;
    mesq l("This will affect humans, too, so don't act as if it is not your bussiness either.");
    next;
    mesn;
    mesq l("For now, take this @@. I hope that you will use this power for something good now.", getitemlink(AlchemyBlueprintB));
    inventoryplace AlchemyBlueprintB, 1;
    getitem AlchemyBlueprintB, 1;
    getexp 24000, 0; // ~70% from level 40 (quest estimate level)
    Zeny+=3000; // About 50 carps sold
    SAGRATHA_FRIENDSHIP+=1;
    setq HurnscaldQuest_Sagratha, 7;
    close;

L_Reward:
    select
        l("Hi! My name is @@.", strcharinfo(0)),
        l("Are you Sagratha?"),
        l("Good bye.");
    mes "";
    if (@menu == 3)
        close;
    if (@menu == 1) {
        mesn;
        mesq l("Ah.");
        next;
        select
            l("Are you Sagratha?"),
            l("Erm... Good bye.");
        mes "";
        if (@menu == 2)
            close;
    }
    mesn;
    mesq l("Yes.");
    next;
    mesn;
    mesq l("Do you need something from me?");
    next;
    // A check is not needed, because quest pre-requisites
    // If you don't have the quest in clearable state... CHEAT!
    select
        l("Yep. There was a cursed mouboo on the road."),
        l("Not really.");
    mes "";
    if (@menu == 2) {
        mesn;
        mesq l("Okay then.");
        close;
    }
    mesn;
    mesq l("Yes, the cursed Mouboo you told me earlier, on the way out.");
    next;
    mesn;
    mesq l("The curse was done by nobody less than... the Moubootaur.");
    next;
    mesn;
    mesq l("Well. I'll take care of that, don't worry with that.");
    next;
    mesn;
    mesq l("It's my duty to protect the beings in the forest... Not all of them are monsters as @@s like you think.", get_race());
    compareandsetq HurnscaldQuest_InjuriedMouboo, 3;
    SAGRATHA_FRIENDSHIP+=1;
    close;

L_HatAttack:
    mesn;
    mesc l("@@ seems to be trembling with disgust as she stares at your headgear.", .name$);
    next;
    mesn;
    mesq l("Do you think that is funny?");
    mesc l("@@ snarls.", .name$);
    next;
    mesn;
    mesq l("You have no idea what that poor creature felt!");
    next;
    mesn;
    mesc l("She snaps her fingers.");
    mesq l("Let me show you...");
    specialeffect 312, SELF, getcharid(3);
    percentheal -30, 0;
    close;

L_Unhappy:
    mesn;
    mesc l("@@ glares at you in anger.", .name$);
    mesq l("I wonder if you can still sleep after killing those innocent forest creatures!");
    next;
    mesn;
    mesq l("I am sure that they will come back to haunt you in your dreams!");
    close;

OnInit:
    setarray .SaggyHats, FluffyHat, MoubooHat, AlphaMoubooHat;

    .distance=5;
    npcsit;
    end;

OnInstanceInit:
    disablenpc instance_npcname(.name$);
    end;
}