Make Snow Witch killable after reactor activation

This commit is contained in:
P0nk
2022-08-29 21:20:51 +02:00
parent 84890ac308
commit 7fffd0bb64
5 changed files with 36 additions and 6 deletions

View File

@@ -20,6 +20,5 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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.");
}

View File

@@ -20,6 +20,5 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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.");
}

View File

@@ -20,6 +20,5 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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.");
}

View File

@@ -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);
}
}

View File

@@ -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<Character> banishPlayers) {
Disease disease = null;
Map<MonsterStatus, Integer> stats = new ArrayMap<>();