summaryrefslogtreecommitdiff
path: root/npc/magic/final.txt
blob: e7d92da335722944fca046464c625e2a36d030b5 (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
299
300
301
302
303
304
305
// TMW2 scripts.
// Authors:
//    Jesusalva
//    TMW Org.
// Description:
//    HUB functions (Magic)
// HUB_SkillInvoke (  )
function	script	HUB_SkillInvoke	{
    // Something is... wrong
    if (!@skillId) {
        Exception("ILLEGAL SKILL PASSED TO HUB. It has been compromised, Jim.", RB_DEBUGMES|RB_IRCBROADCAST);
        debugmes "Legal Caster: %s", strcharinfo(0);
        debugmes "Effective Caster: %d", @skillCaster;
        return;
    }

    /* *********************************************************************** */
    // TODO: Detect what was script-cast and what was player-case. Then, readd RB_IRCBROADCAST
    // If you can't do this: You can't do this
    if (getskilllv(@skillId) < @skillLv && @skillId != BS_GREED)
        Exception("System ERROR, HSI."+@skillId+" INVALID CAST (got "+@skillLv+" expected "+getskilllv(@skillId)+", sub-LC."+(getcharid(3)-2000000)+")", RB_DEBUGMES|RB_ISFATAL);
    // You are AFK for over 3 minutes, that's crazy, disregard
    if (checkidle() > 180)
        return;

    // Record to database
    skillInvoke[@skillId] = skillInvoke[@skillId] + 1;

    // Script-based skills
    /* *********************************************************************** */
    switch (@skillId) {
        case TMW2_FAKESKILL:
            charcommand("@refresh"); // Possibly broken on too up-to-date Herc
            break;
        // Level 0
        case SKILL_CONFRINGO:
             SK_Confringo(); break;
        // Level 1
        case SKILL_ABIZIT:
             SK_Abizit(); break;
        case SKILL_MONSTERINFO:
             SK_Miteyo(); break;
        case EVOL_AREA_PROVOKE:
            SK_Itenplz(); break;
        case SKILL_FLAR:
             SK_Flar(); break;
        case SKILL_MODRIPHOO:
        case SKILL_MODRISUMP:
        case SKILL_MODRIYIKAM:
        case SKILL_MODRILAX:
             SK_GrowPlants(); break; // FIXME: Unreleased/cannot be learned
        case SKILL_LUM:
             SK_Lum(); break;
        // Level 2
        case SKILL_INMA:
             SK_Inma(); break;
        case SKILL_KALAKARENK:
        case SKILL_KALBOO:
        case SKILL_KALGINA:
        case SKILL_KALRENK:
             SK_SummonLv2(); break;
        case SKILL_HALHISS:
        case SKILL_HELORP:
             SK_SummonLv2(); break;
        // Level 3
        // Level 4
        // Level 5
        ////////////////////////////////
        /* XXX: Fire Class
        // (May burn targets for damage over time)
        case TMW2_FIREARROW:
            .@PW=140+(10*@skillLv);
            // 4% chance, 2.5s
            harm(@skillTarget, AdjustSpellpower(.@PW), HARM_MAGI, Ele_Fire);
            sc_start SC_BLOODING, 4500, 1, 400, SCFLAG_NONE, @skillTarget;
            GetManaExp(TMW2_FIREBALL, 1);
            break;
        case TMW2_FIREBALL:
            .@PW=140+(10*@skillLv);
            .@RG=2+(@skillLv/5);
            // 22% chance, 2.5s
            areaharm(@skillTarget, .@RG, AdjustSpellpower(.@PW), HARM_MAGI, Ele_Fire);
            sc_start SC_BLOODING, 2500, 1, 4200, SCFLAG_NONE, @skillTarget;
            GetManaExp(TMW2_FIREBALL, 2);
            break;
        case TMW2_ARMAGEDDON:
            .@PW=140+(10*@skillLv);
            .@RG=5+(@skillLv/5);
            // 18% chance, 3s, 3x3 radius
            areaharm(@skillTarget, .@RG, AdjustSpellpower(.@PW), HARM_MAGI, Ele_Fire);
            areasc(.@RG, 6000, SC_BLOODING, BL_MOB|BL_PC|BL_HOM|BL_MER, 1, "filter_hostile", @skillTarget, 1800);
            GetManaExp(TMW2_FIREBALL, 3);
            break;
        ////////////////////////////////
        // XXX: Earth Class
        // DEF Effects at Gaia Break, more expensive
        case TMW2_METEORSTRIKE:
            .@PW=130+(20*@skillLv);
            .@dmg=AdjustSpellpower(.@PW);
            .@TM=1200+(@skillLv*300);
            harm(@skillTarget, .@dmg, HARM_MAGI, Ele_Earth);
            sc_start SC_STUN, .@TM, 1, 800, SCFLAG_NONE, @skillTarget;
            GetManaExp(TMW2_METEORSTRIKE, 1);
            break;
        case TMW2_METEORSHOWER:
            .@PW=130+(15*@skillLv);
            .@dmg=AdjustSpellpower(.@PW);
            .@RG=3+(@skillLv/5);
            .@TM=800+(@skillLv*200);
            areaharm(@skillTarget, .@RG, .@dmg, HARM_MAGI, Ele_Earth);
            areasc(.@RG, .@TM, SC_STUN, BL_MOB | BL_PC | BL_HOM | BL_MER, 1, "filter_hostile", @skillTarget, 800);
            GetManaExp(TMW2_METEORSTRIKE, 2);
            break;
        case TMW2_GAIABREAK:
            .@PWA=170+(30*@skillLv);
            .@PWB=110+(10*@skillLv);
            .@dmg=AdjustSpellpower(.@PWA);
            .@dsub=AdjustSpellpower(.@PWB);
            harm(@skillTarget, .@dmg, HARM_MAGI, Ele_Earth);
            rectharm(@skillTarget, 2, 5, .@dsub, HARM_MAGI, Ele_Earth);
            areasc(2, 5000, SC_INCDEFRATE, BL_PC, 10, "filter_friendly");
            GetManaExp(TMW2_METEORSTRIKE, 3);
            break;
        ////////////////////////////////
        // XXX: Physical Class (Regular)
        case TMW2_FALKONSTRIKE:
            .@PW=100+(25*@skillLv);
            .@ST=0+(10*@skillLv);
            .@TM=100+(90*@skillLv);
            harm(@skillTarget, AdjustAttackpower(.@PW), HARM_PHYS, Ele_Neutral);
            sc_start SC_STUN, .@TM, 1, .@ST, SCFLAG_NONE, @skillTarget;
            GetManaExp(@skillId, 1);
            break;
        case TMW2_GROUNDSTRIKE:
            .@PW=50+(40*@skillLv);
            .@dmg=AdjustAttackpower(.@PW);
            .@RG=2+(@skillLv/5);
            .@TM=100+(@skillLv*200);
            .@ST=500+(100*@skillLv);
            .@EF=any(SC_STUN, SC_BLIND, SC_BLOODING, SC_BLIND, SC_BLOODING);
            areaharm(@skillTarget, .@RG, .@dmg, HARM_PHYS, Ele_Neutral);
            areasc(.@RG, .@TM, .@EF, BL_MOB | BL_PC | BL_HOM | BL_MER, 1, "filter_hostile", @skillTarget, .@ST);
            GetManaExp(@skillId, 1);
            break;
        case TMW2_SUPREMEATTACK:
            .@PW=100+(50*@skillLv);
            harm(@skillTarget, AdjustAttackpower(.@PW), HARM_PHYS, Ele_Neutral);
            GetManaExp(@skillId, 1);
            break;
        ////////////////////////////////
        // XXX: Physical Class (Archery)
        case TMW2_CHARGEDARROW:
            .@PW=100+(50*@skillLv);
            harm(@skillTarget, AdjustAttackpower(.@PW), HARM_PHYS, Ele_Neutral);
            GetManaExp(@skillId, 1);
            break;
        case TMW2_ARROWSHOWER:
            .@PW=150+(10*@skillLv);
            .@dmg=AdjustAttackpower(.@PW);
            .@RG=1+(@skillLv/3);
            areaharm(@skillTarget, .@RG, .@dmg, HARM_PHYS, Ele_Neutral);
            GetManaExp(@skillId, 1);
            break;
        // Summons which never fail
        case TMW2_ZARKOR:
            alignment_cansummon();
            SummonMagic(@skillId, CaveMaggot, 2, @skillLv);
            GetManaExp(@skillId, 1);
            break;
        // Summons which may fail
        case TMW2_KALWULF:
            SK_summon(Wolvern, 4, any(3,4));
            break;
        case TMW2_KALBOO:
            SK_summon(Mouboo, 4, any(2,3));
            break;
        case TMW2_KALSPIKE:
            SK_summon(PoisonSpikyMushroom, 4, any(2,3));
            break;
        case TMW2_CUTEHEART:
            SK_summon(Fluffy, 4, any(2,3));
            break;
        // Slightly more complex summons
        case TMW2_LIMERIZER:
            SK_summon(any(GreenSlime,AzulSlime,RedSlime,AngryYellowSlime), 2, any(3,4));
            break;
        case TMW2_FAIRYKINGDOM:
            SK_summon(any(FireFairy, EarthFairy, WaterFairy, WindFairy, PoisonFairy), 4, any(3,4));
            break;
        case TMW2_FAIRYEMPIRE:
            SK_summon(any(VanityPixie, HolyPixie, ShadowPixie, NulityPixie), 5, any(4,5));
            break;
        // More complex summons
        case TMW2_KALMURK:
            .@mobId=Maggot;
            SK_summon(.@mobId, (.@mobId == Maggot ? 2 : 4), any(1,2));
            break;
        case TMW2_HALHISS:
            .@mobId=Snake;
            SK_summon(.@mobId, 4, any(3,4));
            break;
        case TMW2_FROZENHEART:
            .@mobId=Moggun;
            if (rand2(6,12) < abizit()+1)
            {
                .@mobId=Yeti;
            }
            SK_summon(.@mobId, 4, any(3,4));
            break;
        case TMW2_STONEHEART:
            .@mobId=Terranite;
            if (rand2(9,12) < abizit()+1 &&
                BaseLevel > 80)
            {
                .@mobId=TerraniteProtector;
            }
            SK_summon(.@mobId, 4, any(4,5));
            break;
        case TMW2_DUCKY:
            .@mobId=Duck;
            SummonMagic(@skillId, .@mobId, 2);
            GetManaExp(@skillId, 1);
            break;
        */

        // Experience only
        default:
            GetManaExp(@skillId, 1);
            break;
    }

    // Debug
    if ($@GM_OVERRIDE)
        debugmes "Cast skill %d on level %d - Target %d",
                  @skillId, @skillLv, @skillTarget;

    // Cleanup (double-safe)
    @skillTarget = 0;
    return;

}





























// HUB_PCBonus ()
function	script	HUB_PCBonus	{
    /* Passive Skills */
    if (FOCUSING & FSKILL_ASTRAL_SOUL) {
        bonus bMatk, 9*getskilllv(SKILL_ASTRAL_SOUL);
    }
    if (FOCUSING & FSKILL_RAGING) {
        bonus bCritical, 2*getskilllv(SKILL_RAGING);
    }
    if (FOCUSING & FSKILL_SPEED) {
        bonus bSpeedAddRate, 1*getskilllv(SKILL_SPEED);
        bonus bAspd, 2*getskilllv(SKILL_SPEED);
    }
    if (FOCUSING & FSKILL_RESIST_POISON) {
        .@l=5*getskilllv(SKILL_RESIST_POISON);
        bonus2(bResEff, Eff_Silence, .@l);
        bonus2(bResEff, Eff_Poison,  .@l);
        bonus2(bResEff, Eff_Curse,   .@l);
        bonus2(bResEff, Eff_Blind,   .@l);
    }
    if (FOCUSING & FSKILL_BRAWLING) {
        if (getequipid(EQI_HAND_R) < 1) {
            bonus bAtk, 10*getskilllv(SKILL_BRAWLING);
        } else if (getiteminfo(
                   getequipid(EQI_HAND_R), ITEMINFO_SUBTYPE) == W_FIST) {
            bonus bAtk, 10*getskilllv(SKILL_BRAWLING);
        }
    }
    if (FOCUSING & FSKILL_MALLARDS_EYE) {
		bonus bAtkRange, (1+getskilllv(SKILL_MALLARDS_EYE))/2;
		bonus bHit, 5*getskilllv(SKILL_MALLARDS_EYE);
    }
    return;
}