summaryrefslogtreecommitdiff
path: root/npc/magic/level2-arrow-hail.txt
blob: 217f7fb001baa757e9c56fe27c7fcb491da4dae6 (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
// The Mana World script
// Author: Jesusalva <jesusalva@themanaworld.org>
//
// Magic Script: SKILL_FRILLYAR (Level 1)
// School: War 2

function	script	SK_Frillyar	{
    // Additional check for ammo
    .@it=getequipid(EQI_AMMO);
    if (.@it < 1) {
        dispbottom l("Please equip your ammo first!");
        return;
    }
    if (countitem(.@it) < 15) {
        dispbottom l("You need at least %d %s to use this spell!",
                     15, getitemname(.@it));
        return;
    }
    // Delete items
    delitem(SulphurPowder, 1);
    delitem(.@it, 15);
    // Proccess attack power
    .@RG=4+(@skillLv/2);
    .@PW=90+(10*@skillLv);
    .@PW+=getiteminfo(.@it, ITEMINFO_ATK);
    // Weather modifiers
    if ("#WeatherCore"::weather(MASK_RAIN))
        .@PW-=10;
    if ("#WeatherCore"::weather(MASK_SANDSTORM))
        .@PW-=10;
    if ("#WeatherCore"::weather(MASK_SNOW))
        .@PW-=10;
    // Effective magic code
    .@dmg=AdjustSpellpower(.@PW);
    .@dmg+=getiteminfo(.@it, ITEMINFO_ATK);
    specialeffect(FX_MAGIC_AHAIL_CAST, AREA, @skillTarget);
    areaharm(@skillTarget, .@RG, .@dmg, HARM_PHYS, Ele_Neutral);
    harm(@skillTarget, .@dmg/20, HARM_MAGI, Ele_Holy);
    specialeffect(FX_ARROW_HAIL, AREA, @skillTarget);
    GetManaExp(@skillId, 2);
    return;
}