summaryrefslogtreecommitdiff
path: root/npc/items
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2023-06-21 20:05:06 -0300
committerJesusaves <cpntb1@ymail.com>2023-06-21 20:05:06 -0300
commitcf550665b4be1f6717a8e779ca300ecbe2b7a525 (patch)
tree6aaeb01b779c7dd0768ce1c63d0c220eb1a7ac2f /npc/items
parent8e6bc8373fca8f1cca64ccb2254edd39dc5fd50c (diff)
downloadserverdata-cf550665b4be1f6717a8e779ca300ecbe2b7a525.tar.gz
serverdata-cf550665b4be1f6717a8e779ca300ecbe2b7a525.tar.bz2
serverdata-cf550665b4be1f6717a8e779ca300ecbe2b7a525.tar.xz
serverdata-cf550665b4be1f6717a8e779ca300ecbe2b7a525.zip
Fix bug in Grenade code
Diffstat (limited to 'npc/items')
-rw-r--r--npc/items/grenade.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/npc/items/grenade.txt b/npc/items/grenade.txt
index 96d952ca7..d4d78a9e4 100644
--- a/npc/items/grenade.txt
+++ b/npc/items/grenade.txt
@@ -4,12 +4,12 @@
// Description:
// Grenades workaround
-// grenade(range, damage - in 0.01%, flag) - defaults to 3x3 square, with 5% damage.
+// grenade(range, damage - in 0.01%, flag, filter) - defaults to 3x3 square, with 5% damage.
// If flag is set, damage will be deemed to be absolute values.
function script grenade {
.@r=getarg(0, 3);
.@d=getarg(1, 500);
- .@f$=getarg(2, "filter_notboss");
+ .@f$=getarg(3, "filter_notboss");
getmapxy(.@m$, .@x, .@y, 0);
.@c=getunits(BL_MOB, .@mbs, false, .@m$, .@x-.@r, .@y-.@r, .@x+.@r, .@y+.@r);
@@ -20,6 +20,7 @@ function script grenade {
.@dm=max(1, .@hp-.@d);
if (callfunc(.@f$)) {
//debugmes "Hitting monster (%d hp) for %d damage", .@hp, .@dm;
+ // TODO: use harm() instead?
setunitdata(.@mbs[.@i], UDT_HP, .@dm);
specialeffect(FX_ATTACK, AREA, .@mbs[.@i]);
}