summaryrefslogtreecommitdiff
path: root/npc/config/magic.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-06-23 01:02:00 -0300
committerJesusaves <cpntb1@ymail.com>2020-06-23 01:02:00 -0300
commit9701df54795ff74f23391a259edb29196d0fbd4f (patch)
treeb4096af0383bb3b26bc7a97a7b01a619bc64c283 /npc/config/magic.txt
parentac6c384e7b035378611808e4eb4346659104f4fe (diff)
downloadserverdata-9701df54795ff74f23391a259edb29196d0fbd4f.tar.gz
serverdata-9701df54795ff74f23391a259edb29196d0fbd4f.tar.bz2
serverdata-9701df54795ff74f23391a259edb29196d0fbd4f.tar.xz
serverdata-9701df54795ff74f23391a259edb29196d0fbd4f.zip
First sketch of areaharm()
Diffstat (limited to 'npc/config/magic.txt')
-rw-r--r--npc/config/magic.txt39
1 files changed, 39 insertions, 0 deletions
diff --git a/npc/config/magic.txt b/npc/config/magic.txt
index 340f89c08..b0ebea7a6 100644
--- a/npc/config/magic.txt
+++ b/npc/config/magic.txt
@@ -112,6 +112,45 @@ function script SummonMagic {
return;
}
+// areaharm(target, range, DMG, {type, element, filter, bl})
+// Defaults to HARM_MISC, Ele_Neutral, filter filter_hostile and all BLs
+// Valid BL: BL_MOB | BL_PC | BL_HOM | BL_MER
+// Do not use: NPC, PET, ELEM
+// Range centers on caster (player), implement and use areaharm2 elsewhere
+function script areaharm {
+ .@t=getarg(0);
+ .@r=getarg(1);
+ .@d=getarg(2);
+ .@h=getarg(3, HARM_MISC);
+ .@e=getarg(4, Ele_Neutral);
+ .@f$=getarg(5, "filter_hostile");
+ .@b=getarg(6, BL_PC | BL_MOB | BL_MER | BL_HOM);
+
+ // FIXME: Retrieve from .@t not from "0"/caster
+ //getmapxy(.@m$, .@x, .@y, 0);
+ // Ideally we would have @skillTargetX/Y and not use getmap() but meh
+ .@m$=getmap();
+ getunitdata(.@t, UDT_MAPIDXY, .@loc);
+ .@x=.@loc[1];
+ .@y=.@loc[2];
+ debugmes("Loc %s (%d, %d) - Real loc %s", .@m$, .@x, .@y, str(.@loc[0]));
+
+ .@c=getunits(.@b, .@mbs, false, .@m$, .@x-.@r, .@y-.@r, .@x+.@r, .@y+.@r);
+ debugmes "Begin";
+ for (.@i = 0; .@i < .@c; .@i++) {
+ // Filtering
+ if (!callfunc(.@f$, .@mbs[.@i]))
+ continue;
+ debugmes "Target %d", .@mbs[.@i];
+ harm(.@mbs[.@i], .@d, .@t, .@e);
+ debugmes "Harmed";
+ specialeffect(FX_ATTACK, AREA, .@mbs[.@i]);
+ debugmes "FX'ed";
+ }
+ debugmes "Done";
+ return;
+}
+
// mescordialog(text, color, {dialog=1})
function script mescordialog {
if (getarg(2, true))