summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-07-01 00:29:12 -0300
committerJesusaves <cpntb1@ymail.com>2020-07-01 00:29:12 -0300
commit64edf32b550bbbb2a15d9dc18d7c8b4e6d16622d (patch)
treef58fb7e723554adb103e8fe3d89e0a80c2d540f6
parent5987c2db7e96d01a79e673abf567d06e93c8de82 (diff)
downloadserverdata-64edf32b550bbbb2a15d9dc18d7c8b4e6d16622d.tar.gz
serverdata-64edf32b550bbbb2a15d9dc18d7c8b4e6d16622d.tar.bz2
serverdata-64edf32b550bbbb2a15d9dc18d7c8b4e6d16622d.tar.xz
serverdata-64edf32b550bbbb2a15d9dc18d7c8b4e6d16622d.zip
New function: rectharm() - allows rectangles
It will be useful for a Grand Cross skill of the sorts (where center deals 2x damage)
-rw-r--r--npc/config/magic.txt27
1 files changed, 27 insertions, 0 deletions
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))