Package lineage2.gameserver.network.serverpackets

Examples of lineage2.gameserver.network.serverpackets.NpcHtmlMessage


   * @param targetChar Player
   * @param filename String
   */
  public static void showHelpPage(Player targetChar, String filename)
  {
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    adminReply.setFile("admin/" + filename);
    targetChar.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 (_powerUnits != 0)
    {
      message.setFile("residence2/fortress/fortress_mainpower002.htm");
    }
    else
    {
      message.setFile("residence2/fortress/fortress_mainpower001.htm");
    }
    player.sendPacket(message);
  }
View Full Code Here

    StringTokenizer st = new StringTokenizer(command, " ");
    String actualCommand = st.nextToken();
    boolean condition = validateCondition(player);
    if (actualCommand.equalsIgnoreCase("RideHelp"))
    {
      NpcHtmlMessage html = new NpcHtmlMessage(player, this);
      html.setFile("wyvern/help_ride.htm");
      html.replace("%npcname%", "Wyvern Manager " + getName());
      player.sendPacket(html);
      player.sendActionFailed();
    }
    if (condition)
    {
      if (actualCommand.equalsIgnoreCase("RideWyvern") && player.isClanLeader())
      {
        if (!player.isRiding() || !PetDataTable.isStrider(player.getMountNpcId()))
        {
          NpcHtmlMessage html = new NpcHtmlMessage(player, this);
          html.setFile("wyvern/not_ready.htm");
          html.replace("%npcname%", "Wyvern Manager " + getName());
          player.sendPacket(html);
        }
        else if ((player.getInventory().getItemByItemId(1460) == null) || (player.getInventory().getItemByItemId(1460).getCount() < 25))
        {
          NpcHtmlMessage html = new NpcHtmlMessage(player, this);
          html.setFile("wyvern/havenot_cry.htm");
          html.replace("%npcname%", "Wyvern Manager " + getName());
          player.sendPacket(html);
        }
        else if (player.getInventory().destroyItemByItemId(1460, 25L))
        {
          player.setMount(PetDataTable.WYVERN_ID, player.getMountObjId(), player.getMountLevel());
          NpcHtmlMessage html = new NpcHtmlMessage(player, this);
          html.setFile("wyvern/after_ride.htm");
          html.replace("%npcname%", "Wyvern Manager " + getName());
          player.sendPacket(html);
        }
      }
    }
    else
View Full Code Here

  @Override
  public void showChatWindow(Player player, int val, Object... arg)
  {
    if (!validateCondition(player))
    {
      NpcHtmlMessage html = new NpcHtmlMessage(player, this);
      html.setFile("wyvern/lord_only.htm");
      html.replace("%npcname%", "Wyvern Manager " + getName());
      player.sendPacket(html);
      player.sendActionFailed();
      return;
    }
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    html.setFile("wyvern/lord_here.htm");
    html.replace("%Char_name%", String.valueOf(player.getName()));
    html.replace("%npcname%", "Wyvern Manager " + getName());
    player.sendPacket(html);
    player.sendActionFailed();
  }
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_inner_controller002.htm");
        FortressSiegeEvent event = getEvent(FortressSiegeEvent.class);
        if (event != null)
        {
          SpawnExObject exObject = event.getFirstObject(FortressSiegeEvent.SIEGE_COMMANDERS);
          Spawner spawn = exObject.getSpawns().get(3);
          MainMachineInstance machineInstance = (MainMachineInstance) spawn.getFirstSpawned();
          machineInstance.powerOff(this);
          onDecay();
        }
        break;
      case COND_TIMEOUT:
        message.setFile("residence2/fortress/fortress_inner_controller003.htm");
        break;
      case COND_FAIL:
        message.setFile("residence2/fortress/fortress_inner_controller003.htm");
        _invalidatePeriod = System.currentTimeMillis() + 30000L;
        break;
      case COND_ENTERED:
        message.setFile("residence2/fortress/fortress_inner_controller004.htm");
        message.replaceNpcString("%password%", _index == 0 ? NpcString.PASSWORD_HAS_NOT_BEEN_ENTERED : _index == 1 ? NpcString.FIRST_PASSWORD_HAS_BEEN_ENTERED : NpcString.SECOND_PASSWORD_HAS_BEEN_ENTERED);
        message.replaceNpcString("%try_count%", NpcString.ATTEMPT_S1__3_IS_IN_PROGRESS, _tryCount);
        break;
      case COND_NO_ENTERED:
        message.setFile("residence2/fortress/fortress_inner_controller001.htm");
        break;
    }
    player.sendPacket(message);
  }
