From 45ca4be7791975f0e008a8fb60aeadabec2a21c7 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 3 Jun 2019 16:16:45 -0300 Subject: Make traps more flexible, bugfix --- npc/001-4/traps.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'npc/001-4') diff --git a/npc/001-4/traps.txt b/npc/001-4/traps.txt index 0c00263ef..3d50f34fe 100644 --- a/npc/001-4/traps.txt +++ b/npc/001-4/traps.txt @@ -4,23 +4,24 @@ // Description: // Traps. -// SteelTrap( {damage=80%}, {delay=15s}, {stun=3s} ) +// SteelTrap( {damage=80%}, {delay=15s}, {stun=3s}, {npcname=auto} ) function script SteelTrap { .@dmg=getarg(0, 80); .@delay=getarg(1, 15); .@stun=getarg(2, 3); + .@n$=getarg(3, strnpcinfo(0)); // It was disarmed if (getnpctimer(0) == 0) { initnpctimer; - setnpcdisplay strnpcinfo(0), NPC_TRAP_ONLINE; + setnpcdisplay .@n$, NPC_TRAP_ONLINE; return; } // Fire!! setnpctimer 9000; - setnpcdisplay strnpcinfo(0), NPC_TRAP_TRIGGERED; + setnpcdisplay .@n$, NPC_TRAP_TRIGGERED; // Boom - Hurt players and/or stun monsters // This means you can - and SHOULD - lead Forains into these traps -- cgit v1.2.3-70-g09d2