summaryrefslogblamecommitdiff
path: root/npc/magic/level2-arrow-hail.txt
blob: 217f7fb001baa757e9c56fe27c7fcb491da4dae6 (plain) (tree)











































                                                                  
// 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;
}