summaryrefslogblamecommitdiff
path: root/world/map/npc/magic/level1-lesser-heal.txt
blob: 051445fb295a00c95a87c84f67a092e26c8e19fe (plain) (tree)
1
2
3
4
5
6
7
8
9

                          
                                 
                    
                                              
                                         

                                                                                       
                                      
                                                                



                                                                                              



                                                  

                                                                 
                                        


                                 
                                                  
                         

                                          
 
        
                                             
                                     
                                                                                                 
                    
 

                                                                                





                                                           


         



                                                                                            

          






                                                                  


                                                                                         
                                



                     
-|script|lesser-heal|32767
{
    if(call("magic_checks")) end;
    if (Sp < 6) end;
    if (getskilllv(SKILL_MAGIC) < .level) end;
    set @target_id, getcharid(3, @args$);
    if (@target_id < 1 || !(isloggedin(@target_id)) || get(INVISIBLE, @target_id) == 1)
        set @target_id, BL_ID; // fallback to self
    if (get(GM, @target_id) == 1) end;
    if (@args$ == "Mouboo" || @args$ == "mouboo") goto L_Mouboo;
    set .@range, (((MATK1 + getskilllv(SKILL_MAGIC) + getskilllv(.school) + 10) / 100) + 2);
    if (distance(BL_ID, @target_id) >= .@range) end;
    if (PVP_CHANNEL != get(PVP_CHANNEL, @target_id) && get(PVP_CHANNEL, @target_id) != 0) end;
    if (countitem("Lifestone") < 1) end;
    if (getmap() == "033-1") goto L_SpecialRules6;
    goto L_Pay;

L_Pay:
    set @_M_BLOCK, 1; // block casting, until the timer clears it
    addtimer 500, "Magic Timer::OnClear"; // set the new debuff
    sc_start SC_COOLDOWN, 500, 0, BL_ID;
    delitem "Lifestone", 1;
    callfunc "adjust_spellpower";
    set Sp, Sp - 6;
    misceffect FX_MAGIC_HEAL_CAST, strcharinfo(0);
    callfunc "magic_exp";
    if (@target_id != BL_ID) goto L_NotMe;
    goto L_Continue;

L_NotMe:
    misceffect FX_MAGIC_HEAL_HIT, @target_id;
    if (get(Hp, @target_id) < 1) end;
    void call("gain_heal_xp", min(200, (get(MaxHp, @target_id) - get(Hp, @target_id))), 1, 2, 2);
    goto L_Continue;

L_Continue:
    if (getskilllv(SKILL_MAGIC_DARK) >= 1) sc_start SC_HALT_REGENERATE, 2000, 0;
    if (get(Hp, @target_id) < 1) end;
    addtimer 0, strnpcinfo(0) + "::OnSlowHeal", @target_id;
    end;

OnSlowHeal:
    heal 200, 0, 1;
    end;

L_Mouboo:
    set @target_id, getnpcid("Mouboo");
    set .@range, (((MATK1 + getskilllv(SKILL_MAGIC) + getskilllv(.school) + 10) / 100) + 2);
    if (distance(BL_ID, @target_id) >= .@range) end;
    mes "Magic : ##3##BThis spell has no effect on animals.";
    close;

L_SpecialRules6:
    if ($@KIMARR_EVENT < 1) goto L_Pay;
    if (@target_id == BL_ID) goto L_Pay;
    if ($@Fluffy_FighterID != @target_id) goto L_Pay;
    message strcharinfo(0), "You can't heal others hunting here.";
    end;

OnInit:
    set .school, SKILL_MAGIC_LIFE;
    set .invocation$, chr(MAGIC_SYMBOL) + "lum"; // used in npcs that refer to this spell
    void call("magic_register");
    set .level, 1;
    set .exp_gain, 1;
    end;
}