summaryrefslogtreecommitdiff
path: root/npc/019-1/well.txt
blob: f77e64bde75315f7817beb9e06304b966ce6eb1f (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
// TMW2/LOF Script.
// Author:
//    Jesusalva
// Description:
//  Better to skip this quest. It is too poor and would require more work,
//  eg. rope and something to make the player take part on it... Probably?
//  TODO: We could also throw random stuff (dig script), and use makeitem() to
//  make it pop at Terranite Cave, near the lake, suggesting that's where the water
//  comes from.
//  TODO: Yeti related to Angela quest. Ever-cicle logic - sep 11st.
//        Friendly, safe because water on Terranite Cave is too cold, but aware of
//        Terranite.

019-1,110,101,0	script	Well#Nivalis	NPC_NO_SPRITE,{
    // Begin here
    .@q=getq(NivalisQuest_Well);
    mesn l("The Self-Serving Ice Well!");
    mesc l("Hello, my name is Mahid, and this well belongs to me!");
    mesc l("You are allowed to fill your bottles, but BE SURE TO PAY!");
    mesc l("Otherwise, ##BYOU'LL DIE.##b Have a nice day!");
    next;
    if (.@q == 1) {
        mesn l("???");
        mesq l("Hey, is somebody over there?");
        mes "";
    }

    menu
        l("Fill Water Bottles"), L_Bottle,
        rif(.@q == 2, l("Jump inside!")), L_Reckless,
        rif(.@q == 1, l("Steal bucket!")), L_Bucket,
        rif(.@q != 1, l("Throw something inside!")), L_Throw,
        l("Leave."), -;
    close;

// Jump to Terranite Cave (requires 55 vitality minimum)
L_Reckless:
    closedialog;
    warp "015-6", 363, 109;
    percentheal -155+readparam(bVit), 0;
    dispbottom l("Ouch! That was kinda reckless!");
    close;

// Easter Egg
L_Bucket:
    mes "";
    percentheal -rand(10,20), 0;
    mesn strcharinfo(0);
    mesq l("Ouch, the bucket BITE me!");
    close;

// Main Quest
L_Throw:
        mes "##B" + l("Drag and drop an item from your inventory.") + "##b";

        .@id = requestitem();

        // If ID is invalid, there's not enough items, it is bound = Cannot bury
        if (.@id < 1) {
            mesc l("You give up.");
            close;
        }
        if (countitem(.@id) < 1 || checkbound(.@id) || !getiteminfo(.@id, ITEMINFO_MAXCHANCE)) {
            if (checkbound(.@id))
                mesc l("You cannot drop this item!");
            else if (!getiteminfo(.@id, ITEMINFO_MAXCHANCE))
                mesc l("This item is too precious, you cannot part with it!");
            else
                mesc l("You give up.");
            close;
        }
        // Delete item and spawn it at Terranite Cave (an Angry Yellow Slime might steal it)
        delitem .@id, 1;
        makeitem .@id, 1, "015-6", any(362,363), any(110, 112, 114);
        // Now we check if quest must start
        if (!.@q)
            goto L_Quest;
    close;

// Quest Node
L_Quest:
    mesn l("???");
    if (getiteminfo(.@id, ITEMINFO_WEIGHT) > 1000)
        mesq l("Ouch! That's heavy!");
    else if (getiteminfo(.@id, ITEMINFO_SELLPRICE) < 10)
        mesq l("What cheap crap is this? It's not worth even 10 GP.");
    else if (getiteminfo(.@id, ITEMINFO_TYPE) == IT_HEALING)
        mesq l("Mhm, this looks healthy.");
    else if (getiteminfo(.@id, ITEMINFO_TYPE) == IT_AMMO)
        mesq l("Ammo? I prefer power gloves! That is useless for me!");
    else
        mesq l("Who is throwing stuff at me?!");
    next;
    select
        l("Who are you?"),
        l("How did you get down there?"),
        l("Do you need help?"),
        menuaction(l("Leave."));
    mes "";
    mesn;
    switch (@menu) {
        case 1: mesq l("I'll talk about who I am after leaving the well."); break;
        case 2: mesq l("I don't remember. I guess somebody threw me here!"); break;
        case 3: mesq l("I certainly can't get out on my own."); break;
        default: mesq l("..Anyone there?"); close; break;
    }
    next;
    do {
        select
            l("I'll call someone to aid you."),
            l("Is it too deep?"),
            l("Couldn't you climb the rope?"),
            menuaction(l("Leave."));
        mes "";
        mesn;
        switch (@menu) {
            case 1: mesq l("Please do, my friend."); setq NivalisQuest_Well, 1; break;
            case 2: mesq l("It's over a hundred meters in depth. There is some land here, but I'm afraid of Terranite."); break;
            case 3: mesq l("I'm not crazy, the bucket is vicious and the rope won't withstand my weight."); break;
            default: mesq l("..Anyone there?"); close; break;
        }
    } while (@menu != 1);
    close;

// Fill a water bottle
L_Bottle:
    mes "";
    mesc l("Cost: @@ gp per bottle.", .price);
    input .@count;

    if (!.@count)
        close;

    .@gp = .@count * .price;

    if (Zeny < .@gp) {
        mesc l("Not enough money.");
        close;
    }

    if (countitem(EmptyBottle) < .@count) {
        mesc l("Not enough bottles.");
        close;
    }

    inventoryplace IcedBottle, .@count, BottleOfWoodlandWater, .@count;

    // Calculate how many iced bottles you'll get
    .@iced=0;
    for (.@i=0; .@i < .@count; .@i++) {
        if (rand(1,1000) < 11)
            .@iced++;
    }

    // Apply the results and have a happy day!
    Zeny-=.@gp;
    if (.@iced)
        getitem IcedBottle, .@iced;
    getitem BottleOfWoodlandWater, .@count-.@iced;
    close;

OnInit:
    .sex = G_OTHER;
    .distance = 3;

    .price=60;
    end;
}