From f0c58069dbd7721b140ba3f585a4c6e6ad315352 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 22 Jun 2020 21:32:25 -0300 Subject: Move traps definition to npc/config Make maps --- npc/config/traps.txt | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 npc/config/traps.txt (limited to 'npc/config/traps.txt') diff --git a/npc/config/traps.txt b/npc/config/traps.txt new file mode 100644 index 000000000..83e46f7a0 --- /dev/null +++ b/npc/config/traps.txt @@ -0,0 +1,45 @@ +// TMW2 Scripts +// Author: +// The Mana World Brazil +// Jesusalva +// Description: +// Traps and other functions. + +// 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 .@n$, NPC_TRAP_ONLINE; + return; + } + + // Fire!! + setnpctimer 9000; + setnpcdisplay .@n$, NPC_TRAP_TRIGGERED; + + // Boom - Hurt players and/or stun monsters + // This means you can - and SHOULD - lead Forains into these traps + if (playerattached()) + { + percentheal -(.@dmg), 0; + } + else + { + .@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. + specialeffect 11; + return; +} + + -- cgit v1.2.3-60-g2f50