summaryrefslogtreecommitdiff
path: root/npc/003-0/wizard.txt
blob: 7bfc5e26673b9d8d7a95497116846799c19b6bd5 (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
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Leader of the WIZARD class
//    TODO: Improve Fireball

003-0,55,25,0	script	Wizard Master	NPC_PLAYER,{
    if (!(MAGIC_SUBCLASS & CL_WIZARD))
        goto L_SignUp;
    goto L_Member;

// Sign Up
L_SignUp:
    // Not allowed if subclass filled or not from main class
    if (total_subclass() >= max_subclass() || getskilllv(WIZARD_MAGE) < 2)
        goto L_Close;
    mesn;
    mesq l("Hey there! Do you want to join the Wizard Class?");
    mesc l("Warning: If you join a subclass, you can't leave it later!"), 1;
    mesc b(l("Warning: This class haven't been tested/balanced yet. Feedback is required!")), 1;
    next;
    if (askyesno() != ASK_YES)
        close;
    // TODO: Requeriment for signing up to a subclass? Or is the tier + skill quest hard enough?
    MAGIC_SUBCLASS=MAGIC_SUBCLASS|CL_WIZARD;
    mesn;
    mesq l("Welcome to the wizard guild!");
    close;

// Close
L_Close:
    goodbye;
    closedialog;
    close;

L_Missing:
    mesn;
    mesq l("Hey hey! You don't have that stuff, CAN'T YOU READ?!");
    percentheal 0, -10;
    next;
    goto L_Member;

// Membership area
// Wizard
//  MG_COLDBOLT (ice)
//  MG_LIGHTNINGBOLT (wind)
//  WZ_EARTHSPIKE (earth)
//  MG_NAPALMBEAT (ghost)
//  MG_ENERGYCOAT (For 5 minutes, raise damage reduction, but that eats MP)
// TODO: We have many other cool skills for Wizard (more AoE skills, more damage, etc)
// I will worry with that later, as that also means providing extra skills for Sage & Priest
// Note: the number of hits of bolts is the same as the skill level :D

L_Member:
    mesn;
    mesq l("Hey there! Do you want to learn new skills for a very small teaching fee?");
    select
        rif(sk_intcost(MG_ENERGYCOAT) && !getskilllv(MG_ENERGYCOAT), l("Learn Energy Coating")),
        rif(sk_intcost(MG_NAPALMBEAT) && sk_canlvup(MG_NAPALMBEAT), l("Improve Napalm Beat")),
        rif(sk_intcost(MG_COLDBOLT) && sk_canlvup(MG_COLDBOLT), l("Improve Cold Bolt")),
        rif(sk_intcost(MG_LIGHTNINGBOLT) && sk_canlvup(MG_LIGHTNINGBOLT), l("Improve Thunder Bolt")),
        rif(sk_intcost(WZ_EARTHSPIKE) && sk_canlvup(WZ_EARTHSPIKE), l("Improve Earth Spike")),
        rif(sk_intcost(MG_FIREBOLT) && sk_canlvup(MG_FIREBOLT), l("Improve Fire Bolt")),
        rif(sk_intcost(MG_FIREBALL) && getskilllv(MG_FIREBALL) < (3+degree_subclass()), l("Improve Fire Ball")),
        l("Leave Subclass"),
        l("Nothing at the moment.");
    mes "";
    switch (@menu) {
        case 1:
            mesc l("[Energy Coating]");
            mesc l("Drains Mana to reduce damage taken. The only defensive skill from wizards.");
            mes "";
            mesn;
            mesq l("This useful skill will only require:");
            mesc l("@@/@@ @@", countitem(Tentacles),        (getskilllv(MG_ENERGYCOAT)+1)*10, getitemlink(Tentacles));
            mesc l("@@/@@ @@", countitem(MushroomSpores),   (getskilllv(MG_ENERGYCOAT)+1)*5,  getitemlink(MushroomSpores));
            mesc l("@@/@@ @@", countitem(WolvernTooth),     (getskilllv(MG_ENERGYCOAT)+1)*3,  getitemlink(WolvernTooth));
            mesc l("@@/@@ @@", countitem(RedScorpionClaw),  (getskilllv(MG_ENERGYCOAT)+1)*1,  getitemlink(RedScorpionClaw));
            next;
            if (askyesno() == ASK_YES) {
                if (
                    countitem(Tentacles)         < (getskilllv(MG_ENERGYCOAT)+1)*10 ||
                    countitem(MushroomSpores)    < (getskilllv(MG_ENERGYCOAT)+1)*5 ||
                    countitem(WolvernTooth)      < (getskilllv(MG_ENERGYCOAT)+1)*3 ||
                    countitem(RedScorpionClaw)   < (getskilllv(MG_ENERGYCOAT)+1)*1) goto L_Missing;

                delitem Tentacles,           (getskilllv(MG_ENERGYCOAT)+1)*10;
                delitem MushroomSpores,      (getskilllv(MG_ENERGYCOAT)+1)*5;
                delitem WolvernTooth,        (getskilllv(MG_ENERGYCOAT)+1)*3;
                delitem RedScorpionClaw,     (getskilllv(MG_ENERGYCOAT)+1)*1;

                sk_lvup(MG_ENERGYCOAT);

                next;
            }
            break;
        case 2:
            mesc l("[Napalm Beat]");
            mesc l("Neutral attack with low damage value, but with high range and Effect Area.");
            //mesc l("Useful in PvP when your enemy have equipped a @@", getitemlink(AstralCube));
            mes "";
            mesn;
            mesq l("This useful skill will only require:");
            mesc l("@@/@@ @@", countitem(Acorn),            (getskilllv(MG_NAPALMBEAT)+1)*60, getitemlink(Acorn));
            mesc l("@@/@@ @@", countitem(Bread),            (getskilllv(MG_NAPALMBEAT)+1)*30, getitemlink(Bread));
            mesc l("@@/@@ @@", countitem(SmallMushroom),    (getskilllv(MG_NAPALMBEAT)+1)*20, getitemlink(SmallMushroom));
            mesc l("@@/@@ @@", countitem(PinkBlobime),      (getskilllv(MG_NAPALMBEAT)+1)*20,  getitemlink(PinkBlobime));
            mesc l("@@/@@ @@", countitem(RedApple),         (getskilllv(MG_NAPALMBEAT)+1)*15,  getitemlink(RedApple));
            next;
            if (askyesno() == ASK_YES) {
                if (
                    countitem(Acorn)         < (getskilllv(MG_NAPALMBEAT)+1)*60 ||
                    countitem(Bread)         < (getskilllv(MG_NAPALMBEAT)+1)*30 ||
                    countitem(SmallMushroom) < (getskilllv(MG_NAPALMBEAT)+1)*20 ||
                    countitem(PinkBlobime)   < (getskilllv(MG_NAPALMBEAT)+1)*20 ||
                    countitem(RedApple)      < (getskilllv(MG_NAPALMBEAT)+1)*15) goto L_Missing;

                delitem Acorn,          (getskilllv(MG_NAPALMBEAT)+1)*60;
                delitem Bread,          (getskilllv(MG_NAPALMBEAT)+1)*30;
                delitem SmallMushroom,  (getskilllv(MG_NAPALMBEAT)+1)*20;
                delitem PinkBlobime,    (getskilllv(MG_NAPALMBEAT)+1)*20;
                delitem RedApple,       (getskilllv(MG_NAPALMBEAT)+1)*15;

                sk_lvup(MG_NAPALMBEAT);

                next;
            }
            break;
        // Magic Bolts
        case 3:
        case 4:
        case 5:
        case 6:
            setarray .@ASkill, MG_COLDBOLT, MG_LIGHTNINGBOLT, WZ_EARTHSPIKE, MG_FIREBOLT;
            setarray .@AItem, Coral, BatWing, PileOfAsh, Curshroom;
            setarray .@BItem, Sapphire, Emerald, Topaz, Ruby;
            setarray .@ASkill$, "Ice", "Wind", "Earth", "Fire";

            .@index=@menu-3;

            .@Skill$=.@ASkill$[.@index];
            .@Skill=.@ASkill[.@index];
            .@Item=.@AItem[.@index];
            .@ItemB=.@BItem[.@index];

        	deletearray(.@ASkill);
        	deletearray(.@AItem);
        	deletearray(.@BItem);
        	deletearray(.@ASkill$);

            mesc l("[@@ Bolt]", .@Skill$);
            mesc l("Causes a @@ bolt on the enemy. Number of hits is the skill level.", .@Skill$);
            mes "";
            mesn;
            mesq l("This useful skill will only require:");
            mesc l("@@/@@ @@", countitem(.@Item),       (getskilllv(.@Skill)+1)*30, getitemlink(.@Item));
            mesc l("@@/@@ @@", countitem(FluoPowder),   (getskilllv(.@Skill)+1)*8,  getitemlink(FluoPowder));
            mesc l("@@/@@ @@", countitem(HerbalTea),    (getskilllv(.@Skill)+1)*3, getitemlink(HerbalTea));
            mesc l("@@/@@ @@", countitem(DiamondPowder),(getskilllv(.@Skill)+1)*2,  getitemlink(DiamondPowder));
            mesc l("@@/@@ @@", countitem(.@ItemB),      (getskilllv(.@Skill)+1)*1,  getitemlink(.@ItemB));
            next;
            if (askyesno() == ASK_YES) {
                if (
                    countitem(.@Item)           < (getskilllv(.@Skill)+1)*30 ||
                    countitem(FluoPowder)       < (getskilllv(.@Skill)+1)*8 ||
                    countitem(HerbalTea)        < (getskilllv(.@Skill)+1)*3 ||
                    countitem(DiamondPowder)    < (getskilllv(.@Skill)+1)*2 ||
                    countitem(.@ItemB)          < (getskilllv(.@Skill)+1)*1) goto L_Missing;

                delitem .@Item,         (getskilllv(.@Skill)+1)*30;
                delitem FluoPowder,     (getskilllv(.@Skill)+1)*8;
                delitem HerbalTea,      (getskilllv(.@Skill)+1)*3;
                delitem DiamondPowder,  (getskilllv(.@Skill)+1)*2;
                delitem .@ItemB,        (getskilllv(.@Skill)+1)*1;

                sk_lvup(.@Skill);

                next;
            }
            break;
        case 7:
            mesc l("[Fire Ball]");
            mesc l("Standard fireball skill.");
            mes "";
            mesn;
            mesq l("This useful skill will only require:");
            mesc l("@@/@@ @@", countitem(Curshroom),        (getskilllv(MG_FIREBALL)+1)*10, getitemlink(Curshroom));
            mesc l("@@/@@ @@", countitem(SulfurPowder),     (getskilllv(MG_FIREBALL)+1)*10, getitemlink(SulfurPowder));
            mesc l("@@/@@ @@", countitem(FluoPowder),       (getskilllv(MG_FIREBALL)+1)*10, getitemlink(FluoPowder));
            mesc l("@@/@@ @@", countitem(PolishedRuby),     (getskilllv(MG_FIREBALL)+1)*3,  getitemlink(PolishedRuby));
            mesc l("@@/@@ @@", countitem(HerbalTea),        (getskilllv(MG_FIREBALL)+1)*1,  getitemlink(HerbalTea));
            next;
            if (askyesno() == ASK_YES) {
                if (
                    countitem(Curshroom)         < (getskilllv(MG_FIREBALL)+1)*10 ||
                    countitem(SulfurPowder)      < (getskilllv(MG_FIREBALL)+1)*10 ||
                    countitem(FluoPowder)        < (getskilllv(MG_FIREBALL)+1)*10 ||
                    countitem(PolishedRuby)      < (getskilllv(MG_FIREBALL)+1)*3 ||
                    countitem(HerbalTea)         < (getskilllv(MG_FIREBALL)+1)*1) goto L_Missing;

                delitem Curshroom,           (getskilllv(MG_FIREBALL)+1)*10;
                delitem SulfurPowder,        (getskilllv(MG_FIREBALL)+1)*10;
                delitem FluoPowder,          (getskilllv(MG_FIREBALL)+1)*10;
                delitem PolishedRuby,        (getskilllv(MG_FIREBALL)+1)*3;
                delitem HerbalTea,           (getskilllv(MG_FIREBALL)+1)*1;

                sk_lvup(MG_FIREBALL);

                next;
            }
            break;
        case 8:
            // All skills related may include the basic class skills if they're related.
            mesc l("WARNING: If you leave the subclass, you'll lose all skills related to it!"), 1;
            mesc l("This cannot be undone. Are you sure?"), 1;
            mes "";
            if (askyesno() == ASK_YES) {
                mes "";
                if (validatepin()) {
                    skill MG_ENERGYCOAT, 0, 0;
                    skill SA_DRAGONOLOGY, 0, 0;
                    skill MG_NAPALMBEAT, 0, 0;
                    skill MG_COLDBOLT, 0, 0;
                    skill MG_LIGHTNINGBOLT, 0, 0;
                    skill WZ_EARTHSPIKE, 0, 0;
                    skill MG_FIREBOLT, 0, 0;
                    MAGIC_SUBCLASS=MAGIC_SUBCLASS^CL_WIZARD;
                    mesc l("You abandoned the WIZARD class!"), 1;
                    close;
                } else {
                    mesc l("Failed to validate pin. Aborting.");
                    next;
                }
            } else {
                mes "";
                mesc l("Operation aborted. Phew!");
                next;
            }
            break;
        default:
            goto L_Close;
    }

    goto L_Member;

OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADTOP, FancyHat); // TODO: wizard hat
    setunitdata(.@npcId, UDT_HEADMIDDLE, SorcererRobe);
    setunitdata(.@npcId, UDT_HEADBOTTOM, NPCEyes);
    setunitdata(.@npcId, UDT_WEAPON, JeansShorts);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 2);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 5);

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