View Full Code Here

      if (!Config.ENABLE_OLYMPIAD)
      {
        return;
      }
      int val = Integer.parseInt(command.substring(14));
      NpcHtmlMessage html = new NpcHtmlMessage(player, this);
      switch (val)
      {
        case 1:
          Olympiad.unRegisterNoble(player);
          showChatWindow(player, 0);
          break;
        case 2:
          if (Olympiad.isRegistered(player))
          {
            player.sendPacket(html.setFile(Olympiad.OLYMPIAD_HTML_PATH + "manager_noregister.htm"));
          }
          else
          {
            int nowWeek = Calendar.getInstance().get(Calendar.WEEK_OF_MONTH);
            if (nowWeek < 4)
            {
              html.setFile(Olympiad.OLYMPIAD_HTML_PATH + "manager_register_noclass.htm");
            }
            else
            {
              html.setFile(Olympiad.OLYMPIAD_HTML_PATH + "manager_register_class.htm");
            }
            player.sendPacket(html);
          }
          break;
        case 4:
          Olympiad.registerNoble(player, CompType.NON_CLASSED);
          break;
        case 5:
          Olympiad.registerNoble(player, CompType.CLASSED);
          break;
        case 6:
          int passes = Olympiad.getNoblessePasses(player);
          if (passes > 0)
          {
            player.getInventory().addItem(Config.ALT_OLY_COMP_RITEM, passes);
            player.sendPacket(SystemMessage2.obtainItems(Config.ALT_OLY_COMP_RITEM, passes, 0));
          }
          else
          {
            player.sendPacket(html.setFile(Olympiad.OLYMPIAD_HTML_PATH + "manager_nopoints.htm"));
          }
          break;
        case 7:
          MultiSellHolder.getInstance().SeparateAndSend(102, player, 0);
          break;
        case 9:
          MultiSellHolder.getInstance().SeparateAndSend(103, player, 0);
          break;
        default:
          _log.warn("Olympiad System: Couldnt send packet for request " + val);
          break;
      }
    }
    else if (command.startsWith("Olympiad"))
    {
      if (!Config.ENABLE_OLYMPIAD)
      {
        return;
      }
      int val = Integer.parseInt(command.substring(9, 10));
      NpcHtmlMessage reply = new NpcHtmlMessage(player, this);
      switch (val)
      {
        case 1:
          if (!Olympiad.inCompPeriod() || Olympiad.isOlympiadEnd())
          {
            player.sendPacket(SystemMsg.THE_GRAND_OLYMPIAD_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
            return;
          }
          player.sendPacket(new ExReceiveOlympiad.MatchList());
          break;
        case 2:
          int classId = Integer.parseInt(command.substring(11));
          if (classId >= 139)
          {
            reply.setFile(Olympiad.OLYMPIAD_HTML_PATH + "manager_ranking.htm");
            List<String> names = OlympiadDatabase.getClassLeaderBoard(classId);
            int index = 1;
            for (String name : names)
            {
              reply.replace("%place" + index + "%", String.valueOf(index));
              reply.replace("%rank" + index + "%", name);
              index++;
              if (index > 10)
              {
                break;
              }
            }
            for (; index <= 10; index++)
            {
              reply.replace("%place" + index + "%", "");
              reply.replace("%rank" + index + "%", "");
            }
            player.sendPacket(reply);
          }
          break;
        case 3:
          if (!Config.ENABLE_OLYMPIAD_SPECTATING)
          {
            break;
          }
          Olympiad.addSpectator(Integer.parseInt(command.substring(11)), player);
          break;
        case 4:
          player.sendPacket(new ExHeroList());
          break;
        case 5:
          if (Hero.getInstance().isInactiveHero(player.getObjectId()))
          {
            Hero.getInstance().activateHero(player);
            reply.setFile(Olympiad.OLYMPIAD_HTML_PATH + "monument_give_hero.htm");
          }
          else
          {
            reply.setFile(Olympiad.OLYMPIAD_HTML_PATH + "monument_dont_hero.htm");
          }
          player.sendPacket(reply);
          break;
        default:
          _log.warn("Olympiad System: Couldnt send packet for request " + val);
View Full Code Here

    if (val > 0)
    {
      fileName += "-" + val;
    }
    fileName += ".htm";
    player.sendPacket(new NpcHtmlMessage(player, this, fileName, val));
  }
View Full Code Here

      {
        player.sendPacket(SystemMsg.ONLY_A_CLAN_LEADER_THAT_IS_A_NOBLESSE_CAN_VIEW_THE_SIEGE_WAR_STATUS_WINDOW_DURING_A_SIEGE_WAR);
        return false;
      }
    }
    NpcHtmlMessage msg = new NpcHtmlMessage(5);
    msg.setFile("siege_status.htm");
    msg.replace("%name%", player.getName());
    msg.replace("%kills%", String.valueOf(0));
    msg.replace("%deaths%", String.valueOf(0));
    msg.replace("%type%", String.valueOf(0));
    player.sendPacket(msg);
    return true;
  }
