summaryrefslogtreecommitdiff
path: root/npc/config/magic.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-06-07 01:14:26 -0300
committerJesusaves <cpntb1@ymail.com>2020-06-07 01:14:26 -0300
commit34c40836458aa7a549962606c814a62ad3847467 (patch)
tree332ce74cd9448c4acc03ff6efc14376591e1e4ab /npc/config/magic.txt
parent88e7ffb2ec3f992fd38a4a093f0d746714c4b51f (diff)
downloadserverdata-34c40836458aa7a549962606c814a62ad3847467.tar.gz
serverdata-34c40836458aa7a549962606c814a62ad3847467.tar.bz2
serverdata-34c40836458aa7a549962606c814a62ad3847467.tar.xz
serverdata-34c40836458aa7a549962606c814a62ad3847467.zip
AdjustSpellpower() and AdjustAttackpower()
Complementary functions for harm()
Diffstat (limited to 'npc/config/magic.txt')
-rw-r--r--npc/config/magic.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/npc/config/magic.txt b/npc/config/magic.txt
index 9f0282fc4..f01dfebc8 100644
--- a/npc/config/magic.txt
+++ b/npc/config/magic.txt
@@ -15,6 +15,27 @@
// MAGIC_SUBCLASS
// Bitmasked magic subclass.
+// AdjustSpellpower(power=100, {target=@skillTarget{, type=HARM_MAGI}})
+function script AdjustSpellpower {
+ .@power=getarg(0, 100);
+ .@target=getarg(1, @skillTarget);
+ .@type=getarg(2, HARM_MAGI);
+ .@src=getcharid(3);
+
+ .@dmg=calcdmg(.@src, .@target, .@type);
+ .@dmg = .@dmg * .@power / 100;
+ return .@dmg;
+}
+
+// An alias for simplification
+// AdjustAttackpower(power=100, {target=@skillTarget{, type=HARM_PHYS}})
+function script AdjustAttackpower {
+ .@power=getarg(0, 100);
+ .@target=getarg(1, @skillTarget);
+ .@type=getarg(2, HARM_PHYS);
+ return AdjustSpellpower(.@power, .@target, .@type);
+}
+
// SkillID, EXP Points
function script GetManaExp {
.@sk=getarg(0);