From 120989d9c52a3b9385248e6d4b9c60328fac29a8 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 7 Mar 2019 02:01:04 -0300 Subject: Enforce the no-ranged-weapon rule at Divine Rage skill. Switching to a ranged weapon cancels the buff. Range is the base here! --- npc/magic/demure.txt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'npc/magic/demure.txt') diff --git a/npc/magic/demure.txt b/npc/magic/demure.txt index 0a6f6d8bf..79dfa6601 100644 --- a/npc/magic/demure.txt +++ b/npc/magic/demure.txt @@ -62,7 +62,7 @@ SC_MOVHASTE_INFINITY: 60 SC_PLUSATTACKPOWER: 61 SC_PLUSMAGICPOWER: 62 - + */ OnCall: @@ -73,6 +73,13 @@ OnCall: end; } + // non-melee weapons not allowed + // TODO: Run this check on a loop in case player is switching weapons + if (getiteminfo(getequipid(EQI_HAND_R), ITEMINFO_RANGE) > 3) { + dispbottom l("Only melee weapons are permitted for use with this skill."); + end; + } + // Check requisites if (!MagicCheck(TMW2_DEMURE, 100, 100)) end; @@ -96,6 +103,16 @@ OnCall: GetManaExp(TMW2_DEMURE, rand(1,getskilllv(TMW2_DEMURE))); end; +// If you switch to a bow, you lose the effect at once and loop dies +OnTMW2DemureCheck: + if (@demure_at < gettimetick(2)) + end; + if (getiteminfo(getequipid(EQI_HAND_R), ITEMINFO_RANGE) > 3) + sc_start SC_ATTHASTE_POTION2, 100, -50; + else + addtimer(rand(786,1346), "::OnTMW2DemureCheck"); + end; + OnInit: bindatcmd "sk-demure", "sk#demure::OnCall", 0, 100, 0; end; -- cgit v1.2.3-60-g2f50