diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-07-29 20:06:08 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-07-29 20:06:08 -0300 |
commit | ce7cbf358967493350caccc61124395f44ad040e (patch) | |
tree | 6e3a9390834698504ba9c23d266858b6d00c27be | |
parent | d50cb8eff8d4f143b553cc33401f60baa6b03873 (diff) | |
download | serverdata-ce7cbf358967493350caccc61124395f44ad040e.tar.gz serverdata-ce7cbf358967493350caccc61124395f44ad040e.tar.bz2 serverdata-ce7cbf358967493350caccc61124395f44ad040e.tar.xz serverdata-ce7cbf358967493350caccc61124395f44ad040e.zip |
areasc() - never target caster.
areasc2() [NEW] - For NPC usage
-rw-r--r-- | npc/items/grenade.txt | 24 |
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]); } |