summaryrefslogtreecommitdiff
path: root/npc/items/grenade.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-07-29 20:06:08 -0300
committerJesusaves <cpntb1@ymail.com>2019-07-29 20:06:08 -0300
commitce7cbf358967493350caccc61124395f44ad040e (patch)
tree6e3a9390834698504ba9c23d266858b6d00c27be /npc/items/grenade.txt
parentd50cb8eff8d4f143b553cc33401f60baa6b03873 (diff)
downloadserverdata-ce7cbf358967493350caccc61124395f44ad040e.tar.gz
serverdata-ce7cbf358967493350caccc61124395f44ad040e.tar.bz2
serverdata-ce7cbf358967493350caccc61124395f44ad040e.tar.xz
serverdata-ce7cbf358967493350caccc61124395f44ad040e.zip
areasc() - never target caster.
areasc2() [NEW] - For NPC usage
Diffstat (limited to 'npc/items/grenade.txt')
-rw-r--r--npc/items/grenade.txt24
1 files changed, 23 insertions, 1 deletions
diff --git a/npc/items/grenade.txt b/npc/items/grenade.txt
index 0fdd5ea05..59e0e4ae5 100644
--- a/npc/items/grenade.txt
+++ b/npc/items/grenade.txt
@@ -27,7 +27,7 @@ function script grenade {
}
// areasc(range, time, sc, bl) - defaults to 3x3 square, sleep mob for 500ms.
-// before was: smoke_grenade(). Valid BL: BL_MOB | BL_PC | BL_HOM | BL_MER
+// Need a player caster. Valid BL: BL_MOB | BL_PC | BL_HOM | BL_MER
function script areasc {
.@r=getarg(0, 3);
.@d=getarg(1, 500);
@@ -37,6 +37,28 @@ function script areasc {
getmapxy(.@m$, .@x, .@y, 0);
.@c=getunits(.@b, .@mbs, false, .@m$, .@x-.@r, .@y-.@r, .@x+.@r, .@y+.@r);
for (.@i = 0; .@i < .@c; .@i++) {
+ // Never target the caster
+ if (.@mbs[.@i] == getcharid(3))
+ continue;
+ sc_start .@s, .@d, 1, 10000, SCFLAG_NONE, .@mbs[.@i];
+ specialeffect(FX_BUFF, AREA, .@mbs[.@i]);
+ }
+ return;
+}
+
+// areasc2(map, x, y, {range, time, sc, bl}) - can be used by NPC
+// Valid BL: BL_MOB | BL_PC | BL_HOM | BL_MER
+function script areasc {
+ .@m$=getarg(0);
+ .@x=getarg(1);
+ .@y=getarg(2);
+ .@r=getarg(3, 3);
+ .@d=getarg(4, 500);
+ .@s=getarg(5, SC_SLEEP);
+ .@b=getarg(6, BL_MOB);
+
+ .@c=getunits(.@b, .@mbs, false, .@m$, .@x-.@r, .@y-.@r, .@x+.@r, .@y+.@r);
+ for (.@i = 0; .@i < .@c; .@i++) {
sc_start .@s, .@d, 1, 10000, SCFLAG_NONE, .@mbs[.@i];
specialeffect(FX_BUFF, AREA, .@mbs[.@i]);
}