Package net.sf.l2j.gameserver.serverpackets

Examples of net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage


    int SkillsStart = MaxSkillsPerPage*page;
    int SkillsEnd = skills.length;
    if (SkillsEnd - SkillsStart > MaxSkillsPerPage)
      SkillsEnd = SkillsStart + MaxSkillsPerPage;

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    TextBuilder replyMSG = new TextBuilder("<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=\"sek.cbui94\" fore=\"sek.cbui92\"></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_skills\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    replyMSG.append("</tr></table>");
    replyMSG.append("<br><br>");
    replyMSG.append("<center>Editing <font color=\"LEVEL\">" + player.getName() + "</font></center>");
    replyMSG.append("<br><table width=270><tr><td>Lv: " + player.getLevel() + " " + player.getTemplate().className + "</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>");
    replyMSG.append("<br><center>Click on the skill you wish to remove:</center>");
    replyMSG.append("<br>");
    String pages = "<center><table width=270><tr>";
    for (int x=0; x<MaxPages; x++)
    {
      int pagenr = x + 1;
      pages += "<td><a action=\"bypass -h admin_remove_skills " + x + "\">Page " + pagenr + "</a></td>";
    }
    pages += "</tr></table></center>";
    replyMSG.append(pages);
    replyMSG.append("<br><table width=270>");
    replyMSG.append("<tr><td width=80>Name:</td><td width=60>Level:</td><td width=40>Id:</td></tr>");
    for (int i = SkillsStart; i < SkillsEnd; i++)
      replyMSG.append("<tr><td width=80><a action=\"bypass -h admin_remove_skill "+skills[i].getId()+"\">"+skills[i].getName()+"</a></td><td width=60>"+skills[i].getLevel()+"</td><td width=40>"+skills[i].getId()+"</td></tr>");
    replyMSG.append("</table>");
    replyMSG.append("<br><center><table>");
    replyMSG.append("Remove skill by ID :");
    replyMSG.append("<tr><td>Id: </td>");
    replyMSG.append("<td><edit var=\"id_to_remove\" width=110></td></tr>");
    replyMSG.append("</table></center>");
    replyMSG.append("<center><button value=\"Remove skill\" action=\"bypass -h admin_remove_skill $id_to_remove\" width=110 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></center>");
    replyMSG.append("<br><center><button value=\"Back\" action=\"bypass -h admin_current_player\" width=40 height=15></center>");
    replyMSG.append("</body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here


    else
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
      return;
    }
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    adminReply.setFile("data/html/admin/charskills.htm");
    adminReply.replace("%name%",player.getName());
    adminReply.replace("%level%",String.valueOf(player.getLevel()));
    adminReply.replace("%class%",player.getTemplate().className);
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

                else
                    filename = "data/html/castlewarehouse/castlewarehouse-" + val + ".htm";
            }
        }

        NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
        html.setFile(filename);
        html.replace("%objectId%", String.valueOf(getObjectId()));
        html.replace("%npcname%", getName());
        player.sendPacket(html);
    }
