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/001-4/traps.txt | 38 -------------------------------------- npc/002-1/_config.txt | 11 +++++++++++ npc/002-1/_import.txt | 2 +- npc/002-1/_savepoints.txt | 11 ----------- npc/config/traps.txt | 45 +++++++++++++++++++++++++++++++++++++++++++++ npc/scripts.conf | 1 + 6 files changed, 58 insertions(+), 50 deletions(-) create mode 100644 npc/002-1/_config.txt delete mode 100644 npc/002-1/_savepoints.txt create mode 100644 npc/config/traps.txt (limited to 'npc') diff --git a/npc/001-4/traps.txt b/npc/001-4/traps.txt index 3d50f34fe..bfee1265e 100644 --- a/npc/001-4/traps.txt +++ b/npc/001-4/traps.txt @@ -4,44 +4,6 @@ // Description: // Traps. -// 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; -} - - 001-4,275,204,0 script #001-4_275x204 NPC_TRAP,0,0,{ mesn strcharinfo(0); mesq l("Something seems off with that!"); diff --git a/npc/002-1/_config.txt b/npc/002-1/_config.txt new file mode 100644 index 000000000..f43820b70 --- /dev/null +++ b/npc/002-1/_config.txt @@ -0,0 +1,11 @@ +// This file is generated automatically. All manually added changes will be removed when running the Converter. +// Map 002-1: Second Deck conf +002-1,55,40,0 script #save_002-1_55_40 NPC_SAVE_POINT,{ + savepointparticle .map$, .x, .y, NO_INN; + close; + +OnInit: + .distance = 2; + .sex = G_OTHER; + end; +} diff --git a/npc/002-1/_import.txt b/npc/002-1/_import.txt index ad6b0b697..0e3644fe9 100644 --- a/npc/002-1/_import.txt +++ b/npc/002-1/_import.txt @@ -1,7 +1,7 @@ // Map 002-1: Second Deck // This file is generated automatically. All manually added changes will be removed when running the Converter. +"npc/002-1/_config.txt", "npc/002-1/_mobs.txt", -"npc/002-1/_savepoints.txt", "npc/002-1/alige.txt", "npc/002-1/arpan.txt", "npc/002-1/billybons.txt", diff --git a/npc/002-1/_savepoints.txt b/npc/002-1/_savepoints.txt deleted file mode 100644 index 2edca8761..000000000 --- a/npc/002-1/_savepoints.txt +++ /dev/null @@ -1,11 +0,0 @@ -// This file is generated automatically. All manually added changes will be removed when running the Converter. -// Map 002-1: Second Deck saves -002-1,55,40,0 script #save_002-1_55_40 NPC_SAVE_POINT,{ - savepointparticle .map$, .x, .y, NO_INN; - close; - -OnInit: - .distance = 2; - .sex = G_OTHER; - end; -} 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; +} + + diff --git a/npc/scripts.conf b/npc/scripts.conf index c88dba484..79e2b0e80 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -35,6 +35,7 @@ // config script "npc/config/hairstyle_config.txt", +"npc/config/traps.txt", "npc/config/magic.txt", // Misc functions -- cgit v1.2.3-60-g2f50