diff options
author | mekolat <mekolat@users.noreply.github.com> | 2016-04-19 09:42:48 -0400 |
---|---|---|
committer | mekolat <mekolat@users.noreply.github.com> | 2016-04-19 09:42:48 -0400 |
commit | ea7d999c39ead96efb6d9af7e68794c59290cf60 (patch) | |
tree | 771e06363fe2e7609847a0a63a2e499632d3d7a2 /world/map/npc/magic/level2-lay-on-hands.txt | |
parent | 9e7f46ac732851c1359a15837c82ebf67ea2be39 (diff) | |
parent | 91fe3711fcacdfe83794b4347595e56e90e9d3a7 (diff) | |
download | serverdata-ea7d999c39ead96efb6d9af7e68794c59290cf60.tar.gz serverdata-ea7d999c39ead96efb6d9af7e68794c59290cf60.tar.bz2 serverdata-ea7d999c39ead96efb6d9af7e68794c59290cf60.tar.xz serverdata-ea7d999c39ead96efb6d9af7e68794c59290cf60.zip |
Merge self-fork from mekolat/magic-v3
Magic v3 spells
Diffstat (limited to 'world/map/npc/magic/level2-lay-on-hands.txt')
-rw-r--r-- | world/map/npc/magic/level2-lay-on-hands.txt | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/world/map/npc/magic/level2-lay-on-hands.txt b/world/map/npc/magic/level2-lay-on-hands.txt new file mode 100644 index 00000000..4e3a1e9c --- /dev/null +++ b/world/map/npc/magic/level2-lay-on-hands.txt @@ -0,0 +1,61 @@ +-|script|lay-on-hands|32767 +{ + if(call("magic_checks")) end; + if (Sp < 10) end; + if (getskilllv(.school) < .level) end; + if (getskilllv(SKILL_MAGIC) < .level) end; + if (@args$ == "Mouboo" || @args$ == "mouboo") goto L_Mouboo; + set @target_id, getcharid(3, @args$); + if (@target_id < 1 || !(isloggedin(@target_id))) end; + if (Hp <= get(MaxHp, @target_id) / 20) end; // hp needs to be > 1/20 * target hp + callfunc "adjust_spellpower"; + if (distance(BL_ID, @target_id) >= (((sqrt(@spellpower)*12)+@spellpower)/100)+2) end; + if (sc_check(SC_HALT_REGENERATE,@target_id)) end; + if (getequipid(equip_head, @args$) == 888) end; // magic gm top hat + set .@needed, get(MaxHp, @target_id) - get(Hp, @target_id); + goto L_Pay; + +L_Pay: + set @_M_BLOCK, 1; // block casting, until the timer clears it + addtimer 500, "Magic Timer::OnClear"; // XXX should this be 0 ? + set Sp, Sp - 10; + misceffect FX_MAGIC_WHITE, strcharinfo(0); // on caster + misceffect FX_MAGIC_WHITE, @args$; // on target + + set .@fraction, max(80, 200 - (Vit + (@spellpower/10))); // pay at least 40% + set .@payment, (.@needed * .@fraction) / 200; + set .@available, Hp - (MaxHp / 20); + set .@heal_value, if_then_else(.@payment < .@available, .@needed+1-1, (.@available * 200) / .@fraction); // FIXME / XXX why the f do I need to do +1-1 ? + if (.@payment > .@available) set .@payment, .@available; + + set @inma_power, .@heal_value, @target_id; + + set @mexp, min(.exp_gain, .@payment/100); + callfunc "gain_heal_xp"; + callfunc "magic_exp"; + + set .@dark, getskilllv(SKILL_MAGIC_DARK) >= 2; // true if dark magic user + set .@bad, (MaxHp/20)*(0-1); + if (.@dark) heal .@bad, 0; + sc_start SC_HALT_REGENERATE, if_then_else(.@dark, 5000, 10000), 0; + + if (attachrid(@target_id) != 1) end; + if (!(isdead())) heal @inma_power, 0; + end; + +L_Mouboo: + set @spell, 1; + callfunc "QuestMoubooHeal"; + set .@needed, 1000; + goto L_Pay; + +OnInit: + set .school, SKILL_MAGIC_LIFE; + set .invocation$, chr(MAGIC_SYMBOL) + "inma"; // used in npcs that refer to this spell + void call("magic_register"); + set .level, 2; + set .exp_gain, 1; // this is MAX possible exp + set .heal_xp_value_divisor, 1; + set .base_exp_factor, 3; + end; +} |