Package lineage2.gameserver.network.serverpackets

Examples of lineage2.gameserver.network.serverpackets.NpcHtmlMessage


    {
      showHtmlFile(player, res, showQuestInfo);
    }
    else
    {
      NpcHtmlMessage npcReply = showQuestInfo ? new ExNpcQuestHtmlMessage(npc == null ? 5 : npc.getObjectId(), getQuestIntId()) : new NpcHtmlMessage(npc == null ? 5 : npc.getObjectId());
      npcReply.setHtml(res);
      player.sendPacket(npcReply);
    }
    return true;
  }
View Full Code Here


  {
    final int perpage = 10;
    List<HeroDiary> mainlist = _herodiary.get(charid);
    if (mainlist != null)
    {
      NpcHtmlMessage html = new NpcHtmlMessage(activeChar, null);
      html.setFile("olympiad/monument_hero_info.htm");
      html.replace("%title%", StringHolder.getInstance().getNotNull(activeChar, "hero.diary"));
      html.replace("%heroname%", Olympiad.getNobleName(charid));
      html.replace("%message%", _heroMessage.get(charid));
      List<HeroDiary> list = new ArrayList<>(mainlist);
      Collections.reverse(list);
      boolean color = true;
      final StringBuilder fList = new StringBuilder(500);
      int counter = 0;
      int breakat = 0;
      for (int i = (page - 1) * perpage; i < list.size(); i++)
      {
        breakat = i;
        HeroDiary diary = list.get(i);
        Map.Entry<String, String> entry = diary.toString(activeChar);
        fList.append("<tr><td>");
        if (color)
        {
          fList.append("<table width=270 bgcolor=\"131210\">");
        }
        else
        {
          fList.append("<table width=270>");
        }
        fList.append("<tr><td width=270><font color=\"LEVEL\">" + entry.getKey() + "</font></td></tr>");
        fList.append("<tr><td width=270>" + entry.getValue() + "</td></tr>");
        fList.append("<tr><td>&nbsp;</td></tr></table>");
        fList.append("</td></tr>");
        color = !color;
        counter++;
        if (counter >= perpage)
        {
          break;
        }
      }
      if (breakat < (list.size() - 1))
      {
        html.replace("%buttprev%", HtmlUtils.PREV_BUTTON);
        html.replace("%prev_bypass%", "_diary?class=" + heroclass + "&page=" + (page + 1));
      }
      else
      {
        html.replace("%buttprev%", StringUtils.EMPTY);
      }
      if (page > 1)
      {
        html.replace("%buttnext%", HtmlUtils.NEXT_BUTTON);
        html.replace("%next_bypass%", "_diary?class=" + heroclass + "&page=" + (page - 1));
      }
      else
      {
        html.replace("%buttnext%", StringUtils.EMPTY);
      }
      html.replace("%list%", fList.toString());
      activeChar.sendPacket(html);
    }
  }
View Full Code Here

    if(currentStep == step)
    {
      String response = onRequestHtml(player, participants.containsKey(player.getObjectId()));
      if(response != null)
      {
        NpcHtmlMessage packet = new NpcHtmlMessage(5);
        packet.setFile("campaigns/" + getClass().getSimpleName() + "/" + response);
        player.sendPacket(packet);
      }
    }
    lock.unlock();
  }
View Full Code Here

    else
    {
      String response = onDialogEvent(event, player);
      if(response != null && response.endsWith(".htm"))
      {
        NpcHtmlMessage packet = new NpcHtmlMessage(5);
        packet.setFile("campaigns/" + getClass().getSimpleName() + "/" + response);
        player.sendPacket(packet);
      }
    }
  }
View Full Code Here

  @Override
  public void showChatWindow(Player player, int val, Object... arg)
  {
    if ((player.getQuestState(_10288_SecretMission.class) != null) && player.getQuestState(_10288_SecretMission.class).isCompleted())
    {
      player.sendPacket(new NpcHtmlMessage(player, this, "default/32780-1.htm", val));
      return;
    }
    player.sendPacket(new NpcHtmlMessage(player, this, "default/32780.htm", val));
    return;
  }
View Full Code Here

        if (cid.childOf(classId) && (cid.getClassLevel().ordinal() == (classId.getClassLevel().ordinal() + 1)))
        {
          html.append("<a action=\"bypass -h npc_").append(getObjectId()).append("_change_class ").append(cid.getId()).append(' ').append(Config.CLASS_MASTERS_PRICE_LIST[jobLevel]).append("\">").append(HtmlUtils.htmlClassName(cid.getId())).append("</a><br>");
        }
      }
      player.sendPacket(new NpcHtmlMessage(player, this).setHtml(html.toString()));
    }
    else
    {
      switch (jobLevel)
      {
View Full Code Here

   * @param arg Object[]
   */
  @Override
  public void showChatWindow(Player player, int val, Object... arg)
  {
    NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
    msg.setFile("custom/31860.htm");
    msg.replace("%classmaster%", makeMessage(player));
    player.sendPacket(msg);
  }
View Full Code Here

   * @param player Player
   * @param file String
   */
  public void showHtmlFile(Player player, String file)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    html.setFile("SepulcherNpc/" + file);
    html.replace("%npcname%", getName());
    player.sendPacket(html);
  }
View Full Code Here

      }
      showChatWindow(player, file);
    }
    else if (command.equalsIgnoreCase("listClans"))
    {
      NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
      msg.setFile("residence2/clanhall/farm_messenger003.htm");
      List<CTBSiegeClanObject> siegeClans = siegeEvent.getObjects(SiegeEvent.ATTACKERS);
      for (int i = 0; i < 5; i++)
      {
        CTBSiegeClanObject siegeClan = CollectionUtils.safeGet(siegeClans, i);
        if (siegeClan != null)
        {
          msg.replace("%clan_" + i + "%", siegeClan.getClan().getName());
        }
        else
        {
          msg.replaceNpcString("%clan_" + i + "%", NpcString.__UNREGISTERED__);
        }
        msg.replace("%clan_count_" + i + "%", siegeClan == null ? StringUtils.EMPTY : String.valueOf(siegeClan.getPlayers().size()));
      }
      player.sendPacket(msg);
    }
    else
    {
View Full Code Here

  {
    if ((text == null) || (self == null))
    {
      return;
    }
    NpcHtmlMessage msg = new NpcHtmlMessage(self, npc);
    if (text.endsWith(".html") || text.endsWith(".htm"))
    {
      msg.setFile(text);
    }
    else
    {
      msg.setHtml(Strings.bbParse(text));
    }
    if ((arg != null) && ((arg.length % 2) == 0))
    {
      for (int i = 0; i < arg.length; i = +2)
      {
        msg.replace(String.valueOf(arg[i]), String.valueOf(arg[i + 1]));
      }
    }
    self.sendPacket(msg);
  }
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.