Make Shade killable after talking to lamp post

This commit is contained in:
P0nk
2022-08-29 21:42:57 +02:00
parent 7fffd0bb64
commit f1d0cb6b4d
3 changed files with 32 additions and 31 deletions

View File

@@ -46,8 +46,12 @@ function action(mode, type, selection) {
}
if (status == 0) {
cm.sendOk("A small focus of light lighting in the immersive darkness.");
cm.dispose();
cm.sendAcceptDecline("This is a small lamp with a switch. Would you like to turn it on?");
return;
} else if (status == 1) {
cm.weakenAreaBoss(5090000, "You have turned the lamp on. Shade's strength will rapidly weaken due to the light.");
}
cm.dispose();
}
}

View File

@@ -1185,4 +1185,30 @@ public class AbstractPlayerInteraction {
public long getCurrentTime() {
return Server.getInstance().getCurrentTime();
}
public void weakenAreaBoss(int monsterId, String message) {
MapleMap map = c.getPlayer().getMap();
Monster monster = map.getMonsterById(monsterId);
if (monster == null) {
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

@@ -32,8 +32,6 @@ 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;
@@ -344,31 +342,4 @@ 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);
}
}