Beispiel #1
0
  private void showTeleportWindow(Player activeChar) {
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    StringBuilder replyMSG = new StringBuilder("<html><title>Teleport Menu</title>");
    replyMSG.append("<body>");

    replyMSG.append("<br>");
    replyMSG.append("<center><table>");

    replyMSG.append(
        "<tr><td><button value=\"  \" action=\"bypass -h admin_tele\" width=70 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append(
        "<td><button value=\"North\" action=\"bypass -h admin_gonorth\" width=70 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append(
        "<td><button value=\"Up\" action=\"bypass -h admin_goup\" width=70 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td></tr>");
    replyMSG.append(
        "<tr><td><button value=\"West\" action=\"bypass -h admin_gowest\" width=70 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append(
        "<td><button value=\"  \" action=\"bypass -h admin_tele\" width=70 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append(
        "<td><button value=\"East\" action=\"bypass -h admin_goeast\" width=70 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td></tr>");
    replyMSG.append(
        "<tr><td><button value=\"  \" action=\"bypass -h admin_tele\" width=70 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append(
        "<td><button value=\"South\" action=\"bypass -h admin_gosouth\" width=70 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append(
        "<td><button value=\"Down\" action=\"bypass -h admin_godown\" width=70 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td></tr>");

    replyMSG.append("</table></center>");
    replyMSG.append("</body></html>");

    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
Beispiel #2
0
  private static boolean ShowQuestState(QuestState qs, Player activeChar) {
    Map<String, String> vars = qs.getVars();
    int id = qs.getQuest().getQuestIntId();
    String char_name = qs.getPlayer().getName();

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    StringBuilder replyMSG = new StringBuilder("<html><body>");
    replyMSG.append(fmtHEAD.sprintf(new Object[] {qs.getQuest().getClass().getSimpleName(), id}));
    replyMSG.append("<table width=260>");
    replyMSG.append(fmtRow.sprintf(new Object[] {"PLAYER: ", char_name, ""}));
    replyMSG.append(
        fmtRow.sprintf(
            new Object[] {
              "STATE: ",
              qs.getStateName(),
              fmtSetButton.sprintf(new Object[] {id, "STATE", "$new_val", char_name, ""})
            }));
    for (String key : vars.keySet())
      if (!key.equalsIgnoreCase("<state>"))
        replyMSG.append(
            fmtRow.sprintf(
                new Object[] {
                  key + ": ",
                  vars.get(key),
                  fmtSetButton.sprintf(new Object[] {id, "VAR", key, "$new_val", char_name})
                }));
    replyMSG.append(
        fmtRow.sprintf(
            new Object[] {
              "<edit var=\"new_name\" width=50 height=12>",
              "~new var~",
              fmtSetButton.sprintf(new Object[] {id, "VAR", "$new_name", "$new_val", char_name})
            }));
    replyMSG.append("</table>");
    replyMSG.append(fmtFOOT.sprintf(new Object[] {id, char_name, char_name}));
    replyMSG.append("</body></html>");

    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
    vars.clear();
    return true;
  }
Beispiel #3
0
  private static boolean ShowQuestList(Player targetChar, Player activeChar) {
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    StringBuilder replyMSG = new StringBuilder("<html><body><table width=260>");
    for (QuestState qs : targetChar.getAllQuestsStates())
      if (qs != null && qs.getQuest().getQuestIntId() != 255)
        replyMSG.append(
            fmtListRow.sprintf(
                new Object[] {
                  qs.getQuest().getQuestIntId(),
                  targetChar.getName(),
                  qs.getQuest().getName(),
                  qs.getStateName()
                }));
    replyMSG.append(fmtListNew.sprintf(new Object[] {targetChar.getName()}));
    replyMSG.append("</table></body></html>");

    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);

    return true;
  }
Beispiel #4
0
  private void showTeleportCharWindow(Player activeChar) {
    GameObject target = activeChar.getTarget();
    Player player = null;
    if (target.isPlayer()) player = (Player) target;
    else {
      activeChar.sendPacket(Msg.INVALID_TARGET);
      return;
    }
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    StringBuilder replyMSG = new StringBuilder("<html><title>Teleport Character</title>");
    replyMSG.append("<body>");
    replyMSG.append("The character you will teleport is " + player.getName() + ".");
    replyMSG.append("<br>");

    replyMSG.append("Co-ordinate x");
    replyMSG.append("<edit var=\"char_cord_x\" width=110>");
    replyMSG.append("Co-ordinate y");
    replyMSG.append("<edit var=\"char_cord_y\" width=110>");
    replyMSG.append("Co-ordinate z");
    replyMSG.append("<edit var=\"char_cord_z\" width=110>");
    replyMSG.append(
        "<button value=\"Teleport\" action=\"bypass -h admin_teleport_character $char_cord_x $char_cord_y $char_cord_z\" width=60 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\">");
    replyMSG.append(
        "<button value=\"Teleport near you\" action=\"bypass -h admin_teleport_character "
            + activeChar.getX()
            + " "
            + activeChar.getY()
            + " "
            + activeChar.getZ()
            + "\" width=115 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\">");
    replyMSG.append(
        "<center><button value=\"Back\" action=\"bypass -h admin_current_player\" width=40 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></center>");
    replyMSG.append("</body></html>");

    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }