summaryrefslogtreecommitdiff
path: root/npc/magic
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-07 02:01:04 -0300
committerJesusaves <cpntb1@ymail.com>2019-03-07 02:01:04 -0300
commit120989d9c52a3b9385248e6d4b9c60328fac29a8 (patch)
tree6fb12ecb775b067014597b1f8db41403c2f0f7b8 /npc/magic
parentea2159c2ac1819038ca179a8367a5bfa5cc2fc45 (diff)
downloadserverdata-120989d9c52a3b9385248e6d4b9c60328fac29a8.tar.gz
serverdata-120989d9c52a3b9385248e6d4b9c60328fac29a8.tar.bz2
serverdata-120989d9c52a3b9385248e6d4b9c60328fac29a8.tar.xz
serverdata-120989d9c52a3b9385248e6d4b9c60328fac29a8.zip
Enforce the no-ranged-weapon rule at Divine Rage skill.
Switching to a ranged weapon cancels the buff. Range is the base here!
Diffstat (limited to 'npc/magic')
-rw-r--r--npc/magic/demure.txt19
1 files changed, 18 insertions, 1 deletions
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;