Simplify NPC script start
This commit is contained in:
@@ -36,9 +36,9 @@ public class ClickGuideHandler extends AbstractPacketHandler {
|
||||
@Override
|
||||
public void handlePacket(InPacket p, Client c) {
|
||||
if (c.getPlayer().getJob().equals(Job.NOBLESSE)) {
|
||||
NPCScriptManager.getInstance().start(c, NpcId.MIMO, null);
|
||||
NPCScriptManager.getInstance().start(c, NpcId.MIMO);
|
||||
} else {
|
||||
NPCScriptManager.getInstance().start(c, NpcId.LILIN, null);
|
||||
NPCScriptManager.getInstance().start(c, NpcId.LILIN);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,11 +73,11 @@ public final class NPCTalkHandler extends AbstractPacketHandler {
|
||||
|
||||
// Custom handling to reduce the amount of scripts needed.
|
||||
if (npc.getId() >= NpcId.GACHAPON_MIN && npc.getId() <= NpcId.GACHAPON_MAX) {
|
||||
NPCScriptManager.getInstance().start(c, npc.getId(), "gachapon", null);
|
||||
NPCScriptManager.getInstance().start(c, npc.getId(), "gachapon");
|
||||
} else if (npc.getName().endsWith("Maple TV")) {
|
||||
NPCScriptManager.getInstance().start(c, npc.getId(), "mapleTV", null);
|
||||
NPCScriptManager.getInstance().start(c, npc.getId(), "mapleTV");
|
||||
} else if (YamlConfig.config.server.USE_REBIRTH_SYSTEM && npc.getId() == YamlConfig.config.server.REBIRTH_NPC_ID) {
|
||||
NPCScriptManager.getInstance().start(c, npc.getId(), "rebirth", null);
|
||||
NPCScriptManager.getInstance().start(c, npc.getId(), "rebirth");
|
||||
} else {
|
||||
boolean hasNpcScript = NPCScriptManager.getInstance().start(c, npc.getId(), oid, null);
|
||||
if (!hasNpcScript) {
|
||||
@@ -97,9 +97,9 @@ public final class NPCTalkHandler extends AbstractPacketHandler {
|
||||
NPCScriptManager nsm = NPCScriptManager.getInstance();
|
||||
|
||||
if (pnpc.getScriptId() < NpcId.CUSTOM_DEV && !nsm.isNpcScriptAvailable(c, "" + pnpc.getScriptId())) {
|
||||
nsm.start(c, pnpc.getScriptId(), "rank_user", null);
|
||||
nsm.start(c, pnpc.getScriptId(), "rank_user");
|
||||
} else {
|
||||
nsm.start(c, pnpc.getScriptId(), null);
|
||||
nsm.start(c, pnpc.getScriptId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,6 @@ public final class RemoteGachaponHandler extends AbstractPacketHandler {
|
||||
} else {
|
||||
npcId = gacha == 8 ? NpcId.GACHAPON_NLC : NpcId.GACHAPON_NAUTILUS;
|
||||
}
|
||||
NPCScriptManager.getInstance().start(c, npcId, "gachaponRemote", null);
|
||||
NPCScriptManager.getInstance().start(c, npcId, "gachaponRemote");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,9 +77,9 @@ public class MatchCheckerCPQChallenge implements MatchCheckerListenerRecipe {
|
||||
}
|
||||
|
||||
if (message.contentEquals("cpq1")) {
|
||||
NPCScriptManager.getInstance().start("cpqchallenge", ldr.getClient(), npcid, chrMembers);
|
||||
NPCScriptManager.getInstance().startCpqScript("cpqchallenge", ldr.getClient(), npcid, chrMembers);
|
||||
} else {
|
||||
NPCScriptManager.getInstance().start("cpqchallenge2", ldr.getClient(), npcid, chrMembers);
|
||||
NPCScriptManager.getInstance().startCpqScript("cpqchallenge2", ldr.getClient(), npcid, chrMembers);
|
||||
}
|
||||
|
||||
cm.sendOk(LanguageConstants.getMessage(chr, LanguageConstants.CPQChallengeRoomSent));
|
||||
|
||||
Reference in New Issue
Block a user