Exemple #1
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;
  }
Exemple #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;
  }