Fix broken dojo scripts since introduction of MapId constants
This commit is contained in:
@@ -70,8 +70,8 @@ function action(mode, type, selection) {
|
||||
if (isRestingSpot(cm.getPlayer().getMap().getId())) {
|
||||
var text = "I'm surprised you made it this far! But it won't be easy from here on out. You still want the challenge?\r\n\r\n#b#L0#I want to continue#l\r\n#L1#I want to leave#l\r\n";
|
||||
|
||||
const GameConstants = Java.type('constants.game.GameConstants');
|
||||
if (!GameConstants.isDojoPartyArea(cm.getPlayer().getMapId())) {
|
||||
const MapId = Java.type('constants.id.MapId');
|
||||
if (!MapId.isPartyDojo(cm.getPlayer().getMapId())) {
|
||||
text += "#L2#I want to record my score up to this point#l";
|
||||
}
|
||||
cm.sendSimple(text);
|
||||
|
||||
@@ -32,8 +32,8 @@ function enter(pi) {
|
||||
pi.goDojoUp();
|
||||
pi.getPlayer().getMap().setReactorState();
|
||||
var stage = Math.floor(pi.getPlayer().getMapId() / 100) % 100;
|
||||
const GameConstants = Java.type('constants.game.GameConstants');
|
||||
if ((stage - (stage / 6) | 0) == pi.getPlayer().getVanquisherStage() && !GameConstants.isDojoPartyArea(pi.getPlayer().getMapId())) // we can also try 5 * stage / 6 | 0 + 1
|
||||
const MapId = Java.type('constants.id.MapId');
|
||||
if ((stage - (stage / 6) | 0) == pi.getPlayer().getVanquisherStage() && !MapId.isPartyDojo(pi.getPlayer().getMapId())) // we can also try 5 * stage / 6 | 0 + 1
|
||||
{
|
||||
pi.getPlayer().setVanquisherKills(pi.getPlayer().getVanquisherKills() + 1);
|
||||
}
|
||||
|
||||
@@ -155,8 +155,8 @@ public class NPCScriptManager extends AbstractScriptManager {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
}
|
||||
return true;
|
||||
} catch (final Exception ute) {
|
||||
log.error("Error starting NPC script: {}", npc);
|
||||
} catch (Exception e) {
|
||||
log.error("Error starting NPC script: {}", npc, e);
|
||||
dispose(c);
|
||||
|
||||
return false;
|
||||
|
||||
@@ -71,7 +71,7 @@ public class PortalScriptManager extends AbstractScriptManager {
|
||||
return script.enter(new PortalPlayerInteraction(c, portal));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("Portal script {}", portal.getScriptName(), e);
|
||||
log.warn("Portal script error in: {}", portal.getScriptName(), e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user