From 34c40836458aa7a549962606c814a62ad3847467 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 7 Jun 2020 01:14:26 -0300 Subject: AdjustSpellpower() and AdjustAttackpower() Complementary functions for harm() --- npc/config/magic.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'npc/config/magic.txt') 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); -- cgit v1.2.3-70-g09d2