Package lineage2.gameserver.network.serverpackets

Examples of lineage2.gameserver.network.serverpackets.NpcHtmlMessage


  public static void showInfo(Player player, NpcInstance npc)
  {
    final int diff = npc.calculateLevelDiffForDrop(player.isInParty() ? player.getParty().getLevel() : player.getLevel());
    double mod = npc.calcStat(Stats.REWARD_MULTIPLIER, 1., player, null);
    mod *= Experience.penaltyModifier(diff, 9);
    final NpcHtmlMessage htmlMessage = new NpcHtmlMessage(5);
    htmlMessage.replace("%npc_name%", HtmlUtils.htmlNpcName(npc.getNpcId()));
    if (mod <= 0)
    {
      htmlMessage.setFile("actions/rewardlist_to_weak.htm");
      player.sendPacket(htmlMessage);
      return;
    }
    if (npc.getTemplate().getRewards().isEmpty())
    {
      htmlMessage.setFile("actions/rewardlist_empty.htm");
      player.sendPacket(htmlMessage);
      return;
    }
    htmlMessage.setFile("actions/rewardlist_info.htm");
    final StringBuilder builder = new StringBuilder(100);
    for (Map.Entry<RewardType, RewardList> entry : npc.getTemplate().getRewards().entrySet())
    {
      RewardList rewardList = entry.getValue();
      switch (entry.getKey())
      {
        case RATED_GROUPED:
          ratedGroupedRewardList(builder, npc, rewardList, player, mod);
          break;
        case NOT_RATED_GROUPED:
          notRatedGroupedRewardList(builder, rewardList, mod);
          break;
        case NOT_RATED_NOT_GROUPED:
          notGroupedRewardList(builder, rewardList, 1.0, mod);
          break;
        case SWEEP:
          notGroupedRewardList(builder, rewardList, (Config.RATE_DROP_SPOIL + player.getVitalityBonus()) * player.getRateSpoil(), mod);
          break;
      }
    }
    htmlMessage.replace("%info%", builder.toString());
    player.sendPacket(htmlMessage);
  }
View Full Code Here


            ReflectionUtils.getDoor(i).closeMe();
          }
        }
        break;
      case COND_SIEGE:
        player.sendPacket(new NpcHtmlMessage(player, this, _siegeDialog, 0));
        break;
      case COND_FAIL:
        player.sendPacket(new NpcHtmlMessage(player, this, _failDialog, 0));
        break;
    }
  }
View Full Code Here

        break;
      case COND_FAIL:
        filename = _failDialog;
        break;
    }
    player.sendPacket(new NpcHtmlMessage(player, this, filename, val));
  }
View Full Code Here

        htmlContent.append("<tr><td><font color=\"LEVEL\">There is more pending petition...</font><br></td></tr>");
        break;
      }
    }
    htmlContent.append("</table></center></body></html>");
    NpcHtmlMessage htmlMsg = new NpcHtmlMessage(0);
    htmlMsg.setHtml(htmlContent.toString());
    activeChar.sendPacket(htmlMsg);
  }
View Full Code Here

   * @param npc NpcInstance
   * @param member Player
   */
  public static void showHtmlFile(Player player, String file, NpcInstance npc, Player member)
  {
    final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
    html.setFile("SepulcherNpc/" + file);
    if (member != null)
    {
      html.replace("%member%", member.getName());
    }
    player.sendPacket(html);
  }
