Package com.l2jfrozen.gameserver.network.serverpackets

Examples of com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage


   
    if (_classesToTeach == null)
    {
      if (player.isGM())
      {
        NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
        TextBuilder sb = new TextBuilder();
        sb.append("<html><body>");
        sb.append("I cannot teach you. My class list is empty.<br> Ask admin to fix it. Need add my npcid and classes to skill_learn.sql.<br>NpcId:" + npcId + ", Your classId:" + player.getClassId().getId() + "<br>");
        sb.append("</body></html>");
        html.setHtml(sb.toString());
        player.sendPacket(html);
        html = null;
        sb = null;
        return;
      }
     
      player.sendMessage("Error learning skills, contact the admin.");
      return;
    }
   
    if (!getTemplate().canTeach(classId))
    {
      NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
      TextBuilder sb = new TextBuilder();
      sb.append("<html><body>");
      sb.append("I cannot teach you any skills.<br> You must find your current class teachers.");
      sb.append("</body></html>");
      html.setHtml(sb.toString());
      player.sendPacket(html);
      html = null;
      sb = null;
      return;
    }
View Full Code Here


   
    if (_classesToTeach == null)
    {
      if (player.isGM())
      {
        NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
        TextBuilder sb = new TextBuilder();
        sb.append("<html><body>");
        sb.append("I cannot teach you. My class list is empty.<br> Ask admin to fix it. Need add my npcid and classes to skill_learn.sql.<br>NpcId:" + npcId + ", Your classId:" + player.getClassId().getId() + "<br>");
        sb.append("</body></html>");
        html.setHtml(sb.toString());
        player.sendPacket(html);
        html = null;
        sb = null;
        return;
      }
     
      player.sendMessage("Error learning skills, contact the admin.");
      return;
    }
   
    if (!getTemplate().canTeach(classId))
    {
      NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
      TextBuilder sb = new TextBuilder();
      sb.append("<html><body>");
      sb.append("I cannot teach you any skills.<br> You must find your current class teachers.");
      sb.append("</body></html>");
      html.setHtml(sb.toString());
      player.sendPacket(html);
      html = null;
      sb = null;
      return;
    }
    if (player.getClassId().getId() < 88)
    {
      NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
      TextBuilder sb = new TextBuilder();
      sb.append("<html><body>");
      sb.append("You must have 3rd class change quest completed.");
      sb.append("</body></html>");
      html.setHtml(sb.toString());
      player.sendPacket(html);
      html = null;
      sb = null;
      return;
    }
   
    L2EnchantSkillLearn[] skills = SkillTreeTable.getInstance().getAvailableEnchantSkills(player);
    ExEnchantSkillList esl = new ExEnchantSkillList();
    int counts = 0;
   
    for (L2EnchantSkillLearn s : skills)
    {
      L2Skill sk = SkillTable.getInstance().getInfo(s.getId(), s.getLevel());
      if (sk == null)
      {
        continue;
      }
      counts++;
      esl.addSkill(s.getId(), s.getLevel(), s.getSpCost(), s.getExp());
    }
    if (counts == 0)
    {
      player.sendPacket(new SystemMessage(SystemMessageId.THERE_IS_NO_SKILL_THAT_ENABLES_ENCHANT));
      NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
      int level = player.getLevel();
     
      if (level < 74)
      {
        SystemMessage sm = new SystemMessage(SystemMessageId.DO_NOT_HAVE_FURTHER_SKILLS_TO_LEARN);
        sm.addNumber(level);
        player.sendPacket(sm);
      }
      else
      {
        TextBuilder sb = new TextBuilder();
        sb.append("<html><body>");
        sb.append("You've learned all skills for your class.<br>");
        sb.append("</body></html>");
        html.setHtml(sb.toString());
        player.sendPacket(html);
        html = null;
        sb = null;
      }
    }
