From ea76880b7fd1764606f4d83c817be5b619aef784 Mon Sep 17 00:00:00 2001 From: P0nk Date: Wed, 31 Aug 2022 21:33:50 +0200 Subject: [PATCH] Use act() in reactor scripts where possible, provide empty act() otherwise "function hit()" has triggered on each reactor hit, while "function act()" is only triggered once it's destroyed or reached an end state --- scripts/reactor/2008007.js | 4 +++- scripts/reactor/2402007.js | 2 +- scripts/reactor/2402008.js | 2 +- scripts/reactor/2612004.js | 4 +++- scripts/reactor/2612005.js | 6 ++---- scripts/reactor/2618000.js | 4 +++- scripts/reactor/2618001.js | 4 ++-- scripts/reactor/2618002.js | 4 ++-- scripts/reactor/2619000.js | 5 +++++ scripts/reactor/2708000.js | 4 +++- 10 files changed, 25 insertions(+), 14 deletions(-) diff --git a/scripts/reactor/2008007.js b/scripts/reactor/2008007.js index a5d0169cd8..77b6951f4e 100644 --- a/scripts/reactor/2008007.js +++ b/scripts/reactor/2008007.js @@ -26,4 +26,6 @@ function hit() { var map = rm.getMap(); map.moveEnvironment("trap" + rm.getReactor().getName()[5], 1); -} \ No newline at end of file +} + +function act() {} \ No newline at end of file diff --git a/scripts/reactor/2402007.js b/scripts/reactor/2402007.js index 1d1269b40d..cd845b7869 100644 --- a/scripts/reactor/2402007.js +++ b/scripts/reactor/2402007.js @@ -25,6 +25,6 @@ * Neo City Trash Can */ -function hit() { +function act() { rm.dropItems(true, 2, 5, 10, 1); } \ No newline at end of file diff --git a/scripts/reactor/2402008.js b/scripts/reactor/2402008.js index 1d1269b40d..cd845b7869 100644 --- a/scripts/reactor/2402008.js +++ b/scripts/reactor/2402008.js @@ -25,6 +25,6 @@ * Neo City Trash Can */ -function hit() { +function act() { rm.dropItems(true, 2, 5, 10, 1); } \ No newline at end of file diff --git a/scripts/reactor/2612004.js b/scripts/reactor/2612004.js index b5f582bbfe..234fe219a3 100644 --- a/scripts/reactor/2612004.js +++ b/scripts/reactor/2612004.js @@ -26,4 +26,6 @@ function hit() { rm.sprayItems(); -} \ No newline at end of file +} + +function act() {} \ No newline at end of file diff --git a/scripts/reactor/2612005.js b/scripts/reactor/2612005.js index e69ea6b47e..051fe801eb 100644 --- a/scripts/reactor/2612005.js +++ b/scripts/reactor/2612005.js @@ -2,8 +2,6 @@ Yulete's Lab: Making the Reagent */ -function hit() { - if (rm.getReactor().getState() == 4) { - rm.dropItems(); - } +function act() { + rm.dropItems(); } \ No newline at end of file diff --git a/scripts/reactor/2618000.js b/scripts/reactor/2618000.js index 19531a3d7b..46fbde88c4 100644 --- a/scripts/reactor/2618000.js +++ b/scripts/reactor/2618000.js @@ -40,4 +40,6 @@ function hit() { rm.getMap().getReactorByName(reactname).hitReactor(rm.getClient()); } } -} \ No newline at end of file +} + +function act() {} \ No newline at end of file diff --git a/scripts/reactor/2618001.js b/scripts/reactor/2618001.js index b916036c3b..c099df25ae 100644 --- a/scripts/reactor/2618001.js +++ b/scripts/reactor/2618001.js @@ -20,11 +20,11 @@ along with this program. If not, see . */ -/*2618000.js - MagatiaPQ Beaker +/*2618001.js - MagatiaPQ Door *@author Ronan */ -function hit() { +function act() { var eim = rm.getEventInstance(); var isAlcadno = eim.getIntProperty("isAlcadno"); diff --git a/scripts/reactor/2618002.js b/scripts/reactor/2618002.js index f1b7202b31..03a5d9b293 100644 --- a/scripts/reactor/2618002.js +++ b/scripts/reactor/2618002.js @@ -20,11 +20,11 @@ along with this program. If not, see . */ -/*2618000.js - MagatiaPQ Beaker +/*2618002.js - MagatiaPQ Door *@author Ronan */ -function hit() { +function act() { var eim = rm.getEventInstance(); var isAlcadno = eim.getIntProperty("isAlcadno"); diff --git a/scripts/reactor/2619000.js b/scripts/reactor/2619000.js index 07d5b0164b..f2f8701bf7 100644 --- a/scripts/reactor/2619000.js +++ b/scripts/reactor/2619000.js @@ -26,4 +26,9 @@ function hit() { rm.dropItems(); +} + +function act() { + // There's a timeout of 3 seconds to revert back from state 1 to 0. + // Reactor is destroyed (state 2) and triggers this if dropping two Magic Devices at once, which shouldn't really happen. } \ No newline at end of file diff --git a/scripts/reactor/2708000.js b/scripts/reactor/2708000.js index eb1ea8a6c9..8a10c107a4 100644 --- a/scripts/reactor/2708000.js +++ b/scripts/reactor/2708000.js @@ -39,4 +39,6 @@ function hit() { //spawnJrBoss(mapObj.getMonsterById(8820023)); mapObj.killMonster(8820000); -} \ No newline at end of file +} + +function act() {} \ No newline at end of file