From aa9f4167edf59b60a4a58e43eb7bed3a2cd91c4e Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 3 Jun 2019 10:46:20 -0300 Subject: Make SteelTrap flexible --- npc/001-4/traps.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'npc/001-4') diff --git a/npc/001-4/traps.txt b/npc/001-4/traps.txt index c30553c59..0c00263ef 100644 --- a/npc/001-4/traps.txt +++ b/npc/001-4/traps.txt @@ -4,7 +4,12 @@ // Description: // Traps. +// SteelTrap( {damage=80%}, {delay=15s}, {stun=3s} ) function script SteelTrap { + .@dmg=getarg(0, 80); + .@delay=getarg(1, 15); + .@stun=getarg(2, 3); + // It was disarmed if (getnpctimer(0) == 0) { @@ -21,12 +26,13 @@ function script SteelTrap { // This means you can - and SHOULD - lead Forains into these traps if (playerattached()) { - percentheal -80, 0; + percentheal -(.@dmg), 0; } else { - sc_start SC_WALKSPEED,15000,60; - sc_start SC_STUN,rand(3000,8000),0; + .@stun*=1000; + sc_start SC_WALKSPEED,(.@delay*1000),60; + sc_start SC_STUN,rand(.@stun,.@stun*3),0; } // A minor special effect and we're done. -- cgit v1.2.3-70-g09d2