summaryrefslogtreecommitdiff
path: root/npc/items
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-06-18 13:41:13 -0300
committerJesusaves <cpntb1@ymail.com>2019-06-18 13:41:13 -0300
commit45f8b18e262931fdece168abdf5b63a11f1a980b (patch)
tree95a518a2bd569e275c28cdbca8adbc8c64809945 /npc/items
parentd7bd83f00ab64b1f9614cafed3bc1938fa03f554 (diff)
downloadserverdata-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.txt21
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;
+}
+