View Full Code Here

    AdminHelpPage.showHelpPage(activeChar, "pforge1.htm");
  }

  private void showPage2(L2PcInstance activeChar, String format)
  {
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    adminReply.setFile("data/html/admin/pforge2.htm");
    adminReply.replace("%format%", format);
    TextBuilder replyMSG = new TextBuilder();

    for(int i = 0; i < format.length(); i++)
    {
      replyMSG.append(format.charAt(i) + " : <edit var=\"v" + i + "\" width=100><br1>");
    }

    adminReply.replace("%valueditors%", replyMSG.toString());
    replyMSG.clear();

    for(int i = 0; i < format.length(); i++)
    {
      replyMSG.append(" \\$v" + i);
    }

    adminReply.replace("%send%", replyMSG.toString());
    activeChar.sendPacket(adminReply);

    replyMSG = null;
    adminReply = null;
  }
View Full Code Here

    adminReply = null;
  }

  private void showPage3(L2PcInstance activeChar, String format, String command)
  {
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    adminReply.setFile("data/html/admin/pforge3.htm");
    adminReply.replace("%format%", format);
    adminReply.replace("%command%", command);
    activeChar.sendPacket(adminReply);
    adminReply = null;
  }
View Full Code Here

      else
      {
        // If player is a lord of this manor, alternative message from NPC
        if(CastleManorManager.getInstance().isDisabled())
        {
          NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
          html.setFile("data/html/npcdefault.htm");
          html.replace("%objectId%", String.valueOf(getObjectId()));
          html.replace("%npcname%", getName());
          player.sendPacket(html);
          html = null;
        }
        else if(!player.isGM() // Player is not GM
            && getCastle() != null && getCastle().getCastleId() > 0 // Verification of castle
View Full Code Here

    // to initial screen.
  }

  private void showMessageWindow(L2PcInstance player, String filename)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
    html.setFile(getHtmlPath() + filename);
    html.replace("%objectId%", String.valueOf(getObjectId()));
    html.replace("%npcId%", String.valueOf(getNpcId()));
    html.replace("%npcname%", getName());
    player.sendPacket(html);
    html = null;
  }
