diff options
author | Jesusaves <cpntb1@ymail.com> | 2023-06-24 22:31:28 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2023-06-24 22:31:28 -0300 |
commit | 392f8ce15649456eb500ba4f4186b5a70bb29e47 (patch) | |
tree | e51064b0e98fb12cbe25d95a1402c5d72a0ef566 | |
parent | 8a1b23004bb089aa751b048f4fa351bcbf90a2ff (diff) | |
download | serverdata-392f8ce15649456eb500ba4f4186b5a70bb29e47.tar.gz serverdata-392f8ce15649456eb500ba4f4186b5a70bb29e47.tar.bz2 serverdata-392f8ce15649456eb500ba4f4186b5a70bb29e47.tar.xz serverdata-392f8ce15649456eb500ba4f4186b5a70bb29e47.zip |
Backport a fix on grenades
-rw-r--r-- | npc/items/grenade.txt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/npc/items/grenade.txt b/npc/items/grenade.txt index 96d952c..12a314b 100644 --- a/npc/items/grenade.txt +++ b/npc/items/grenade.txt @@ -4,22 +4,23 @@ // 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); for (.@i = 0; .@i < .@c; .@i++) { .@hp=getunitdata(.@mbs[.@i], UDT_HP); - .@dm=max(1, .@hp*(10000-.@d)/10000); + .@dm=max(1, .@hp*(10000-.@d)/10000); // Does it even make sense? if (getarg(2, false)) .@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]); } |