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 | |
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
-rw-r--r-- | db/re/item_db.conf | 3 | ||||
-rw-r--r-- | npc/items/grenade.txt | 21 | ||||
-rw-r--r-- | npc/scripts.conf | 1 |
3 files changed, 24 insertions, 1 deletions
diff --git a/db/re/item_db.conf b/db/re/item_db.conf index f90d0daae..8fa12fd97 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -3245,7 +3245,8 @@ item_db: ( Delay: 500 UseEffect: "FX_GRENADE" Script: <" - itemskill WZ_STORMGUST,3,0; + //itemskill WZ_STORMGUST,3,0; + callfunc "grenade", 3, rand(500,700); "> }, 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; +} + diff --git a/npc/scripts.conf b/npc/scripts.conf index cda4ea36e..7ed1e911b 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -71,6 +71,7 @@ "npc/items/books.txt", "npc/items/croconut.txt", "npc/items/emptybox.txt", +"npc/items/grenade.txt", "npc/items/lofteleporter.txt", "npc/items/mercenary.txt", "npc/items/shovel.txt", |