diff options
author | mekolat <mekolat@users.noreply.github.com> | 2015-06-11 11:13:11 -0400 |
---|---|---|
committer | mekolat <mekolat@users.noreply.github.com> | 2016-03-30 11:22:47 -0400 |
commit | bc4deaf81d9701261baac6a10d762b0f40e7f65f (patch) | |
tree | e539e3a49756626e27d4491fccb7a6862b12a120 /world/map/npc/magic/level2-protect.txt | |
parent | 9e7f46ac732851c1359a15837c82ebf67ea2be39 (diff) | |
download | classic-serverdata-bc4deaf81d9701261baac6a10d762b0f40e7f65f.tar.gz classic-serverdata-bc4deaf81d9701261baac6a10d762b0f40e7f65f.tar.bz2 classic-serverdata-bc4deaf81d9701261baac6a10d762b0f40e7f65f.tar.xz classic-serverdata-bc4deaf81d9701261baac6a10d762b0f40e7f65f.zip |
initial commit for magic v3
Fix Druid Tree and add hug to TMW
Diffstat (limited to 'world/map/npc/magic/level2-protect.txt')
-rw-r--r-- | world/map/npc/magic/level2-protect.txt | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/world/map/npc/magic/level2-protect.txt b/world/map/npc/magic/level2-protect.txt new file mode 100644 index 00000000..e4ca8d76 --- /dev/null +++ b/world/map/npc/magic/level2-protect.txt @@ -0,0 +1,48 @@ +-|script|protect|32767 +{ + callfunc "magic_checks"; if(@failed) end; // << I wish we had functions that could return >> + if (Sp < 14) end; + set .@level, getskilllv(.school); + if (.@level < .level) end; + if (getskilllv(SKILL_MAGIC) < .level) end; + if (.@level <= 3 && countitem("HardSpike") >= 1) delitem "HardSpike", 1; + elif (.@level <= 3) end; + set @target_id, getcharid(3, @args$); + if (@target_id < 1 || !(isloggedin(@target_id))) set @target_id, BL_ID; // fallback to self + + set @betsanc_caster, BL_ID, @target_id; + if (attachrid(@target_id) != 1) end; + set @target_hat, getequipid(equip_head), @betsanc_caster; + if (attachrid(@betsanc_caster) != 1) end; + if (@target_hat == 888) end; // FIXME: this whole 5 line block could be done with only one line if we modify getequipid + + set MAGIC_CAST_TICK, gettimetick(2) + 2; // set the new debuff + callfunc "adjust_spellpower"; + set Sp, Sp - 14; + misceffect FX_MAGIC_GREEN, strcharinfo(0); + callfunc "magic_exp"; + + if (distance(BL_ID, @target_id) >= (@spellpower/30)+2) set @target_id, BL_ID; + if (BL_ID == @target_id) set @args$, strcharinfo(0); + misceffect FX_MAGIC_SHIELD, @args$; + set .@time, (@spellpower*1000)+5000; + set @betsanc_time, .@time, @target_id; + sc_start SC_PHYS_SHIELD, .@time, max(15,(@spellpower/20))+5, @target_id; + message @args$, "Shield : You feel more protected."; + if (attachrid(@target_id) != 1) end; + addtimer @betsanc_time, strnpcinfo(0)+"::OnEnd"; + end; + +OnEnd: + message strcharinfo(0), "Shield : You feel less protected."; + misceffect FX_MAGIC_SHIELD_ENDS, strcharinfo(0); + end; + +OnInit: + set .school, SKILL_MAGIC_NATURE; + set .invocation$, chr(MAGIC_SYMBOL) + "betsanc"; // used in npcs that refer to this spell + callfunc "magic_register"; + set .level, 2; + set .exp_gain, 2; + end; +} |