View Full Code Here

    int CharactersEnd = players.size();
    if ((CharactersEnd - CharactersStart) > MaxCharactersPerPage)
    {
      CharactersEnd = CharactersStart + MaxCharactersPerPage;
    }
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    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_admin\" 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>");
    replyMSG.append("<tr><td width=270>You can find a character by writing his name and</td></tr>");
    replyMSG.append("<tr><td width=270>clicking Find bellow.<br></td></tr>");
    replyMSG.append("<tr><td width=270>Note: Names should be written case sensitive.</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><br><br>");
    for (int x = 0; x < MaxPages; x++)
    {
      int pagenr = x + 1;
      replyMSG.append("<center><a action=\"bypass -h admin_show_characters " + x + "\">Page " + pagenr + "</a></center>");
    }
    replyMSG.append("<br>");
    replyMSG.append("<table width=270>");
    replyMSG.append("<tr><td width=80>Name:</td><td width=110>Class:</td><td width=40>Level:</td></tr>");
    for (int i = CharactersStart; i < CharactersEnd; i++)
    {
      Player p = players.get(i);
      replyMSG.append("<tr><td width=80>" + "<a action=\"bypass -h admin_character_list " + p.getName() + "\">" + p.getName() + "</a></td><td width=110>" + HtmlUtils.htmlClassName(p.getClassId().getId()) + "</td><td width=40>" + p.getLevel() + "</td></tr>");
    }
    replyMSG.append("</table>");
    replyMSG.append("</body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

  {
    if (!canBypassCheck(player, this))
    {
      return;
    }
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    if (command.equalsIgnoreCase("crp"))
    {
      if ((player.getClan() != null) && (player.getClan().getLevel() > 4))
      {
        html.setFile("default/" + getNpcId() + "-2.htm");
      }
      else
      {
        html.setFile("default/" + getNpcId() + "-1.htm");
      }
      html.replace("%objectId%", String.valueOf(getObjectId()));
      player.sendPacket(html);
    }
    else if (command.startsWith("exchange"))
    {
      if (!player.isClanLeader())
      {
        html.setFile("default/" + getNpcId() + "-no.htm");
        html.replace("%objectId%", String.valueOf(getObjectId()));
        player.sendPacket(html);
        return;
      }
      int itemId = Integer.parseInt(command.substring(9).trim());
      int reputation = 0;
      long itemCount = 0;
      switch (itemId)
      {
        case 9911:
          reputation = 500;
          itemCount = 1;
          break;
        case 9910:
          reputation = 200;
          itemCount = 10;
          break;
        case 9912:
          reputation = 20;
          itemCount = 100;
          break;
      }
      if (player.getInventory().destroyItemByItemId(itemId, itemCount))
      {
        player.getClan().incReputation(reputation, false, "ClanTrader " + itemId + " from " + player.getName());
        player.getClan().broadcastToOnlineMembers(new PledgeShowInfoUpdate(player.getClan()));
        player.sendPacket(new SystemMessage(SystemMessage.YOUR_CLAN_HAS_ADDED_1S_POINTS_TO_ITS_CLAN_REPUTATION_SCORE).addNumber(reputation));
        html.setFile("default/" + getNpcId() + "-ExchangeSuccess.htm");
      }
      else
      {
        html.setFile("default/" + getNpcId() + "-ExchangeFailed.htm");
      }
      html.replace("%objectId%", String.valueOf(getObjectId()));
      player.sendPacket(html);
    }
    else
    {
      super.onBypassFeedback(player, command);
View Full Code Here

      clanName = player.getClan().getName() + "/" + player.getClan().getLevel();
    }
    NumberFormat df = NumberFormat.getNumberInstance(Locale.ENGLISH);
    df.setMaximumFractionDigits(4);
    df.setMinimumFractionDigits(1);
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    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><br>");
    replyMSG.append("<table width=270>");
    replyMSG.append("<tr><td width=100>Account/IP:</td><td>" + player.getAccountName() + "/" + player.getIP() + "</td></tr>");
    replyMSG.append("<tr><td width=100>Name/Level:</td><td>" + player.getName() + "/" + player.getLevel() + "</td></tr>");
    replyMSG.append("<tr><td width=100>Class/Id:</td><td>" + HtmlUtils.htmlClassName(player.getClassId().getId()) + "/" + player.getClassId().getId() + "</td></tr>");
    replyMSG.append("<tr><td width=100>Clan/Level:</td><td>" + clanName + "</td></tr>");
    replyMSG.append("<tr><td width=100>Exp/Sp:</td><td>" + player.getExp() + "/" + player.getSp() + "</td></tr>");
    replyMSG.append("<tr><td width=100>Cur/Max Hp:</td><td>" + (int) player.getCurrentHp() + "/" + player.getMaxHp() + "</td></tr>");
    replyMSG.append("<tr><td width=100>Cur/Max Mp:</td><td>" + (int) player.getCurrentMp() + "/" + player.getMaxMp() + "</td></tr>");
    replyMSG.append("<tr><td width=100>Cur/Max Load:</td><td>" + player.getCurrentLoad() + "/" + player.getMaxLoad() + "</td></tr>");
    replyMSG.append("<tr><td width=100>Patk/Matk:</td><td>" + player.getPAtk(null) + "/" + player.getMAtk(null, null) + "</td></tr>");
    replyMSG.append("<tr><td width=100>Pdef/Mdef:</td><td>" + player.getPDef(null) + "/" + player.getMDef(null, null) + "</td></tr>");
    replyMSG.append("<tr><td width=100>PAtkSpd/MAtkSpd:</td><td>" + player.getPAtkSpd() + "/" + player.getMAtkSpd() + "</td></tr>");
    replyMSG.append("<tr><td width=100>Acc/Evas:</td><td>" + player.getAccuracy() + "/" + player.getEvasionRate(null) + "</td></tr>");
    replyMSG.append("<tr><td width=100>Crit/MCrit:</td><td>" + player.getCriticalHit(null, null) + "/" + df.format(player.getMagicCriticalRate(null, null)) + "%</td></tr>");
    replyMSG.append("<tr><td width=100>CritDmg/MCritDmg:</td><td>" + player.getCriticalDmg(null, null) + "/" + player.getMagicCriticalDmg(null, null) + "</td></tr>");
    replyMSG.append("<tr><td width=100>Walk/Run:</td><td>" + player.getWalkSpeed() + "/" + player.getRunSpeed() + "</td></tr>");
    replyMSG.append("<tr><td width=100>Karma/Fame:</td><td>" + player.getKarma() + "/" + player.getFame() + "</td></tr>");
    replyMSG.append("<tr><td width=100>PvP/PK:</td><td>" + player.getPvpKills() + "/" + player.getPkKills() + "</td></tr>");
    replyMSG.append("<tr><td width=100>Coordinates:</td><td>" + player.getX() + "," + player.getY() + "," + player.getZ() + "</td></tr>");
    replyMSG.append("<tr><td width=100>Direction:</td><td>" + PositionUtils.getDirectionTo(player, activeChar) + "</td></tr>");
    replyMSG.append("</table><br>");
    replyMSG.append("<table<tr>");
    replyMSG.append("<td><button value=\"Skills\" action=\"bypass -h admin_show_skills\" width=80 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("<td><button value=\"Effects\" action=\"bypass -h admin_show_effects\" width=80 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("<td><button value=\"Actions\" action=\"bypass -h admin_character_actions\" width=80 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("</tr><tr>");
    replyMSG.append("<td><button value=\"Stats\" action=\"bypass -h admin_edit_character\" width=80 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("<td><button value=\"Exp & Sp\" action=\"bypass -h admin_add_exp_sp_to_character\" width=80 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("<td></td>");
    replyMSG.append("</tr></table></body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

    {
      activeChar.sendPacket(Msg.SELECT_TARGET);
      return;
    }
    Player player = (Player) target;
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    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("<center>Editing character: " + player.getName() + "</center><br>");
    replyMSG.append("<table width=250>");
    replyMSG.append("<tr><td width=40></td><td width=70>Curent:</td><td width=70>Max:</td><td width=70></td></tr>");
    replyMSG.append("<tr><td width=40>HP:</td><td width=70>" + player.getCurrentHp() + "</td><td width=70>" + player.getMaxHp() + "</td><td width=70>Karma: " + player.getKarma() + "</td></tr>");
    replyMSG.append("<tr><td width=40>MP:</td><td width=70>" + player.getCurrentMp() + "</td><td width=70>" + player.getMaxMp() + "</td><td width=70>Pvp Kills: " + player.getPvpKills() + "</td></tr>");
    replyMSG.append("<tr><td width=40>Load:</td><td width=70>" + player.getCurrentLoad() + "</td><td width=70>" + player.getMaxLoad() + "</td><td width=70>Pvp Flag: " + player.getPvpFlag() + "</td></tr>");
    replyMSG.append("</table>");
    replyMSG.append("<table width=270><tr><td>Class<?> Template Id: " + player.getClassId() + "/" + player.getClassId().getId() + "</td></tr></table><br>");
    replyMSG.append("<table width=270>");
    replyMSG.append("<tr><td>Note: Fill all values before saving the modifications.</td></tr>");
    replyMSG.append("</table><br>");
    replyMSG.append("<table width=270>");
    replyMSG.append("<tr><td width=50>Hp:</td><td><edit var=\"hp\" width=50></td><td width=50>Mp:</td><td><edit var=\"mp\" width=50></td></tr>");
    replyMSG.append("<tr><td width=50>Pvp Flag:</td><td><edit var=\"pvpflag\" width=50></td><td width=50>Karma:</td><td><edit var=\"karma\" width=50></td></tr>");
    replyMSG.append("<tr><td width=50>Class<?> Id:</td><td><edit var=\"classid\" width=50></td><td width=50>Pvp Kills:</td><td><edit var=\"pvpkills\" width=50></td></tr>");
    replyMSG.append("</table><br>");
    replyMSG.append("<center><button value=\"Save Changes\" action=\"bypass -h admin_save_modifications $hp & $mp & $karma & $pvpflag & $pvpkills & $classid &\" width=80 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></center><br>");
    replyMSG.append("</body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

    }
    else
    {
      return;
    }
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    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><br><br>");
    replyMSG.append("<center>Admin Actions for: " + player.getName() + "</center><br>");
    replyMSG.append("<center><table width=200><tr>");
    replyMSG.append("<td width=100>Argument(*):</td><td width=100><edit var=\"arg\" width=100></td>");
    replyMSG.append("</tr></table><br></center>");
    replyMSG.append("<table width=270>");
    replyMSG.append("<tr><td width=90><button value=\"Teleport\" action=\"bypass -h admin_teleportto " + player.getName() + "\" width=85 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("<td width=90><button value=\"Recall\" action=\"bypass -h admin_recall " + player.getName() + "\" width=85 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    replyMSG.append("<td width=90><button value=\"Quests\" action=\"bypass -h admin_quests " + player.getName() + "\" width=85 height=20 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td></tr>");
    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.