Package lineage2.gameserver.network.serverpackets

Examples of lineage2.gameserver.network.serverpackets.NpcHtmlMessage


    ClanHall clanhall = ResidenceHolder.getInstance().getResidence(ClanHall.class, 21);
    if (clanhall == null)
    {
      return;
    }
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    html.setFile("residence2/clanhall/partisan_ordery_brakel001.htm");
    html.replace("%next_siege%", TimeUtils.toSimpleFormat(clanhall.getSiegeDate().getTimeInMillis()));
    player.sendPacket(html);
  }
View Full Code Here


    {
      return;
    }
    Petition currPetition = getPendingPetitions().get(petitionId);
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
    NpcHtmlMessage html = new NpcHtmlMessage(0);
    html.setFile("admin/petition.htm");
    html.replace("%petition%", String.valueOf(currPetition.getId()));
    html.replace("%time%", dateFormat.format(new Date(currPetition.getSubmitTime())));
    html.replace("%type%", currPetition.getTypeAsString());
    html.replace("%petitioner%", currPetition.getPetitioner().getName());
    html.replace("%online%", (currPetition.getPetitioner().isOnline() ? "00FF00" : "999999"));
    html.replace("%text%", currPetition.getContent());
    activeChar.sendPacket(html);
  }
View Full Code Here

    if(command.equalsIgnoreCase("zalp"))
    {
      if (!checkShot) {
        Functions.npcSay(this, NpcString.CANNON_READY_TO_FIRE);
        player.sendPacket(new NpcHtmlMessage(player, this).setHtml("Cannon:<br><br>Preparations are underway to re-activate the cannon. This process can take up to 5 minutes."));
        return;
      } else if (!player.getInventory().destroyItemByItemId(17611, 1)) {
        player.sendPacket(new NpcHtmlMessage(player, this).setHtml("Cannon:<br><br>\"Huge Charges\" not available."));
        return;
      }

      broadcastPacketToOthers(new MagicSkillUse(this, this, 14175, 1, 3000, 0));
      broadcastPacket(new Earthquake(player.getLoc(), 10, 7));
      ThreadPoolManager.getInstance().schedule(new Shot(), 300 * 1000L);
      checkShot = false;
      ThreadPoolManager.getInstance().schedule(new RunnableImpl() {
      @Override
      public void runImpl() throws Exception {
        decayMe();
        spawnMe();
      }
      }, 3100);
      setTitle("Cannon is loading");

      Location loc = point_bombs[getNpcId()-32939];
     
      for (NpcInstance monster : World.getAroundNpcCor(loc, getCurrentRegion(), getReflectionId(), 650, 500))
      {
        if (monster == null || !monster.isNpc() || monster.getNpcId() != 22966 && monster.getNpcId() != 22965 && monster.getNpcId() != 22967)
          continue;
     
        if (monster.getNpcId() == 22966)
          Functions.spawn(monster.getLoc(), 22980);
        else if (monster.getNpcId() == 22965)
          Functions.spawn(monster.getLoc(), 22979);
        else if (monster.getNpcId() == 22967)
          Functions.spawn(monster.getLoc(), 22981);
         
        monster.decayMe();
        monster.doDie(this);
     
    } else if (command.equalsIgnoreCase("spezion_bomb"))
    {
      if (!checkShot) {
        Functions.npcSay(this, NpcString.CANNON_READY_TO_FIRE);
        player.sendPacket(new NpcHtmlMessage(player, this).setHtml("Cannon:<br><br>Preparations are underway to re-activate the cannon. This process can take up to 5 minutes."));
        return;
      } else if (!player.getInventory().destroyItemByItemId(17611, 1)) {
        player.sendPacket(new NpcHtmlMessage(player, this).setHtml("Cannon:<br><br>\"Huge Charges\" not available."));
        return;
      }
     
      checkShot = false;
      broadcastPacketToOthers(new MagicSkillUse(this, this, 14175, 1, 3000, 0));
View Full Code Here

    else if (command.equals("viewTeams"))
    {
     
      List<Player> reg = coliseumEvent.getRegisteredPlayers();
     
      NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
      msg.setFile("events/kerthang_manager003.htm");
      for (int i = 0; i < 5; i++)
      {
        Player $player = CollectionUtils.safeGet(reg, i);
       
        msg.replace("%team" + i + "%", $player == null ? StringUtils.EMPTY : $player.getName());
      }
     
      player.sendPacket(msg);
    }
    else
View Full Code Here

      return;
    }
    if (command.equalsIgnoreCase("receive_report"))
    {
      int ownedTime = (int) ((System.currentTimeMillis() - getFortress().getOwnDate().getTimeInMillis()) / 60000L);
      NpcHtmlMessage html = new NpcHtmlMessage(player, this);
      Fortress fortress = getFortress();
      if (fortress.getContractState() == Fortress.CONTRACT_WITH_CASTLE)
      {
        html.setFile("residence2/fortress/fortress_steward022.htm");
        html.replace("%castle_name%", HtmlUtils.htmlResidenceName(getFortress().getCastleId()));
        html.replaceNpcString("%contract%", NpcString.CONTRACT_STATE);
        long leftTime = (REWARD_CYCLE - (3600 - fortress.getCycleDelay()) - (fortress.getPaidCycle() * 3600)) / 60;
        html.replace("%rent_cost%", String.valueOf(Fortress.CASTLE_FEE));
        html.replace("%next_hour%", String.valueOf(leftTime / 60));
        html.replace("%next_min%", String.valueOf(leftTime % 60));
      }
      else
      {
        html.setFile("residence2/fortress/fortress_steward023.htm");
      }
      html.replaceNpcString("%time_remained%", NpcString.S1HOUR_S2MINUTE, ownedTime / 60, ownedTime % 60);
      player.sendPacket(html);
    }
    else
    {
      super.onBypassFeedback(player, command);
View Full Code Here

   * @param arg Object[]
   */
  @Override
  public void showChatWindow(Player player, int val, Object... arg)
  {
    player.sendPacket(new NpcHtmlMessage(player, this, "common/seducedinvestigator.htm", val));
  }
View Full Code Here

            if (player.getCastle().isCastleTypeLight())
            {
              if(player.getInventory().getItemByItemId(34925) == null//Cloak of Light
              {
                player.getInventory().addItem(ItemFunctions.createItem(34925));
                NpcHtmlMessage html = new NpcHtmlMessage(player, this);
                html.setFile("castle/CourtMagician/CourtMagician-givecloak.htm");
                html.replace("%CharName%", player.getName());
                html.replaceNpcString("%FeudName%", player.getCastle().getNpcStringName());
                player.sendPacket(html);
              }
              else
              {
                NpcHtmlMessage html = new NpcHtmlMessage(player, this);
                html.setFile("castle/CourtMagician/alreadyhavecloak.htm");
                player.sendPacket(html);
              }
            }
            else
            {
              if(player.getInventory().getItemByItemId(34926) == null//Cloak of Darkness
              {
                player.getInventory().addItem(ItemFunctions.createItem(34926));
                NpcHtmlMessage html = new NpcHtmlMessage(player, this);
                html.setFile("castle/CourtMagician/CourtMagician-givecloak.htm");
                html.replace("%CharName%", player.getName());
                html.replaceNpcString("%FeudName%", player.getCastle().getNpcStringName());
                player.sendPacket(html);
              }
              else
              {
                NpcHtmlMessage html = new NpcHtmlMessage(player, this);
                html.setFile("castle/CourtMagician/alreadyhavecloak.htm");
                player.sendPacket(html);
              }
            }
          }
        }
View Full Code Here

      }
      else
      {
        filename = "residence2/fortress/fortress_supply_officer017.htm";
      }
      NpcHtmlMessage html = new NpcHtmlMessage(player, this);
      html.setFile(filename);
      player.sendPacket(html);
    }
    else if (command.equalsIgnoreCase("receiveRewards"))
    {
      String filename;
      int count = fortress.getRewardCount();
      if (count > 0)
      {
        filename = "residence2/fortress/fortress_supply_officer013.htm";
        fortress.setRewardCount(0);
        fortress.setJdbcState(JdbcEntityState.UPDATED);
        fortress.update();
        Functions.addItem(player, ITEM_ID, count);
      }
      else
      {
        filename = "residence2/fortress/fortress_supply_officer014.htm";
      }
      NpcHtmlMessage html = new NpcHtmlMessage(player, this);
      html.setFile(filename);
      player.sendPacket(html);
    }
    else if (command.equalsIgnoreCase("toLevel1"))
    {
      buyFacility(player, Fortress.GUARD_BUFF, 1, 100000);
View Full Code Here

        {
          filename = "castle/CourtMagician/CourtMagician-" + val + ".htm";
        }
      }
    }
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    html.setFile(filename);
    html.replace("%objectId%", String.valueOf(getObjectId()));
    html.replace("%npcname%", getName());
    player.sendPacket(html);
  }
View Full Code Here

      if ((doorRecharge == 0) || (doorRecharge <= System.currentTimeMillis()))
      {
        if (player.getClassId() == ClassId.MAESTRO)
        {
          openDoor(npcId);
          player.sendPacket(new NpcHtmlMessage(player, this).setHtml("Tully Gatekeeper:<br><br>Doors are opened."));
        }
        else if (Rnd.chance(60))
        {
          openDoor(npcId);
          player.sendPacket(new NpcHtmlMessage(player, this).setHtml("Tully Gatekeeper:<br><br>Doors are opened."));
        }
        else
        {
          doorRecharge = System.currentTimeMillis() + (120 * 1000L);
          player.sendPacket(new NpcHtmlMessage(player, this).setHtml("Tully Gatekeeper:<br><br>The attempt has failed. Recharching..."));
        }
      }
      else
      {
        player.sendPacket(new NpcHtmlMessage(player, this).setHtml("Tully Gatekeeper:<br><br>The time needed for the recharge has not elapsed yet"));
      }
    }
    else
    {
      super.onBypassFeedback(player, command);
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.