RequestBypassToServer from everywhere ?
Posted: Thu Mar 15, 2012 4:09 pm
Hello there.
I am trying to make the bypass work from everywhere, creating something like this :
RequestBypassToServer.java
thats how i registred the bypass
Core.onBypass
The problem is that when I click it, nothing happends. HTML's are showing only the first time I click them, then they stop and send only the condition check message (so its executing the command). The idea is to go from bypass to bypass, like
Welcome blablab
Next (bypass -h newbie_next)
newbie_next
To do blablalba you must blablalba so begin
Begin (bypass -h newbie_begin)
How can I do this ?
I am trying to make the bypass work from everywhere, creating something like this :
RequestBypassToServer.java
Code: Select all
else if (_command.startsWith("newbie")) { String sub = _command.substring(7); Core.onBypass(sub, activeChar); }
Core.onBypass
Code: Select all
public static synchronized void onBypass(String command, L2PcInstance pi) { if (pi == null) return; if (command.startsWith("start")) { doCheck(pi); htmFile += "start"; htmFile += ".htm"; String htmContent = HtmCache.getInstance().getHtm(htmFile); if (htmContent != null) { NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(pi.getObjectId()); npcHtmlMessage.setHtml(htmContent); npcHtmlMessage.replace("%name%", String.valueOf(pi.getName())); pi.sendPacket(npcHtmlMessage); } } if (command.startsWith("class_gladi")) { doCheck(pi); giveImperial(pi); pi.addItem("newbieSystem", 6580, 1, pi, true); // Duals S Grade htmFile += "gladi"; htmFile += ".htm"; String htmContent = HtmCache.getInstance().getHtm(htmFile); if (htmContent != null) { NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(pi.getObjectId()); npcHtmlMessage.setHtml(htmContent); npcHtmlMessage.replace("%name%", String.valueOf(pi.getName())); pi.sendPacket(npcHtmlMessage); } } else if (command.startsWith("finish")) { doCheck(pi); htmFile += "finish"; htmFile += ".htm"; String htmContent = HtmCache.getInstance().getHtm(htmFile); if (htmContent != null) { pi.sendMessage("executing htm"); NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(pi.getObjectId()); npcHtmlMessage.setHtml(htmContent); npcHtmlMessage.replace("%name%", String.valueOf(pi.getName())); pi.sendPacket(npcHtmlMessage); pi.sendMessage("executed htm for finish"); } pi.addAdena("newbie system", 400000000, pi, true); //if (!pi.isGM()) //isdone = true; } else if (command.startsWith("telefinish")) { doCheck(pi); pi.teleToLocation(1, 1, 1); // teleport to giran ? pi.getStat().setLevel(80); } }
Welcome blablab
Next (bypass -h newbie_next)
newbie_next
To do blablalba you must blablalba so begin
Begin (bypass -h newbie_begin)
How can I do this ?