View Full Code Here

        }
      }
      else
      {
        TextBuilder replyMSG = new TextBuilder();
        NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
        adminReply.setFile("data/html/admin/cwinfo.htm");
        for (CursedWeapon cw : cwm.getCursedWeapons())
        {
          itemId=cw.getItemId();
          replyMSG.append("<table width=270><tr><td>Name:</td><td>"+cw.getName()+"</td></tr>");
          if (cw.isActivated())
          {
            L2PcInstance pl = cw.getPlayer();
            replyMSG.append("<tr><td>Weilder:</td><td>"+ (pl==null?"null" : pl.getName())+"</td></tr>");
            replyMSG.append("<tr><td>Karma:</td><td>"+String.valueOf(cw.getPlayerKarma())+"</td></tr>");
            replyMSG.append("<tr><td>Kills:</td><td>"+String.valueOf(cw.getPlayerPkKills())+"/"+String.valueOf(cw.getNbKills())+"</td></tr>");
            replyMSG.append("<tr><td>Time remaining:</td><td>"+String.valueOf(cw.getTimeLeft()/60000)+" min.</td></tr>");
            replyMSG.append("<tr><td><button value=\"Remove\" action=\"bypass -h admin_cw_remove "+String.valueOf(itemId)+"\" width=73 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
            replyMSG.append("<td><button value=\"Go\" action=\"bypass -h admin_cw_goto "+String.valueOf(itemId)+"\" width=73 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr>");
          }
          else if (cw.isDropped())
          {
            replyMSG.append("<tr><td>Position:</td><td>Lying on the ground</td></tr>");
            replyMSG.append("<tr><td>Time remaining:</td><td>"+String.valueOf(cw.getTimeLeft()/60000)+" min.</td></tr>");
            replyMSG.append("<tr><td>Kills:</td><td>"+String.valueOf(cw.getNbKills())+"</td></tr>");
            replyMSG.append("<tr><td><button value=\"Remove\" action=\"bypass -h admin_cw_remove "+String.valueOf(itemId)+"\" width=73 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
            replyMSG.append("<td><button value=\"Go\" action=\"bypass -h admin_cw_goto "+String.valueOf(itemId)+"\" width=73 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr>");
          }
          else
          {
            replyMSG.append("<tr><td>Position:</td><td>Doesn't exist.</td></tr>");
            replyMSG.append("<tr><td><button value=\"Give to Target\" action=\"bypass -h admin_cw_add "+String.valueOf(itemId)+"\" width=99 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td></td></tr>");
          }
          replyMSG.append("</table>");
          replyMSG.append("<br>");
        }
        adminReply.replace("%cwinfo%", replyMSG.toString());
        activeChar.sendPacket(adminReply);
      }
    }
    else if (command.startsWith("admin_cw_reload"))
    {
View Full Code Here

  /**
   * @param activeChar
   */
  private void showMainPage(L2PcInstance activeChar)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(1);
    html.setFile("data/html/admin/login.htm");
    html.replace("%server_name%",LoginServerThread.getInstance().getServerName());
    html.replace("%status%",LoginServerThread.getInstance().getStatusString());
    html.replace("%clock%",String.valueOf(Config.SERVER_LIST_CLOCK));
    html.replace("%brackets%",String.valueOf(Config.SERVER_LIST_BRACKET));
    html.replace("%max_players%",String.valueOf(LoginServerThread.getInstance().getMaxPlayer()));
    activeChar.sendPacket(html);
  }
View Full Code Here

  //FIXME: implement method to send html to player in L2PcInstance directly
  //PUBLIC & STATIC so other classes from package can include it directly
  public static void showHelpPage(L2PcInstance targetChar, String filename)
  {
        String content = HtmCache.getInstance().getHtmForce("data/html/admin/" + filename);
        NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
        adminReply.setHtml(content);
        targetChar.sendPacket(adminReply);
  }
View Full Code Here

    {
      _log.warning("[RequestLinkHtml] hack? link contains prohibited characters: '"+_link+"', skipped");
      return;
    }

    NpcHtmlMessage msg = new NpcHtmlMessage(0);
    msg.setFile(_link);

    sendPacket(msg);
  }
View Full Code Here

      if (Config.DEBUG)
      {
        _log.fine("Showing quest window for quest " + questId + " state " + stateId + " html path: " + path);
      }
     
      NpcHtmlMessage npcReply = new NpcHtmlMessage(5);
      npcReply.setHtml(content);
      sendPacket(npcReply);
    }
   
    sendPacket(new ActionFailed());
  }
View Full Code Here

        _jailTask = ThreadPoolManager.getInstance().scheduleGeneral(new JailTask(this), _jailTimer);
        sendMessage("You are in jail for " + delayInMinutes + " minutes.");
      }
     
      // Open a Html message to inform the player
      NpcHtmlMessage htmlMsg = new NpcHtmlMessage(0);
      String jailInfos = HtmCache.getInstance().getHtm("data/html/jail_in.htm");
      if (jailInfos != null)
      {
        htmlMsg.setHtml(jailInfos);
      }
      else
      {
        htmlMsg.setHtml("<html><body>You have been put in jail by an admin.</body></html>");
      }
      sendPacket(htmlMsg);
     
      teleToLocation(-114356, -249645, -2984, true); // Jail
    }
    else
    {
      // Open a Html message to inform the player
      NpcHtmlMessage htmlMsg = new NpcHtmlMessage(0);
      String jailInfos = HtmCache.getInstance().getHtm("data/html/jail_out.htm");
      if (jailInfos != null)
      {
        htmlMsg.setHtml(jailInfos);
      }
      else
      {
        htmlMsg.setHtml("<html><body>You are free for now, respect server rules!</body></html>");
      }
      sendPacket(htmlMsg);
     
      teleToLocation(17836, 170178, -3507, true); // Floran
    }
View Full Code Here

        int condition = validateCondition(player);
        if (condition == COND_BUSY_BECAUSE_OF_SIEGE) filename = "data/html/auction/auction-busy.htm"; // Busy because of siege
        else filename = "data/html/auction/auction.htm";

        NpcHtmlMessage html = new NpcHtmlMessage(1);
        html.setFile(filename);
        html.replace("%objectId%", String.valueOf(getObjectId()));
        html.replace("%npcId%", String.valueOf(getNpcId()));
        html.replace("%npcname%", getName());
        player.sendPacket(html);
    }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.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.