Package lineage2.gameserver.network.serverpackets

Examples of lineage2.gameserver.network.serverpackets.NpcHtmlMessage


   * @param activeChar Player
   * @param CharacterToFind String
   */
  private void findCharacter(Player activeChar, String CharacterToFind)
  {
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    int CharactersFound = 0;
    StringBuilder replyMSG = new StringBuilder("<html><body>");
    replyMSG.append("<table width=260><tr>");
    replyMSG.append("<td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("<td width=180><center>Character Selection Menu</center></td>");
    replyMSG.append("<td width=40><button value=\"Back\" action=\"bypass -h admin_show_characters 0\" width=40 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("</tr></table>");
    replyMSG.append("<br><br>");
    for (Player element : GameObjectsStorage.getAllPlayersForIterate())
    {
      if (element.getName().startsWith(CharacterToFind))
      {
        CharactersFound = CharactersFound + 1;
        replyMSG.append("<table width=270>");
        replyMSG.append("<tr><td width=80>Name</td><td width=110>Class</td><td width=40>Level</td></tr>");
        replyMSG.append("<tr><td width=80><a action=\"bypass -h admin_character_list " + element.getName() + "\">" + element.getName() + "</a></td><td width=110>" + HtmlUtils.htmlClassName(element.getClassId().getId()) + "</td><td width=40>" + element.getLevel() + "</td></tr>");
        replyMSG.append("</table>");
      }
    }
    if (CharactersFound == 0)
    {
      replyMSG.append("<table width=270>");
      replyMSG.append("<tr><td width=270>Your search did not find any characters.</td></tr>");
      replyMSG.append("<tr><td width=270>Please try again.<br></td></tr>");
      replyMSG.append("</table><br>");
      replyMSG.append("<center><table><tr><td>");
      replyMSG.append("<edit var=\"character_name\" width=80></td><td><button value=\"Find\" action=\"bypass -h admin_find_character $character_name\" width=40 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\">");
      replyMSG.append("</td></tr></table></center>");
    }
    else
    {
      replyMSG.append("<center><br>Found " + CharactersFound + " character");
      if (CharactersFound == 1)
      {
        replyMSG.append('.');
      }
      else if (CharactersFound > 1)
      {
        replyMSG.append("s.");
      }
    }
    replyMSG.append("</center></body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here


    else
    {
      activeChar.sendPacket(Msg.INVALID_TARGET);
      return;
    }
    final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    final StringBuilder replyMSG = new StringBuilder("<html><body>");
    replyMSG.append("<table width=260><tr>");
    replyMSG.append("<td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("<td width=180><center>Character Selection Menu</center></td>");
    replyMSG.append("<td width=40><button value=\"Back\" action=\"bypass -h admin_current_player\" width=40 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("</tr></table>");
    replyMSG.append("<br><br>");
    replyMSG.append("<table width=270><tr><td>Name: " + player.getName() + "</td></tr>");
    replyMSG.append("<tr><td>Lv: " + player.getLevel() + " " + HtmlUtils.htmlClassName(player.getClassId().getId()) + "</td></tr>");
    replyMSG.append("<tr><td>Exp: " + player.getExp() + "</td></tr>");
    replyMSG.append("<tr><td>Sp: " + player.getSp() + "</td></tr></table>");
    replyMSG.append("<br><table width=270><tr><td>Note: Dont forget that modifying players skills can</td></tr>");
    replyMSG.append("<tr><td>ruin the game...</td></tr></table><br>");
    replyMSG.append("<table width=270><tr><td>Note: Fill all values before saving the modifications.,</td></tr>");
    replyMSG.append("<tr><td>Note: Use 0 if no changes are needed.</td></tr></table><br>");
    replyMSG.append("<center><table><tr>");
    replyMSG.append("<td>Exp: <edit var=\"exp_to_add\" width=50></td>");
    replyMSG.append("<td>Sp:  <edit var=\"sp_to_add\" width=50></td>");
    replyMSG.append("<td>&nbsp;<button value=\"Save Changes\" action=\"bypass -h admin_add_exp_sp $exp_to_add & $sp_to_add &\" width=80 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("</tr></table></center>");
    replyMSG.append("<center><table><tr>");
    replyMSG.append("<td>LvL: <edit var=\"lvl\" width=50></td>");
    replyMSG.append("<td>&nbsp;<button value=\"Set Level\" action=\"bypass -h admin_setlevel $lvl\" width=80 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("</tr></table></center>");
    replyMSG.append("</body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

   * @param player Player
   */
  private void setSubclass(final Player activeChar, final Player player)
  {
    StringBuilder content = new StringBuilder("<html><body>");
    NpcHtmlMessage html = new NpcHtmlMessage(5);
    Set<ClassId> subsAvailable = SubClassInfo.getAvailableSubClasses(player, null, null, true);
    if ((subsAvailable != null) && !subsAvailable.isEmpty())
    {
      content.append("Add Subclass:<br>Which subclass do you wish to add?<br>");
      for (ClassId subClass : subsAvailable)
      {
        content.append("<a action=\"bypass -h admin_setsubclass " + subClass.ordinal() + "\">" + formatClassForDisplay(subClass) + "</a><br>");
      }
    }
    else
    {
      activeChar.sendMessage(new CustomMessage("lineage2.gameserver.model.instances.L2VillageMasterInstance.NoSubAtThisTime", activeChar));
      return;
    }
    content.append("</body></html>");
    html.setHtml(content.toString());
    activeChar.sendPacket(html);
  }
View Full Code Here

  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;
  }
View Full Code Here

   * @param activeChar Player
   * @return boolean
   */
  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;
  }
View Full Code Here

   * Method listOfInstances.
   * @param activeChar Player
   */
  private void listOfInstances(Player activeChar)
  {
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    StringBuffer replyMSG = new StringBuffer("<html><title>Instance Menu</title><body>");
    replyMSG.append("<table width=260><tr>");
    replyMSG.append("<td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("<td width=180><center>List of Instances</center></td>");
    replyMSG.append("<td width=40><button value=\"Back\" action=\"bypass -h admin_admin\" width=40 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("</tr></table><br><br>");
    for (Reflection reflection : ReflectionManager.getInstance().getAll())
    {
      if ((reflection == null) || reflection.isDefault() || reflection.isCollapseStarted())
      {
        continue;
      }
      int countPlayers = 0;
      if (reflection.getPlayers() != null)
      {
        countPlayers = reflection.getPlayers().size();
      }
      replyMSG.append("<a action=\"bypass -h admin_instance_id ").append(reflection.getId()).append(" \">").append(reflection.getName()).append('(').append(countPlayers).append(" players). Id: ").append(reflection.getId()).append("</a><br>");
    }
    replyMSG.append("<button value=\"Refresh\" action=\"bypass -h admin_instance\" width=50 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\">");
    replyMSG.append("</body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

   * @param sid String
   */
  private void listOfCharsForInstance(Player activeChar, String sid)
  {
    Reflection reflection = ReflectionManager.getInstance().get(Integer.parseInt(sid));
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    StringBuffer replyMSG = new StringBuffer("<html><title>Instance Menu</title><body><br>");
    if (reflection != null)
    {
      replyMSG.append("<table width=260><tr>");
      replyMSG.append("<td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
      replyMSG.append("<td width=180><center>List of players in ").append(reflection.getName()).append("</center></td>");
      replyMSG.append("<td width=40><button value=\"Back\" action=\"bypass -h admin_instance\" width=40 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
      replyMSG.append("</tr></table><br><br>");
      for (Player player : reflection.getPlayers())
      {
        replyMSG.append("<a action=\"bypass -h admin_teleportto ").append(player.getName()).append(" \">").append(player.getName()).append("</a><br>");
      }
    }
    else
    {
      replyMSG.append("Instance not active.<br>");
      replyMSG.append("<a action=\"bypass -h admin_instance\">Back to list.</a><br>");
    }
    replyMSG.append("</body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

   * @param arg Object[]
   */
  @Override
  public void showChatWindow(Player player, int val, Object... arg)
  {
    NpcHtmlMessage message = new NpcHtmlMessage(player, this);
    if ((_invalidatePeriod > 0) && (_invalidatePeriod < System.currentTimeMillis()))
    {
      generate();
    }
    int cond = getCond();
    switch (cond)
    {
      case COND_ALL_OK:
        message.setFile("residence2/fortress/fortress_subpower002.htm");
        onDecay();
        break;
      case COND_TIMEOUT:
        message.setFile("residence2/fortress/fortress_subpower003.htm");
        break;
      case COND_FAIL:
        message.setFile("residence2/fortress/fortress_subpower003.htm");
        _invalidatePeriod = System.currentTimeMillis() + 30000L;
        break;
      case COND_ENTERED:
        message.setFile("residence2/fortress/fortress_subpower004.htm");
        message.replaceNpcString("%password%", _index == 0 ? NpcString.THE_MARKS_HAVE_NOT_BEEN_ASSEMBLED : _index == 1 ? NpcString.THE_1ST_MARK_IS_CORRECT : NpcString.THE_2ND_MARK_IS_CORRECT);
        message.replaceNpcString("%try_count%", NpcString.ATTEMPT_S1__3_IS_IN_PROGRESS, _tryCount);
        break;
      case COND_NO_ENTERED:
        message.setFile("residence2/fortress/fortress_subpower001.htm");
        break;
    }
    player.sendPacket(message);
  }
View Full Code Here

        {
          activeChar.sendMessage("Player kicked.");
        }
      }
    }
    activeChar.sendPacket(new NpcHtmlMessage(5).setFile("admin/charmanage.htm"));
    return true;
  }
View Full Code Here

    Player player = activeChar;
    if (target.isPlayer())
    {
      player = (Player) target;
    }
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    StringBuilder replyMSG = new StringBuilder("<html><body>");
    replyMSG.append("<center><table width=260><tr><td width=40>");
    replyMSG.append("<button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\">");
    replyMSG.append("</td><td width=180>");
    replyMSG.append("<center>Enchant Equip for player: " + player.getName() + "</center>");
    replyMSG.append("</td><td width=40>");
    replyMSG.append("</td></tr></table></center><br>");
    replyMSG.append("<center><table width=270><tr><td>");
    replyMSG.append("<button value=\"Shirt\" action=\"bypass -h admin_setun $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Helmet\" action=\"bypass -h admin_seteh $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Cloak\" action=\"bypass -h admin_setba $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Mask\" action=\"bypass -h admin_setha $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Necklace\" action=\"bypass -h admin_seten $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td></tr></table>");
    replyMSG.append("</center><center><table width=270><tr><td>");
    replyMSG.append("<button value=\"Weapon\" action=\"bypass -h admin_setew $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Chest\" action=\"bypass -h admin_setec $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Shield\" action=\"bypass -h admin_setes $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Earring\" action=\"bypass -h admin_setre $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Earring\" action=\"bypass -h admin_setle $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td></tr></table>");
    replyMSG.append("</center><center><table width=270><tr><td>");
    replyMSG.append("<button value=\"Gloves\" action=\"bypass -h admin_seteg $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Leggings\" action=\"bypass -h admin_setel $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Boots\" action=\"bypass -h admin_seteb $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Ring\" action=\"bypass -h admin_setrf $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Ring\" action=\"bypass -h admin_setlf $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td></tr></table>");
    replyMSG.append("</center><center><table width=270><tr><td>");
    replyMSG.append("<button value=\"Hair\" action=\"bypass -h admin_setdha $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"R-Bracelet\" action=\"bypass -h admin_setrbr $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"L-Bracelet\" action=\"bypass -h admin_setlbr $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Belt\" action=\"bypass -h admin_setbelt $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td></tr></table>");
    replyMSG.append("</center><br>");
    replyMSG.append("<center>[Enchant 0-65535]</center>");
    replyMSG.append("<center><edit var=\"menu_command\" width=100 height=15></center><br>");
    replyMSG.append("</body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

TOP

Related Classes of lineage2.gameserver.network.serverpackets.NpcHtmlMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.