From 64edf32b550bbbb2a15d9dc18d7c8b4e6d16622d Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 1 Jul 2020 00:29:12 -0300 Subject: New function: rectharm() - allows rectangles It will be useful for a Grand Cross skill of the sorts (where center deals 2x damage) --- npc/config/magic.txt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'npc') diff --git a/npc/config/magic.txt b/npc/config/magic.txt index 4fc4e83e3..bd8b1a1f6 100644 --- a/npc/config/magic.txt +++ b/npc/config/magic.txt @@ -153,6 +153,33 @@ function script areaharm { } +// rectharm(target, x, y, DMG, {type, element, filter, bl}) +// Same as areaharm() but causes a rectangle in (x,y) size, instead of a square +function script rectharm { + .@t=getarg(0); + .@rx=getarg(1); + .@ry=getarg(2); + .@d=getarg(3); + .@h=getarg(4, HARM_MISC); + .@e=getarg(5, Ele_Neutral); + .@f$=getarg(6, "filter_hostile"); + .@b=getarg(7, BL_PC | BL_MOB | BL_MER | BL_HOM); + + getmapxy(.@m$, .@x, .@y, getunittype(.@t), .@t); + + .@c=getunits(.@b, .@mbs, false, .@m$, .@x-.@rx, .@y-.@ry, .@x+.@rx, .@y+.@ry); + for (.@i = 0; .@i < .@c; .@i++) { + // Filtering + if (!callfunc(.@f$, .@mbs[.@i])) + continue; + harm(.@mbs[.@i], .@d, .@t, .@e); + specialeffect(FX_ATTACK, AREA, .@mbs[.@i]); + // TODO: Handle MobPt to don't overload timer system? + } + return; +} + + // mescordialog(text, color, {dialog=1}) function script mescordialog { if (getarg(2, true)) -- cgit v1.2.3-70-g09d2