summaryrefslogtreecommitdiff
path: root/world/map/npc/012-3/mana-seed.txt
blob: c75125e4de7662ab48526f18383d09d786479fd0 (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
012-3,62,130,0|script|Forest Mana Seed#_M|166
{
    setarray @magic_exp_needed,
        0, // level 0
        0,
        100,
        1200,
        8000,
        40000; // level 5

    setarray @exp_bonus,
        0,
        1000, // level 1
        10000,
        100000,
        400000,
        2000000; // level 5

    setarray @min_level,
        0,
        10,
        30,
        50,
        65,
        80; // level 5

    set @visions_nr, 12;
    setarray @visions$,
        "You see a dark underground temple; you are kneeling, praying for the safety of the planet. You smile as a friend joins you in the dark – but suddenly a shadow falls over you from above, and a stabbing pain...",
        "It is midnight; you are in an underground cavern deep inside the desert ruins. Slowly, as if half-asleep, you wander up the spiral pathway, towards the ancient vase at its center. As you reach out to touch it...",
        "The old castle smells of mildew and swamp gas. It has not been used in centuries, but you were here before, when the world was young. You turn to face your companions – but something is wrong with all three; an ancient force has possessed them...",
        "As you put the horn to your lips, you feel winds flowing, gathering, condensing in your chest. Soon, you can no longer contain it; the storm unleashes through your mouth, into a deafening fanfare. The black dome around you begins to crack...",
        "You are alone inside your head, confined by the laughing man's circlet. Powerless, you witness how your hands shoot out flame after flame, incinerating innocents for that man's experiments...",
        "The village may be in ruins, but it must have been where you grew up. The engravings on the walls – images of powerful beasts – look strangely familiar, and you can make out writing, words about you, wishes and prayers for you... You are at home...",
        "Deep underneath the city, the rocky cavern maze turns into an opulent palace. This must be where the beast of the many eyes resides. Nervously you grip the wand; will the power to repel it be sufficient to defeat it and its magic?",
        "At the bottom of the abyss, infinity opens before you. You have proven yourself worthy, and the ancient finally reveals its wisdom...",
        "You may only be children, but you recognize that it is this man only who can save the world. As the walls rush towards you to crush your small group, you exchange a glance with your twin sister – there is no doubt what you must do...",
        "The sacred place is surrounded by nothingness; were it not for your magic, you would have no hope of returning. The old and young man stands nearby; he has been waiting for you, for centuries. He has all the time in the world, after all...",
        "Nothing remains behind. The underground castle is empty now, its chambers plundered, its throne destroyed. Shivering, you climb down the stairs, towards the wailing of the underworld that is waiting beneath...",
        "You feel soft, fluffy fur brushing against your skin and are filled with happiness. Somehow, the word `" + get(.invocation$, "happy-curse") + "' comes to mind...";

    set @max_magic, 2;

    set @has_magic, getskilllv(SKILL_MAGIC);
    set @drank_potion, MAGIC_FLAGS & MFLAG_DRANK_POTION;
    set @knows_seed, MAGIC_FLAGS & MFLAG_KNOWS_MANASEED;

    // Set up SkillUp function
    set @SUP_id, SKILL_MAGIC;
    set @SUP_name$, "Magic";

    if (@has_magic)
        goto L_magic_start;
    if (@knows_seed)
        goto L_quick_nomagic;

    // first time here

    set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_MANASEED;

    mes "[Mana Seed]";
    mes "You see a glowing orb, swimming in the water like a sea rose.";
    mes "An unearthly glow is emanating from within, lighting up the water and filling the cave with an eerie light.";
    next;
    mes "[Mana Seed]";
    if (@drank_potion)
        mes "Slowly, the tingling sensation you felt before begins to spread through your body again.";
    mes "What would you like to do?";
    next;
    goto L_nomagic_mainmenu;

L_quick_nomagic:
    mes "[Mana Seed]";
    mes "Again you stand before the orb.";
    if (@drank_potion)
        mes "Slowly, the tingling sensation you felt before begins to spread through your body again.";
    mes "What would you like to do?";
    next;
    goto L_nomagic_mainmenu;

// Non-Magic main menu ------------------------------------------------------------
L_nomagic_mainmenu:
    menu
        "Examine it more closely", L_nomagic_examine,
        "Take it with you", L_nomagic_touch,
        "Touch it", L_nomagic_touch,
        "Throw a rock at it", L_nomagic_throwrock,
        "Destroy it", L_nomagic_destroy,
        "Leave it alone", L_end;

L_nomagic_examine:
    mes "[Mana Seed]";
    mes "The orb seems to be perfectly round and emitting a steady glow. It appears to be floating in the water.";
    next;
    goto L_nomagic_mainmenu;

L_nomagic_throwrock:
    mes "[Mana Seed]";
    mes "Your rock makes hardly a sound as it strikes the orb and glances off into the water, leaving neither scratch nor impression.";
    mes "The orb budges slightly, but then floats back into its old position, as if it were tethered into place.";
    next;
    goto L_nomagic_mainmenu;

L_nomagic_touch:
    mes "[Mana Seed]";
    if (@drank_potion)
        goto L_magic_level_1;
    mes "As you touch the orb, you feel a terrible force within, separated from you by only the thinnest of membranes – like a tempest, all packed up in one tiny waterskin.";
    next;
    mes "[Mana Seed]";
    mes "For one instant you feel that force rushing past your hands, through your body, as if you had unleashed this tempest upon yourself. Unable to contain the power, you stumble backwards, away from the orb.";
    set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_TOUCHED_MANASEED;
    next;
    goto L_nomagic_mainmenu;

L_magic_level_1:
    if (getskilllv(SKILL_MAGIC))
        goto L_end; // shouldn't be happening
    mes "Again you feel the tempest rushing through the Mana Seed's membrane, into your body. You only manage to hold on to it for an instant and find yourself forced to pull your hands away again quickly.";
    next;
    mes "[Mana Seed]";
    mes "But this time something is different – that tingling sensation is back, and stronger than before. It is spreading through your body, head to toes, and you feel yourself brimming with energy.";
    next;
    mes "[Mana Seed]";
    mes "It is a light-headed feeling, and you find yourself forced to sit down for a few seconds to recover.";
    mes "Something is different. A new power has grown within you and is waiting to be understood.";
    set @SUP_xp, 1000;
    set @SUP_lvl, 1;
    callfunc "SkillUp";
    next;
    goto L_end;

L_nomagic_destroy:
    mes "[Mana Seed]";
    mes "Try as you might, the orb seems impervious to all forms of attack you can fathom. You are forced to abandon your efforts.";
    next;
    goto L_nomagic_mainmenu;

// Magic main menu ------------------------------------------------------------
L_magic_start:
    mes "[Mana Seed]";
    mes "The Mana Seed is still in the same place as during your last visit, spreading its light throughout the cavern.";
    mes "What would you like to do?";
    next;
    goto L_magic_mainmenu;

L_magic_mainmenu:
    menu
        "Touch it", L_magic_touch,
        "Destroy it", L_magic_destroy,
        "Leave it alone", L_end;

L_magic_touch:
    mes "[Mana Seed]";
    mes "You touch the Mana Seed again.";
    if (getskilllv(SKILL_MAGIC) >= @max_magic)
        goto L_magic_maxed_out;
    set @exp_needed, @magic_exp_needed[getskilllv(SKILL_MAGIC) + 1];
    set @magic_exp, MAGIC_EXPERIENCE & 65535;
    if (@magic_exp >= @exp_needed)
        goto L_magic_levelup;
    set @prev_exp_needed, @magic_exp_needed[getskilllv(SKILL_MAGIC)];
    set @exp_diff, @exp_needed - @prev_exp_needed;
    set @index, ((@magic_exp - @prev_exp_needed) * 5) / @exp_diff;
    setarray @messages$,
        "The orb's energy effortlessly rushes through you, ignoring your feeble attempts at containing it. You will need considerably more practice with your magical skills before you can hope to contain it.",
        "You only barely manage to hang on to some strands of the orb's energy, but not enough to contain it. You still need noticeably more practice with your magical skills.",
        "The orb's powers are still no match for you; you will need more practice to contain more of its powers.",
        "You feel close to being able to contain the orb's powers. Still, some more practice is needed.",
        "The orb's energy only barely evades your attempts at containing it. Soon you will be able to extract more power from it.";
    mes @messages$[@index];
    next;
    goto L_magic_mainmenu;

L_magic_levelup:
    set @baselevel_needed, @min_level[getskilllv(SKILL_MAGIC) + 1];
    if (BaseLevel < @baselevel_needed)
        goto L_ins_baselevel;
    mes "Its energy permeates you, surrounds you. You are suddenly uncertain if it is you who is containing the orb's powers or if it is the orb who is seeking out yours.";
    next;
    mes "[Mana Seed]";
    mes "The Seed's tempest is calming beneath your hands, and its energies resonate with yours.";
    next;
    mes "[Mana Seed]";
    mes "A feeling of harmony is spreading through your body, and the tingling sensation is back, within and without.";
    next;
    mes "[Mana Seed]";
    mes "As the tingling increases, you feel light-headed, weightless.";
    mes "Everything fades...";
    next;
    mes "Both the tingling and the sense of harmony have vanished, making room for darkness. You can't feel the Mana Seed anymore...";
    next;
    mes "... you can't feel anything.";
    next;
    mes "You are floating...";
    next;
    mes "The darkness is no longer complete. You begin to make out stars in the distance, circling each other, dancing a cosmic dance.";
    next;
    mes "Images rush past you, shadows of thoughts and dreams. Some touch you, filling you with powerful emotions – despair, ecstasy;  sometimes loss, sometimes hope; hate, love.";
    next;
    mes "Someone else's thoughts pass through your mind...";
    next;
    set @nr, rand(@visions_nr);
    mes @visions$[@nr];
    next;
    mes "The image fades.";
    next;
    mes "[Mana Seed]";
    mes "You awaken, lying on the ground.";
    next;
    mes "[Mana Seed]";
    mes "Something has changed... you feel more confident in your magical abilities.";
    set @SUP_xp, @exp_bonus[1 + getskilllv(SKILL_MAGIC)];
    set @SUP_lvl, 1 + getskilllv(SKILL_MAGIC);
    callfunc "SkillUp";
    heal 0, 10000, 1;
    next;
    goto L_end;

L_magic_maxed_out:
    mes "Strangely, you feel nothing, as if its membrane had closed towards you.";
    set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_MANASEED_MAXEDOUT;
    next;
    goto L_magic_mainmenu;

L_ins_baselevel:
    mes "Its energies rush through you. You fight to keep them under control, to contain them in your body. Alas, your body is too frail – you have to let go.";
    mes "Frustrated, you give up. You have the skill needed to control this power, but you will have to grow up some more before your body can handle it.";
    next;
    goto L_magic_mainmenu;

L_magic_destroy:
    mes "[Mana Seed]";
    mes "Try as you might, you cannot find a way, magical or physical, to destroy the seed. Frustrated, you give up.";
    next;
    goto L_magic_mainmenu;

L_end:
    close;
}