diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-06-18 13:41:13 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-06-18 13:41:13 -0300 |
commit | 45f8b18e262931fdece168abdf5b63a11f1a980b (patch) | |
tree | 95a518a2bd569e275c28cdbca8adbc8c64809945 /npc/items | |
parent | d7bd83f00ab64b1f9614cafed3bc1938fa03f554 (diff) | |
download | serverdata-45f8b18e262931fdece168abdf5b63a11f1a980b.tar.gz serverdata-45f8b18e262931fdece168abdf5b63a11f1a980b.tar.bz2 serverdata-45f8b18e262931fdece168abdf5b63a11f1a980b.tar.xz serverdata-45f8b18e262931fdece168abdf5b63a11f1a980b.zip |
Okay... This lame grenade works but is useless
Diffstat (limited to 'npc/items')
-rw-r--r-- | npc/items/grenade.txt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/npc/items/grenade.txt b/npc/items/grenade.txt new file mode 100644 index 000000000..a1348039c --- /dev/null +++ b/npc/items/grenade.txt @@ -0,0 +1,21 @@ +// TMW2 scripts. +// Authors: +// Jesusalva +// Description: +// Grenades workaround + +// Main loop - TODO: Should not affect boss +// grenade(range, damage - in 0.01%) - defaults to 3x3 square, with 5% damage +function script grenade { + .@r=getarg(0, 3); + .@d=getarg(1, 500); + + 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); + setunitdata(.@mbs[.@i], UDT_HP, max(1, .@hp*(10000-.@d)/10000)); + } + return; +} + |