Revisions:
DP: 10449
Server: 6652
I am trying to pass my commands from a npc to enter my instanced zone:
Code: Select all
<a action="bypass -h Quest PvpInstanceManager pvpzone_enter">PVP Instance</a><br>
My class has the following:
Code: Select all
public final class PvpInstanceManager extends AbstractNpcAI implements IBypassHandler, IVoicedCommandHandler{ private static final String[] VCOMMANDS = { "pvp_enter", "pvp_leave" }; private static final String[] BCOMMANDS = { "pvpzone_enter", "pvpzone_leave" }; PvpInstanceManager() { super(PvpInstanceManager.class.getSimpleName(), PvpInstanceManager.class.getSimpleName()); VoicedCommandHandler.getInstance().registerHandler(this); BypassHandler.getInstance().registerHandler(this); } @Override public boolean useVoicedCommand(final String command, final L2PcInstance activeChar, final String target) { // enter (teleport to instance) if (command.equalsIgnoreCase(PvpInstanceManager.VCOMMANDS[0])) { teleportPlayerToInstance(activeChar); } // leave pvp instance zone else if (command.equalsIgnoreCase(PvpInstanceManager.VCOMMANDS[1])) { teleportPlayerOutOfInstance(activeChar); } return true; } @Override public boolean useBypass(final String command, final L2PcInstance activeChar, final L2Character target) { // enter (teleport to instance) if (command.equalsIgnoreCase(PvpInstanceManager.BCOMMANDS[0])) { teleportPlayerToInstance(activeChar); } // leave pvp instance zone else if (command.equalsIgnoreCase(PvpInstanceManager.BCOMMANDS[1])) { teleportPlayerOutOfInstance(activeChar); } return true; } @Override public String[] getVoicedCommandList() { PvpInstanceManager._log.info(" > Registering voiced commands handlers."); return PvpInstanceManager.VCOMMANDS; } @Override public String[] getBypassList() { PvpInstanceManager._log.info(" > Registering bypass handlers."); return PvpInstanceManager.BCOMMANDS; }}