summaryrefslogtreecommitdiff
path: root/npc/003-0/priest.txt
blob: 958c9d710419eaa45766a69ea797e6f023e4bffd (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
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Leader of the PRIEST class

003-0,58,30,0	script	Priest Master	NPC_PLAYER,{
    /*
    if (!is_staff())
        goto L_Close;
    */
    if (!(MAGIC_SUBCLASS & CL_PRIEST))
        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 Priest 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_PRIEST;
    mesn;
    mesq l("Welcome to the Priest 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
// Priest
// AL_HOLYLIGHT (standard holy magic attack - 125% of MATK)
// MG_SRECOVERY (small increase to SP Recovery while idle each 10 sec.)
// ALL_RESURRECTION (Revive at 10% HP. May insta-kill undead. Max Level 3~4)
// PR_ASPERSIO (Change anyone weapon to holy for 60s. Or 40 defense-disregard holy dmg to undead/evil)
// TF_DETOXIFY (cancels poison. 40% MP.)

L_Member:
    mesn;
    mesq l("Hey there! Do you want to learn new skills for a very small teaching fee?");
    select
        rif(sk_intcost(AL_HOLYLIGHT) && !getskilllv(AL_HOLYLIGHT), l("Learn Holy Light")),
        rif(sk_intcost(TF_DETOXIFY) && !getskilllv(TF_DETOXIFY), l("Learn Detoxify")),
        rif(sk_intcost(ALL_RESURRECTION) && getskilllv(ALL_RESURRECTION) < (1+degree_subclass()/2), l("Learn Ressurection")),
        rif(sk_intcost(MG_SRECOVERY) && sk_canlvup(MG_SRECOVERY), l("Improve Mana Recovery")),
        rif(sk_intcost(PR_ASPERSIO) && sk_canlvup(PR_ASPERSIO), l("Improve Blessed Weapon")),
        rif(sk_intcost(AB_HIGHNESSHEAL) && sk_canlvup(AB_HIGHNESSHEAL), l("Improve Luma")),
        l("Leave Subclass"),
        l("Nothing at the moment.");
    mes "";
    switch (@menu) {
        case 1:
            mesc l("[Holy Light]");
            mesc l("The basic magic attack from a Priest. No effect against Holy Monsters.");
            mes "";
            mesn;
            mesq l("This useful skill will only require:");
            mesc l("@@/@@ @@", countitem(MoubooFigurine),   (getskilllv(AL_HOLYLIGHT)+1)*3,  getitemlink(MoubooFigurine));
            mesc l("@@/@@ @@", countitem(GemPowder),        (getskilllv(AL_HOLYLIGHT)+1)*1,  getitemlink(GemPowder));
            next;
            if (askyesno() == ASK_YES) {
                if (
                    countitem(MoubooFigurine)    < (getskilllv(AL_HOLYLIGHT)+1)*3 ||
                    countitem(GemPowder)         < (getskilllv(AL_HOLYLIGHT)+1)*1) goto L_Missing;

                delitem MoubooFigurine,      (getskilllv(AL_HOLYLIGHT)+1)*3;
                delitem GemPowder,           (getskilllv(AL_HOLYLIGHT)+1)*1;

                sk_lvup(AL_HOLYLIGHT);

                next;
            }
            break;
        case 2:
            mesc l("[Detoxify]");
            mesc l("Cancels Poison. Antidotes are hard to come by, anyway.");
            mes "";
            mesn;
            mesq l("This useful skill will only require:");
            mesc l("@@/@@ @@", countitem(Candy),         (getskilllv(TF_DETOXIFY)+1)*70, getitemlink(Candy));
            mesc l("@@/@@ @@", countitem(Root),          (getskilllv(TF_DETOXIFY)+1)*10, getitemlink(Root));
            mesc l("@@/@@ @@", countitem(Mashmallow),    (getskilllv(TF_DETOXIFY)+1)*2,  getitemlink(Mashmallow));
            mesc l("@@/@@ @@", countitem(FluoPowder),    (getskilllv(TF_DETOXIFY)+1)*1,  getitemlink(FluoPowder));
            next;
            if (askyesno() == ASK_YES) {
                if (
                    countitem(Candy)            < (getskilllv(TF_DETOXIFY)+1)*70 ||
                    countitem(Root)             < (getskilllv(TF_DETOXIFY)+1)*10 ||
                    countitem(Mashmallow)       < (getskilllv(TF_DETOXIFY)+1)*2 ||
                    countitem(FluoPowder)       < (getskilllv(TF_DETOXIFY)+1)*1) goto L_Missing;

                delitem Candy,          (getskilllv(TF_DETOXIFY)+1)*70;
                delitem Root,           (getskilllv(TF_DETOXIFY)+1)*10;
                delitem Mashmallow,     (getskilllv(TF_DETOXIFY)+1)*2;
                delitem FluoPowder,     (getskilllv(TF_DETOXIFY)+1)*1;

                sk_lvup(TF_DETOXIFY);

                next;
            }
            break;
        case 3:
            mesc l("[Ressurection]");
            mesc l("Raise fallen party members so they can keep fighting.");
            mes "";
            mesn;
            mesq l("This useful skill will only require:");
            mesc l("@@/@@ @@", countitem(Acorn),            (getskilllv(ALL_RESURRECTION)+1)*60, getitemlink(Acorn));
            mesc l("@@/@@ @@", countitem(Bread),            (getskilllv(ALL_RESURRECTION)+1)*20, getitemlink(Bread));
            mesc l("@@/@@ @@", countitem(SmallMushroom),    (getskilllv(ALL_RESURRECTION)+1)*20, getitemlink(SmallMushroom));
            mesc l("@@/@@ @@", countitem(PinkBlobime),      (getskilllv(ALL_RESURRECTION)+1)*15,  getitemlink(PinkBlobime));
            mesc l("@@/@@ @@", countitem(Pearl),            (getskilllv(ALL_RESURRECTION)+1)*2,  getitemlink(Pearl));
            next;
            if (askyesno() == ASK_YES) {
                if (
                    countitem(Acorn)         < (getskilllv(ALL_RESURRECTION)+1)*60 ||
                    countitem(Bread)         < (getskilllv(ALL_RESURRECTION)+1)*20 ||
                    countitem(SmallMushroom) < (getskilllv(ALL_RESURRECTION)+1)*15 ||
                    countitem(PinkBlobime)   < (getskilllv(ALL_RESURRECTION)+1)*20 ||
                    countitem(Pearl)         < (getskilllv(ALL_RESURRECTION)+1)*2) goto L_Missing;

                delitem Acorn,          (getskilllv(ALL_RESURRECTION)+1)*60;
                delitem Bread,          (getskilllv(ALL_RESURRECTION)+1)*20;
                delitem SmallMushroom,  (getskilllv(ALL_RESURRECTION)+1)*20;
                delitem PinkBlobime,    (getskilllv(ALL_RESURRECTION)+1)*15;
                delitem Pearl,          (getskilllv(ALL_RESURRECTION)+1)*2;

                sk_lvup(ALL_RESURRECTION);

                next;
            }
            break;
        case 4:
            mesc l("[MP Regen]");
            mesc l("Heals more mana while standing.");
            mes "";
            mesn;
            mesq l("This useful skill will only require:");
            mesc l("@@/@@ @@", countitem(Acorn),         (getskilllv(MG_SRECOVERY)+1)*70, getitemlink(Acorn));
            mesc l("@@/@@ @@", countitem(Root),          (getskilllv(MG_SRECOVERY)+1)*10, getitemlink(Root));
            mesc l("@@/@@ @@", countitem(FrozenYetiTear),(getskilllv(MG_SRECOVERY)+1)*2,  getitemlink(FrozenYetiTear));
            mesc l("@@/@@ @@", countitem(FluoPowder),    (getskilllv(MG_SRECOVERY)+1)*1,  getitemlink(FluoPowder));
            next;
            if (askyesno() == ASK_YES) {
                if (
                    countitem(Acorn)            < (getskilllv(MG_SRECOVERY)+1)*70 ||
                    countitem(Root)             < (getskilllv(MG_SRECOVERY)+1)*10 ||
                    countitem(FrozenYetiTear)   < (getskilllv(MG_SRECOVERY)+1)*2 ||
                    countitem(FluoPowder)       < (getskilllv(MG_SRECOVERY)+1)*1) goto L_Missing;

                delitem Acorn,          (getskilllv(MG_SRECOVERY)+1)*70;
                delitem Root,           (getskilllv(MG_SRECOVERY)+1)*10;
                delitem FrozenYetiTear, (getskilllv(MG_SRECOVERY)+1)*2;
                delitem FluoPowder,     (getskilllv(MG_SRECOVERY)+1)*1;

                sk_lvup(MG_SRECOVERY);

                next;
            }
            break;
        case 5:
            mesc l("[Bless Weapon]");
            mesc l("Changes anyone's weapon to Holy elemental. Causes small damage when used on offensive.");
            mes "";
            mesn;
            mesq l("This useful skill will only require:");
            mesc l("@@/@@ @@", countitem(Acorn),         (getskilllv(PR_ASPERSIO)+1)*70, getitemlink(Acorn));
            mesc l("@@/@@ @@", countitem(Root),          (getskilllv(PR_ASPERSIO)+1)*10, getitemlink(Root));
            mesc l("@@/@@ @@", countitem(FrozenYetiTear),(getskilllv(PR_ASPERSIO)+1)*2,  getitemlink(FrozenYetiTear));
            mesc l("@@/@@ @@", countitem(FluoPowder),    (getskilllv(PR_ASPERSIO)+1)*1,  getitemlink(FluoPowder));
            next;
            if (askyesno() == ASK_YES) {
                if (
                    countitem(Acorn)            < (getskilllv(PR_ASPERSIO)+1)*70 ||
                    countitem(Root)             < (getskilllv(PR_ASPERSIO)+1)*10 ||
                    countitem(FrozenYetiTear)   < (getskilllv(PR_ASPERSIO)+1)*2 ||
                    countitem(FluoPowder)       < (getskilllv(PR_ASPERSIO)+1)*1) goto L_Missing;

                delitem Acorn,          (getskilllv(PR_ASPERSIO)+1)*70;
                delitem Root,           (getskilllv(PR_ASPERSIO)+1)*10;
                delitem FrozenYetiTear, (getskilllv(PR_ASPERSIO)+1)*2;
                delitem FluoPowder,     (getskilllv(PR_ASPERSIO)+1)*1;

                sk_lvup(PR_ASPERSIO);

                next;
            }
            break;
        case 6:
            mesc l("[Luma]");
            mesc l("More powerful version of healing. Requires @@ each cast.", getitemlink(Lifestone));
            mes "";
            mesn;
            mesq l("This useful skill will only require:");
            mesc l("@@/@@ @@", countitem(Lifestone),         (getskilllv(AB_HIGHNESSHEAL)+1)*70, getitemlink(Lifestone));
            mesc l("@@/@@ @@", countitem(Root),          (getskilllv(AB_HIGHNESSHEAL)+1)*10, getitemlink(Root));
            mesc l("@@/@@ @@", countitem(FrozenYetiTear),(getskilllv(AB_HIGHNESSHEAL)+1)*2,  getitemlink(FrozenYetiTear));
            mesc l("@@/@@ @@", countitem(FluoPowder),    (getskilllv(AB_HIGHNESSHEAL)+1)*1,  getitemlink(FluoPowder));
            next;
            if (askyesno() == ASK_YES) {
                if (
                    countitem(Lifestone)            < (getskilllv(AB_HIGHNESSHEAL)+1)*70 ||
                    countitem(Root)             < (getskilllv(AB_HIGHNESSHEAL)+1)*10 ||
                    countitem(FrozenYetiTear)   < (getskilllv(AB_HIGHNESSHEAL)+1)*2 ||
                    countitem(FluoPowder)       < (getskilllv(AB_HIGHNESSHEAL)+1)*1) goto L_Missing;

                delitem Lifestone,          (getskilllv(AB_HIGHNESSHEAL)+1)*70;
                delitem Root,           (getskilllv(AB_HIGHNESSHEAL)+1)*10;
                delitem FrozenYetiTear, (getskilllv(AB_HIGHNESSHEAL)+1)*2;
                delitem FluoPowder,     (getskilllv(AB_HIGHNESSHEAL)+1)*1;

                sk_lvup(AB_HIGHNESSHEAL);

                next;
            }
            break;
        case 7:
            // 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 AL_HOLYLIGHT, 0, 0;
                    skill TF_DETOXIFY, 0, 0;
                    skill ALL_RESURRECTION, 0, 0;
                    skill MG_SRECOVERY, 0, 0;
                    skill PR_ASPERSIO, 0, 0;
                    MAGIC_SUBCLASS=MAGIC_SUBCLASS^CL_PRIEST;
                    mesc l("You abandoned the PRIEST 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, WarlordHelmet); // TODO: wizard hat
    setunitdata(.@npcId, UDT_HEADMIDDLE, SorcererRobe);
    setunitdata(.@npcId, UDT_HEADBOTTOM, NPCEyes);
    setunitdata(.@npcId, UDT_WEAPON, JeansChaps);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 2);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 4);

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