diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-06-18 13:51:46 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-06-18 13:51:46 -0300 |
commit | 5ca671d4347217e5a867ac825b7ff67bb1d7bbe0 (patch) | |
tree | 20d89f0fdb8db170e4ab87a4609510349bba7476 | |
parent | 45f8b18e262931fdece168abdf5b63a11f1a980b (diff) | |
download | serverdata-5ca671d4347217e5a867ac825b7ff67bb1d7bbe0.tar.gz serverdata-5ca671d4347217e5a867ac825b7ff67bb1d7bbe0.tar.bz2 serverdata-5ca671d4347217e5a867ac825b7ff67bb1d7bbe0.tar.xz serverdata-5ca671d4347217e5a867ac825b7ff67bb1d7bbe0.zip |
Grenades now work (by force), but they never kill a monster and doesn't works on players!
-rw-r--r-- | db/re/item_db.conf | 3 | ||||
-rw-r--r-- | npc/commands/event.txt | 1 | ||||
-rw-r--r-- | npc/items/grenade.txt | 10 |
3 files changed, 11 insertions, 3 deletions
diff --git a/db/re/item_db.conf b/db/re/item_db.conf index 8fa12fd97..6b3c6440b 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -3246,7 +3246,8 @@ item_db: ( UseEffect: "FX_GRENADE" Script: <" //itemskill WZ_STORMGUST,3,0; - callfunc "grenade", 3, rand(500,700); + //callfunc "grenade", 3, rand(500,700); + callfunc "grenade", 3, rand(100,150)+BaseLevel*6, true; "> }, diff --git a/npc/commands/event.txt b/npc/commands/event.txt index 2d0057192..e1aa0777c 100644 --- a/npc/commands/event.txt +++ b/npc/commands/event.txt @@ -248,6 +248,7 @@ OnCall: OnEffect: @toeventchk=0; + removespecialeffect(310, SELF, getcharid(3)); // Calculate if (BaseLevel < 10) { dispbottom l("You are not strong enough to survive this trip."); diff --git a/npc/items/grenade.txt b/npc/items/grenade.txt index a1348039c..218758b8a 100644 --- a/npc/items/grenade.txt +++ b/npc/items/grenade.txt @@ -5,7 +5,8 @@ // Grenades workaround // Main loop - TODO: Should not affect boss -// grenade(range, damage - in 0.01%) - defaults to 3x3 square, with 5% damage +// grenade(range, damage - in 0.01%, flag) - 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); @@ -14,7 +15,12 @@ function script grenade { .@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)); + .@dm=max(1, .@hp*(10000-.@d)/10000); + if (getarg(2, false)) + .@dm=max(1, .@hp-.@d); + //debugmes "Hitting monster (%d hp) for %d damage", .@hp, .@dm; + setunitdata(.@mbs[.@i], UDT_HP, .@dm); + specialeffect(FX_ATTACK, AREA, .@mbs[.@i]); } return; } |