View Full Code Here

    {
      return;
    }
    StringTokenizer st = new StringTokenizer(command, " ");
    String actualCommand = st.nextToken();
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    if (actualCommand.equalsIgnoreCase("PK_Count"))
    {
      if (player.getFame() >= 5000)
      {
        if (player.getPkKills() > 0)
        {
          player.setFame(player.getFame() - 5000, "PK_Count");
          player.setPkKills(player.getPkKills() - 1);
          html.setFile("default/" + getNpcId() + "-okpk.htm");
        }
        else
        {
          html.setFile("default/" + getNpcId() + "-nohavepk.htm");
        }
      }
      else
      {
        html.setFile("default/" + getNpcId() + "-nofame.htm");
      }
      html.replace("%objectId%", String.valueOf(getObjectId()));
      player.sendPacket(html);
    }
    else if (actualCommand.equalsIgnoreCase("CRP"))
    {
      if ((player.getClan() == null) || (player.getClassId().level() < 2) || (player.getClan().getLevel() < 5))
      {
        html.setFile("default/" + getNpcId() + "-noclancrp.htm");
      }
      else if (player.getFame() < 1000)
      {
        html.setFile("default/" + getNpcId() + "-nofame.htm");
      }
      else
      {
        player.setFame(player.getFame() - 1000, "CRP");
        player.getClan().incReputation(50, false, "FameManager from " + player.getName());
        player.getClan().broadcastToOnlineMembers(new PledgeShowInfoUpdate(player.getClan()));
        player.sendPacket(Msg.ACQUIRED_50_CLAN_FAME_POINTS);
        html.setFile("default/" + getNpcId() + "-okclancrp.htm");
      }
      html.replace("%objectId%", String.valueOf(getObjectId()));
      player.sendPacket(html);
    }
    else
    {
      super.onBypassFeedback(player, command);
View Full Code Here

      return false;
    }
    final Residence r;
    final SiegeEvent<?, ?> event;
    Calendar calendar;
    NpcHtmlMessage msg;
    switch (command)
    {
      case admin_residence_list:
        msg = new NpcHtmlMessage(5);
        msg.setFile("admin/residence/residence_list.htm");
        final StringBuilder replyMSG = new StringBuilder(200);
        for (Residence residence : ResidenceHolder.getInstance().getResidences())
        {
          if (residence != null)
          {
            replyMSG.append("<tr><td>");
            replyMSG.append("<a action=\"bypass -h admin_residence ").append(residence.getId()).append("\">").append(HtmlUtils.htmlResidenceName(residence.getId())).append("</a>");
            replyMSG.append("</td><td>");
            Clan owner = residence.getOwner();
            if (owner == null)
            {
              replyMSG.append("NPC");
            }
            else
            {
              replyMSG.append(owner.getName());
            }
            replyMSG.append("</td></tr>");
          }
        }
        msg.replace("%residence_list%", replyMSG.toString());
        activeChar.sendPacket(msg);
        break;
      case admin_residence:
        if (wordList.length != 2)
        {
          return false;
        }
        r = ResidenceHolder.getInstance().getResidence(Integer.parseInt(wordList[1]));
        if (r == null)
        {
          return false;
        }
        event = r.getSiegeEvent();
        msg = new NpcHtmlMessage(5);
        msg.setFile("admin/residence/siege_info.htm");
        msg.replace("%residence%", HtmlUtils.htmlResidenceName(r.getId()));
        msg.replace("%id%", String.valueOf(r.getId()));
        msg.replace("%owner%", (r.getOwner() == null) ? "NPC" : r.getOwner().getName());
        msg.replace("%cycle%", String.valueOf(r.getCycle()));
        msg.replace("%paid_cycle%", String.valueOf(r.getPaidCycle()));
        msg.replace("%reward_count%", String.valueOf(r.getRewardCount()));
        msg.replace("%left_time%", String.valueOf(r.getCycleDelay()));
        final StringBuilder clans = new StringBuilder(100);
        for (Map.Entry<String, List<Serializable>> entry : event.getObjects().entrySet())
        {
          for (Serializable o : entry.getValue())
          {
            if (o instanceof SiegeClanObject)
            {
              SiegeClanObject siegeClanObject = (SiegeClanObject) o;
              clans.append("<tr>").append("<td>").append(siegeClanObject.getClan().getName()).append("</td>").append("<td>").append(siegeClanObject.getClan().getLeaderName()).append("</td>").append("<td>").append(siegeClanObject.getType()).append("</td>").append("</tr>");
            }
          }
        }
        msg.replace("%clans%", clans.toString());
        msg.replace("%hour%", String.valueOf(r.getSiegeDate().get(Calendar.HOUR_OF_DAY)));
        msg.replace("%minute%", String.valueOf(r.getSiegeDate().get(Calendar.MINUTE)));
        msg.replace("%day%", String.valueOf(r.getSiegeDate().get(Calendar.DAY_OF_MONTH)));
        msg.replace("%month%", String.valueOf(r.getSiegeDate().get(Calendar.MONTH) + 1));
        msg.replace("%year%", String.valueOf(r.getSiegeDate().get(Calendar.YEAR)));
        activeChar.sendPacket(msg);
        break;
      case admin_set_owner:
        if (wordList.length != 3)
        {
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.