summaryrefslogtreecommitdiff
path: root/npc/items
diff options
context:
space:
mode:
Diffstat (limited to 'npc/items')
-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]);
}