diff --git a/scripts/reactor/2119004.js b/scripts/reactor/2119004.js index ce19e0bf7f..59a84fd405 100644 --- a/scripts/reactor/2119004.js +++ b/scripts/reactor/2119004.js @@ -20,6 +20,5 @@ along with this program. If not, see . */ function hit() { - rm.hitMonsterWithReactor(6090001, 4); - rm.getReactor().setEventState(Math.floor(Math.random() * 3)); + rm.weakenAreaBoss(6090001, "The light at the altar appeases the hatred of the Snow Witch. The force of the Witch has weakened."); } \ No newline at end of file diff --git a/scripts/reactor/2119005.js b/scripts/reactor/2119005.js index ce19e0bf7f..59a84fd405 100644 --- a/scripts/reactor/2119005.js +++ b/scripts/reactor/2119005.js @@ -20,6 +20,5 @@ along with this program. If not, see . */ function hit() { - rm.hitMonsterWithReactor(6090001, 4); - rm.getReactor().setEventState(Math.floor(Math.random() * 3)); + rm.weakenAreaBoss(6090001, "The light at the altar appeases the hatred of the Snow Witch. The force of the Witch has weakened."); } \ No newline at end of file diff --git a/scripts/reactor/2119006.js b/scripts/reactor/2119006.js index ce19e0bf7f..59a84fd405 100644 --- a/scripts/reactor/2119006.js +++ b/scripts/reactor/2119006.js @@ -20,6 +20,5 @@ along with this program. If not, see . */ function hit() { - rm.hitMonsterWithReactor(6090001, 4); - rm.getReactor().setEventState(Math.floor(Math.random() * 3)); + rm.weakenAreaBoss(6090001, "The light at the altar appeases the hatred of the Snow Witch. The force of the Witch has weakened."); } \ No newline at end of file diff --git a/src/main/java/scripting/reactor/ReactorActionManager.java b/src/main/java/scripting/reactor/ReactorActionManager.java index a2095bbcbe..9eb1ae98dc 100644 --- a/src/main/java/scripting/reactor/ReactorActionManager.java +++ b/src/main/java/scripting/reactor/ReactorActionManager.java @@ -32,6 +32,8 @@ import scripting.AbstractPlayerInteraction; import server.ItemInformationProvider; import server.TimerManager; import server.life.LifeFactory; +import server.life.MobSkill; +import server.life.MobSkillFactory; import server.life.Monster; import server.maps.MapMonitor; import server.maps.MapleMap; @@ -342,4 +344,31 @@ public class ReactorActionManager extends AbstractPlayerInteraction { getPlayer().getMap().getBlueTeamBuffs().remove(skil); } } + + public void weakenAreaBoss(int monsterId, String message) { + MapleMap map = reactor.getMap(); + Monster monster = map.getMonsterById(monsterId); + if (monster == null) { + System.err.println("Area boss not found. Monster id " + monsterId); + return; + } + + applySealSkill(monster); + applyReduceAvoid(monster); + sendBlueNotice(map, message); + } + + private void applySealSkill(Monster monster) { + MobSkill sealSkill = MobSkillFactory.getMobSkill(157, 1); + sealSkill.applyEffect(monster); + } + + private void applyReduceAvoid(Monster monster) { + MobSkill reduceAvoidSkill = MobSkillFactory.getMobSkill(155, 2); + reduceAvoidSkill.applyEffect(monster); + } + + private void sendBlueNotice(MapleMap map, String message) { + map.dropMessage(6, message); + } } \ No newline at end of file diff --git a/src/main/java/server/life/MobSkill.java b/src/main/java/server/life/MobSkill.java index aef0e2ad27..5cb85cc8c5 100644 --- a/src/main/java/server/life/MobSkill.java +++ b/src/main/java/server/life/MobSkill.java @@ -122,6 +122,10 @@ public class MobSkill { service.registerOverallAction(monster.getMap().getId(), toRun, animationTime); } + public void applyEffect(Monster monster) { + applyEffect(null, monster, false, Collections.emptyList()); + } + public void applyEffect(Character player, Monster monster, boolean skill, List banishPlayers) { Disease disease = null; Map stats = new ArrayMap<>();