View Full Code Here

  {
    final int objId = activeChar.getObjectId();
    final L2Bookmark[] bookmarks = BookmarkTable.getInstance().getBookmarks(objId);
   
    // Load static Htm.
    NpcHtmlMessage adminReply = new NpcHtmlMessage(1);
    adminReply.setFile("data/html/admin/bk.htm");
   
    if (bookmarks == null)
    {
      adminReply.replace("%locs%", "<tr><td>No bookmarks are currently registered.</td></tr>");
      activeChar.sendPacket(adminReply);
      return;
    }
   
    if (page > bookmarks.length / PAGE_LIMIT + 1 || page < 1)
      return;
   
    int max = bookmarks.length / PAGE_LIMIT;
    if (bookmarks.length > PAGE_LIMIT * max)
      max++;
   
    int start = ((page - 1) * PAGE_LIMIT);
    int end = Math.min(((page - 1) * PAGE_LIMIT) + PAGE_LIMIT, bookmarks.length);
   
    // Generate data.
    final StringBuilder replyMSG = new StringBuilder(500 + bookmarks.length * 200);
   
    String name, x, y, z;
   
    for (int i = start; i < end; i++)
    {
      L2Bookmark bk = bookmarks[i];
      if (bk != null)
      {
        name = bk.getName();
        x = String.valueOf(bk.getX());
        y = String.valueOf(bk.getY());
        z = String.valueOf(bk.getZ());
       
        StringUtil.append(replyMSG, "<tr><td><a action=\"bypass -h admin_move_to ", x, " ", y, " ", z, "\">", name, " (", x, " ", y, " ", z, ")", "</a></td><td><a action=\"bypass -h admin_delbk ", name, "\">Remove</a></td></tr>");
      }
    }
   
    // End of table, open a new table for pages system.
    replyMSG.append("</table><br><table width=270 bgcolor=444444><tr><td>Page: ");
    for (int x1 = 0; x1 < max; x1++)
    {
      int pagenr = x1 + 1;
      if (page == pagenr)
      {
        replyMSG.append(pagenr);
        replyMSG.append("|");
      }
      else
      {
        replyMSG.append("<a action=\"bypass -h admin_bkpage ");
        replyMSG.append(x1 + 1);
        replyMSG.append("\">");
        replyMSG.append(pagenr);
        replyMSG.append("</a>|");
      }
    }
    replyMSG.append("</td></tr>");
   
    adminReply.replace("%locs%", replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

        su.addAttribute(StatusUpdate.MAX_HP, getMaxHp());
        player.sendPacket(su);
        su = null;
      }

      NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
      TextBuilder html1 = new TextBuilder("<html><body><table border=0>");
      html1.append("<tr><td>Current Target:</td></tr>");
      html1.append("<tr><td><br></td></tr>");

      html1.append("<tr><td>Object ID: " + getObjectId() + "</td></tr>");
      html1.append("<tr><td>Template ID: " + getTemplate().npcId + "</td></tr>");
      html1.append("<tr><td><br></td></tr>");

      html1.append("<tr><td>HP: " + getCurrentHp() + "</td></tr>");
      html1.append("<tr><td>MP: " + getCurrentMp() + "</td></tr>");
      html1.append("<tr><td>Level: " + getLevel() + "</td></tr>");
      html1.append("<tr><td><br></td></tr>");

      html1.append("<tr><td>Class: " + getClass().getName() + "</td></tr>");
      html1.append("<tr><td><br></td></tr>");

      //changed by terry 2005-02-22 21:45
      html1.append("</table><table><tr><td><button value=\"Edit NPC\" action=\"bypass -h admin_edit_npc " + getTemplate().npcId + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
      html1.append("<td><button value=\"Kill\" action=\"bypass -h admin_kill\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr>");
      html1.append("<tr><td><button value=\"Show DropList\" action=\"bypass -h admin_show_droplist " + getTemplate().npcId + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr>");
      html1.append("<td><button value=\"Delete\" action=\"bypass -h admin_delete\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr>");
      html1.append("</table>");

      if(player.isGM())
      {
        html1.append("<button value=\"View Shop\" action=\"bypass -h admin_showShop " + getTemplate().npcId + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></br>");
        html1.append("<button value=\"Lease next week\" action=\"bypass -h npc_" + getObjectId() + "_Lease\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
        html1.append("<button value=\"Abort current leasing\" action=\"bypass -h npc_" + getObjectId() + "_Lease next\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
        html1.append("<button value=\"Manage items\" action=\"bypass -h npc_" + getObjectId() + "_Lease manage\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
      }

      html1.append("</body></html>");

      html.setHtml(html1.toString());
      player.sendPacket(html);
      html = null;
      html1 = null;
    }
    player.sendPacket(ActionFailed.STATIC_PACKET);
View Full Code Here

    return (level >= REQUIRED_LEVEL);
  }

  public void showMainPage(L2PcInstance activeChar)
  {
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    final StringBuilder replyMSG = StringUtil.startAppend(1000, "<html><body>");

    replyMSG.append("<center><font color=\"LEVEL\">[Raid Engine]</font></center><br><br><br>");
    replyMSG.append("<table><tr><td><edit var=\"input1\" width=\"125\"></td><td><edit var=\"input2\" width=\"125\"></td></tr></table>");
    replyMSG.append("<table border=\"0\"><tr>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Name\" action=\"bypass -h admin_rai_name $input1\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Description\" action=\"bypass -h admin_rai_desc $input1\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Join Location\" action=\"bypass -h admin_rai_join_loc $input1\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Max lvl\" action=\"bypass -h admin_rai_maxlvl $input1\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Min lvl\" action=\"bypass -h admin_rai_minlvl $input1\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Max players\" action=\"bypass -h admin_rai_maxplayers $input1\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Min players\" action=\"bypass -h admin_rai_minplayers $input1\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG
        .append("<td width=\"100\"><button value=\"NPC\" action=\"bypass -h admin_rai_npc $input1\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG
        .append("<td width=\"100\"><button value=\"NPC Pos\" action=\"bypass -h admin_rai_npc_pos\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG
        .append("</tr><tr><td width=\"100\"><button value=\"Raidboss\" action=\"bypass -h admin_rai_bos $input1\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Raidboss Pos\" action=\"bypass -h admin_rai_boss_pos\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Reward\" action=\"bypass -h admin_rai_reward $input1\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Reward Amount\" action=\"bypass -h admin_rai_reward_amount $input1\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");

    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Join Time\" action=\"bypass -h admin_rai_jointime $input1\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Event Time\" action=\"bypass -h admin_rai_eventtime $input1\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG.append("</tr></table><br><table><tr>");

    replyMSG
        .append("<td width=\"100\"><button value=\"Fight Pos\" action=\"bypass -h admin_rai_team_pos $input1\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG.append("</tr></table><table><tr>");

    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Join\" action=\"bypass -h admin_rai_join\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Teleport\" action=\"bypass -h admin_rai_teleport\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Start\" action=\"bypass -h admin_rai_start\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG.append("</tr></table><table><tr>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Abort\" action=\"bypass -h admin_rai_abort\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Finish\" action=\"bypass -h admin_rai_finish\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Sit Force\" action=\"bypass -h admin_rai_sit\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG.append("</tr></table><br><br><table><tr>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Save\" action=\"bypass -h admin_rai_save\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Load\" action=\"bypass -h admin_rai_load\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG
        .append("<td width=\"100\"><button value=\"Auto Event\" action=\"bypass -h admin_rai_autoevent\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
    replyMSG.append("</tr></table><br><br>");
    replyMSG.append("Current event...<br1>");
    replyMSG.append("    ... name:&nbsp;<font color=\"00FF00\">" + Raid._eventName + "</font><br1>");
    replyMSG.append("    ... description:&nbsp;<font color=\"00FF00\">" + Raid._eventDesc + "</font><br1>");
    replyMSG.append("    ... joining location name:&nbsp;<font color=\"00FF00\">" + Raid._joiningLocationName + "</font><br1>");
    replyMSG.append("    ... joining NPC ID:&nbsp;<font color=\"00FF00\">" + Raid._npcId + " on pos " + Raid._npcX + "," + Raid._npcY + "," + Raid._npcZ
        + "</font><br1>");
    replyMSG.append("    ... Raidboss ID:&nbsp;<font color=\"00FF00\">" + Raid._bossId + " on pos " + Raid._bossX + "," + Raid._bossY + "," + Raid._bossZ
        + "</font><br1>");
    replyMSG.append("    ... Fight pos:&nbsp;<font color=\"00FF00\">" + Raid._startX + "," + Raid._startY + "," + Raid._startZ
        + "</font><br1>");
    replyMSG.append("    ... reward ID:&nbsp;<font color=\"00FF00\">" + Raid._rewardId + "</font><br1>");
    replyMSG.append("    ... reward Amount:&nbsp;<font color=\"00FF00\">" + Raid._rewardAmount + "</font><br><br>");
    replyMSG.append("    ... Min lvl:&nbsp;<font color=\"00FF00\">" + Raid._minlvl + "</font><br>");
    replyMSG.append("    ... Max lvl:&nbsp;<font color=\"00FF00\">" + Raid._maxlvl + "</font><br><br>");
    replyMSG.append("    ... Min Players:&nbsp;<font color=\"00FF00\">" + Raid._minPlayers + "</font><br>");
    replyMSG.append("    ... Max Players:&nbsp;<font color=\"00FF00\">" + Raid._maxPlayers + "</font><br><br>");
    replyMSG.append("    ... Joining Time:&nbsp;<font color=\"00FF00\">" + Raid._joinTime + "</font><br>");
    replyMSG.append("    ... Event Timer:&nbsp;<font color=\"00FF00\">" + Raid._eventTime + "</font><br><br>");
    replyMSG.append("<center><table border=\"0\">");

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

    replyMSG.append("</body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

      htmlContent.append("</td><td>" + currPetition.getPetitioner().getName() + "</td><td>" + currPetition.getTypeAsString() + "</td><td>" + dateFormat.format(new Date(currPetition.getSubmitTime())) + "</td></tr>");
    }

    htmlContent.append("</table><br><button value=\"Refresh\" action=\"bypass -h admin_view_petitions\" width=\"50\" " + "height=\"15\" back=\"sek.cbui94\" fore=\"sek.cbui92\"><br><button value=\"Back\" action=\"bypass -h admin_admin\" " + "width=\"40\" height=\"15\" back=\"sek.cbui94\" fore=\"sek.cbui92\"></center></body></html>");

    NpcHtmlMessage htmlMsg = new NpcHtmlMessage(0);
    htmlMsg.setHtml(htmlContent.toString());
    activeChar.sendPacket(htmlMsg);
    htmlMsg = null;
  }
View Full Code Here

TOP

Related Classes of com.l2jfrozen.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.