Package lineage2.gameserver.network.serverpackets

Examples of lineage2.gameserver.network.serverpackets.NpcHtmlMessage


    StringTokenizer st = new StringTokenizer(command);
    if (st.nextToken().equals("request_ring"))
    {
      if (!BelethManager.isRingAvailable())
      {
        player.sendPacket(new NpcHtmlMessage(player, this).setHtml("Stone Coffin:<br><br>Ring is not available. Get lost!"));
        return;
      }
      if ((player.getParty() == null) || (player.getParty().getCommandChannel() == null))
      {
        player.sendPacket(new NpcHtmlMessage(player, this).setHtml("Stone Coffin:<br><br>You are not allowed to take the ring. Are are not the group or Command Channel."));
        return;
      }
      if (player.getParty().getCommandChannel().getChannelLeader() != player)
      {
        player.sendPacket(new NpcHtmlMessage(player, this).setHtml("Stone Coffin:<br><br>You are not leader or the Command Channel."));
        return;
      }
      CommandChannel channel = player.getParty().getCommandChannel();
      Functions.addItem(player, RING, 1);
      SystemMessage smsg = new SystemMessage(SystemMessage.S1_HAS_OBTAINED_S2);
View Full Code Here


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

        showChatWindow(player, _failDialog);
        return;
    }
    if (actualCommand.equalsIgnoreCase("banish"))
    {
      NpcHtmlMessage html = new NpcHtmlMessage(player, this);
      html.setFile("residence/Banish.htm");
      sendHtmlMessage(player, html);
    }
    else if (actualCommand.equalsIgnoreCase("banish_foreigner"))
    {
      if (!isHaveRigths(player, getPrivDismiss()))
      {
        player.sendPacket(SystemMsg.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
        return;
      }
      getResidence().banishForeigner();
      return;
    }
    else if (actualCommand.equalsIgnoreCase("Buy"))
    {
      if (val.equals(""))
      {
        return;
      }
      showShopWindow(player, Integer.valueOf(val), true);
    }
    else if (actualCommand.equalsIgnoreCase("manage_vault"))
    {
      if (val.equalsIgnoreCase("deposit"))
      {
        WarehouseFunctions.showDepositWindowClan(player);
      }
      else if (val.equalsIgnoreCase("withdraw"))
      {
        int value = Integer.valueOf(st.nextToken());
        if (value == 99)
        {
          NpcHtmlMessage html = new NpcHtmlMessage(player, this);
          html.setFile("residence/clan.htm");
          html.replace("%npcname%", getName());
          player.sendPacket(html);
        }
        else
        {
          WarehouseFunctions.showWithdrawWindowClan(player, value);
        }
      }
      else
      {
        NpcHtmlMessage html = new NpcHtmlMessage(player, this);
        html.setFile("residence/vault.htm");
        sendHtmlMessage(player, html);
      }
      return;
    }
    else if (actualCommand.equalsIgnoreCase("door"))
    {
      showChatWindow(player, "residence/door.htm");
    }
    else if (actualCommand.equalsIgnoreCase("openDoors"))
    {
      if (isHaveRigths(player, getPrivDoors()))
      {
        for (int i : _doors)
        {
          ReflectionUtils.getDoor(i).openMe();
        }
        showChatWindow(player, "residence/door.htm");
      }
      else
      {
        player.sendPacket(SystemMsg.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
      }
    }
    else if (actualCommand.equalsIgnoreCase("closeDoors"))
    {
      if (isHaveRigths(player, getPrivDoors()))
      {
        for (int i : _doors)
        {
          ReflectionUtils.getDoor(i).closeMe();
        }
        showChatWindow(player, "residence/door.htm");
      }
      else
      {
        player.sendPacket(SystemMsg.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
      }
    }
    else if (actualCommand.equalsIgnoreCase("functions"))
    {
      if (!isHaveRigths(player, getPrivUseFunctions()))
      {
        player.sendPacket(SystemMsg.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
        return;
      }
      if (val.equalsIgnoreCase("tele"))
      {
        if (!getResidence().isFunctionActive(ResidenceFunction.TELEPORT))
        {
          NpcHtmlMessage html = new NpcHtmlMessage(player, this);
          html.setFile("residence/teleportNotActive.htm");
          sendHtmlMessage(player, html);
          return;
        }
        NpcHtmlMessage html = new NpcHtmlMessage(player, this);
        html.setFile("residence/teleport.htm");
        TeleportLocation[] locs = getResidence().getFunction(ResidenceFunction.TELEPORT).getTeleports();
        StringBuilder teleport_list = new StringBuilder(100 * locs.length);
        String price;
        final String delimiter = HtmlUtils.htmlNpcString(1000308);
        for (TeleportLocation loc : locs)
        {
          price = String.valueOf(loc.getPrice());
          teleport_list.append("<a action=\"bypass -h scripts_Util:Gatekeeper ");
          teleport_list.append(loc.getX());
          teleport_list.append(' ');
          teleport_list.append(loc.getY());
          teleport_list.append(' ');
          teleport_list.append(loc.getZ());
          teleport_list.append(' ');
          teleport_list.append(price);
          teleport_list.append("\" msg=\"811;F;");
          teleport_list.append(loc.getName());
          teleport_list.append("\">");
          teleport_list.append(HtmlUtils.htmlNpcString(loc.getName()));
          teleport_list.append(" - ");
          teleport_list.append(price);
          teleport_list.append(' ');
          teleport_list.append(delimiter);
          teleport_list.append("</a><br1>");
        }
        html.replace("%teleList%", teleport_list.toString());
        sendHtmlMessage(player, html);
      }
      else if (val.equalsIgnoreCase("item_creation"))
      {
        if (!getResidence().isFunctionActive(ResidenceFunction.ITEM_CREATE))
        {
          NpcHtmlMessage html = new NpcHtmlMessage(player, this);
          html.setFile("residence/itemNotActive.htm");
          sendHtmlMessage(player, html);
          return;
        }
        NpcHtmlMessage html = new NpcHtmlMessage(player, this);
        html.setFile("residence/item.htm");
        String template = "<button value=\"Buy Item\" action=\"bypass -h npc_%objectId%_Buy %id%\" width=90 height=25 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\">";
        template = template.replaceAll("%id%", String.valueOf(getResidence().getFunction(ResidenceFunction.ITEM_CREATE).getBuylist()[1])).replace("%objectId%", String.valueOf(getObjectId()));
        html.replace("%itemList%", template);
        sendHtmlMessage(player, html);
      }
      else if (val.equalsIgnoreCase("support"))
      {
        if (!getResidence().isFunctionActive(ResidenceFunction.SUPPORT))
        {
          NpcHtmlMessage html = new NpcHtmlMessage(player, this);
          html.setFile("residence/supportNotActive.htm");
          sendHtmlMessage(player, html);
          return;
        }
        NpcHtmlMessage html = new NpcHtmlMessage(player, this);
        html.setFile("residence/support.htm");
        Object[][] allBuffs = getResidence().getFunction(ResidenceFunction.SUPPORT).getBuffs();
        StringBuilder support_list = new StringBuilder(allBuffs.length * 50);
        int i = 0;
        for (Object[] buff : allBuffs)
        {
          Skill s = (Skill) buff[0];
          support_list.append("<a action=\"bypass -h npc_%objectId%_support ");
          support_list.append(String.valueOf(s.getId()));
          support_list.append(' ');
          support_list.append(String.valueOf(s.getLevel()));
          support_list.append("\">");
          support_list.append(s.getName());
          support_list.append(" Lv.");
          support_list.append(String.valueOf(s.getDisplayLevel()));
          support_list.append("</a><br1>");
          if ((++i % 5) == 0)
          {
            support_list.append("<br>");
          }
        }
        html.replace("%magicList%", support_list.toString());
        html.replace("%mp%", String.valueOf(Math.round(getCurrentMp())));
        html.replace("%all%", Config.ALT_CH_ALL_BUFFS ? "<a action=\"bypass -h npc_%objectId%_support all\">Give all</a><br1><a action=\"bypass -h npc_%objectId%_support allW\">Give warrior</a><br1><a action=\"bypass -h npc_%objectId%_support allM\">Give mystic</a><br>" : "");
        sendHtmlMessage(player, html);
      }
      else if (val.equalsIgnoreCase("back"))
      {
        showChatWindow(player, 0);
      }
      else
      {
        NpcHtmlMessage html = new NpcHtmlMessage(player, this);
        html.setFile("residence/functions.htm");
        if (getResidence().isFunctionActive(ResidenceFunction.RESTORE_EXP))
        {
          html.replace("%xp_regen%", String.valueOf(getResidence().getFunction(ResidenceFunction.RESTORE_EXP).getLevel()) + "%");
        }
        else
        {
          html.replace("%xp_regen%", "0%");
        }
        if (getResidence().isFunctionActive(ResidenceFunction.RESTORE_HP))
        {
          html.replace("%hp_regen%", String.valueOf(getResidence().getFunction(ResidenceFunction.RESTORE_HP).getLevel()) + "%");
        }
        else
        {
          html.replace("%hp_regen%", "0%");
        }
        if (getResidence().isFunctionActive(ResidenceFunction.RESTORE_MP))
        {
          html.replace("%mp_regen%", String.valueOf(getResidence().getFunction(ResidenceFunction.RESTORE_MP).getLevel()) + "%");
        }
        else
        {
          html.replace("%mp_regen%", "0%");
        }
        sendHtmlMessage(player, html);
      }
    }
    else if (actualCommand.equalsIgnoreCase("manage"))
    {
      if (!isHaveRigths(player, getPrivSetFunctions()))
      {
        player.sendPacket(SystemMsg.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
        return;
      }
      if (val.equalsIgnoreCase("recovery"))
      {
        if (st.countTokens() >= 1)
        {
          val = st.nextToken();
          boolean success = true;
          if (val.equalsIgnoreCase("hp"))
          {
            success = getResidence().updateFunctions(ResidenceFunction.RESTORE_HP, Integer.valueOf(st.nextToken()));
          }
          else if (val.equalsIgnoreCase("mp"))
          {
            success = getResidence().updateFunctions(ResidenceFunction.RESTORE_MP, Integer.valueOf(st.nextToken()));
          }
          else if (val.equalsIgnoreCase("exp"))
          {
            success = getResidence().updateFunctions(ResidenceFunction.RESTORE_EXP, Integer.valueOf(st.nextToken()));
          }
          if (!success)
          {
            player.sendPacket(SystemMsg.THERE_IS_NOT_ENOUGH_ADENA_IN_THE_CLAN_HALL_WAREHOUSE);
          }
          else
          {
            broadcastDecoInfo();
          }
        }
        showManageRecovery(player);
      }
      else if (val.equalsIgnoreCase("other"))
      {
        if (st.countTokens() >= 1)
        {
          val = st.nextToken();
          boolean success = true;
          if (val.equalsIgnoreCase("item"))
          {
            success = getResidence().updateFunctions(ResidenceFunction.ITEM_CREATE, Integer.valueOf(st.nextToken()));
          }
          else if (val.equalsIgnoreCase("tele"))
          {
            success = getResidence().updateFunctions(ResidenceFunction.TELEPORT, Integer.valueOf(st.nextToken()));
          }
          else if (val.equalsIgnoreCase("support"))
          {
            success = getResidence().updateFunctions(ResidenceFunction.SUPPORT, Integer.valueOf(st.nextToken()));
          }
          if (!success)
          {
            player.sendPacket(SystemMsg.THERE_IS_NOT_ENOUGH_ADENA_IN_THE_CLAN_HALL_WAREHOUSE);
          }
          else
          {
            broadcastDecoInfo();
          }
        }
        showManageOther(player);
      }
      else if (val.equalsIgnoreCase("deco"))
      {
        if (st.countTokens() >= 1)
        {
          val = st.nextToken();
          boolean success = true;
          if (val.equalsIgnoreCase("platform"))
          {
            success = getResidence().updateFunctions(ResidenceFunction.PLATFORM, Integer.valueOf(st.nextToken()));
          }
          else if (val.equalsIgnoreCase("curtain"))
          {
            success = getResidence().updateFunctions(ResidenceFunction.CURTAIN, Integer.valueOf(st.nextToken()));
          }
          if (!success)
          {
            player.sendPacket(SystemMsg.THERE_IS_NOT_ENOUGH_ADENA_IN_THE_CLAN_HALL_WAREHOUSE);
          }
          else
          {
            broadcastDecoInfo();
          }
        }
        showManageDeco(player);
      }
      else if (val.equalsIgnoreCase("back"))
      {
        showChatWindow(player, 0);
      }
      else
      {
        NpcHtmlMessage html = new NpcHtmlMessage(player, this);
        html.setFile("residence/manage.htm");
        sendHtmlMessage(player, html);
      }
      return;
    }
    else if (actualCommand.equalsIgnoreCase("support"))
View Full Code Here

      }
      else
      {
        htmlpath = "default/32740-4.htm";
      }
      player.sendPacket(new NpcHtmlMessage(player, this, htmlpath, val));
    }
    else
    {
      super.showChatWindow(player, val);
    }
View Full Code Here

  public void showChatWindow(Player player, int val, Object... arg)
  {
    switch (getNpcId())
    {
      case 33563:
        player.sendPacket(new NpcHtmlMessage(player, this, "default/33563.htm", val));
        break;
      case 33562:
        player.sendPacket(new NpcHtmlMessage(player, this, "default/33562.htm", val));
        break;
      case 33564:
        player.sendPacket(new NpcHtmlMessage(player, this, "default/33564.htm", val));
        break;
      case 33565:
        player.sendPacket(new NpcHtmlMessage(player, this, "default/33565.htm", val));
        break;
      case 33560:
        player.sendPacket(new NpcHtmlMessage(player, this, "default/33560.htm", val));
        break;
      case 33561:
        player.sendPacket(new NpcHtmlMessage(player, this, "default/33561.htm", val));
        break;
      case 33566:
        player.sendPacket(new NpcHtmlMessage(player, this, "default/33566.htm", val));
        break;
      case 33567:
        player.sendPacket(new NpcHtmlMessage(player, this, "default/33567.htm", val));
        break;
      case 33568:
        player.sendPacket(new NpcHtmlMessage(player, this, "default/33568.htm", val));
        break;
      case 33569:
        player.sendPacket(new NpcHtmlMessage(player, this, "default/33569.htm", val));
        break;
    }
  }
View Full Code Here

    else if (command.equalsIgnoreCase("teleport"))
    {
      switch (getNpcId())
      {
        case 33563:
          player.sendPacket(new NpcHtmlMessage(player, this, "default/33563-1.htm", val));
          break;
        case 33562:
          player.sendPacket(new NpcHtmlMessage(player, this, "default/33562-1.htm", val));
          break;
        case 33564:
          player.sendPacket(new NpcHtmlMessage(player, this, "default/33564-1.htm", val));
          break;
        case 33565:
          player.sendPacket(new NpcHtmlMessage(player, this, "default/33565-1.htm", val));
          break;
        case 33560:
          player.sendPacket(new NpcHtmlMessage(player, this, "default/33560-1.htm", val));
          break;
        case 33561:
          player.sendPacket(new NpcHtmlMessage(player, this, "default/33561-1.htm", val));
          break;
        case 33566:
          player.sendPacket(new NpcHtmlMessage(player, this, "default/33566-1.htm", val));
          break;
        case 33567:
          player.sendPacket(new NpcHtmlMessage(player, this, "default/33567-1.htm", val));
          break;
        case 33568:
          player.sendPacket(new NpcHtmlMessage(player, this, "default/33568-1.htm", val));
          break;
        case 33569:
          player.sendPacket(new NpcHtmlMessage(player, this, "default/33569-1.htm", val));
          break;
      }
    }
    else
    {
View Full Code Here

      player.sendMessage("Invalid skill " + id);
      return true;
    }
    if (skill.getMpConsume() > getCurrentMp())
    {
      NpcHtmlMessage html = new NpcHtmlMessage(player, this);
      html.setFile("residence/NeedCoolTime.htm");
      html.replace("%mp%", String.valueOf(Math.round(getCurrentMp())));
      sendHtmlMessage(player, html);
      return false;
    }
    altUseSkill(skill, player);
    return true;
View Full Code Here

   * Method showManageRecovery.
   * @param player Player
   */
  private void showManageRecovery(Player player)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    html.setFile("residence/edit_recovery.htm");
    replace(html, ResidenceFunction.RESTORE_EXP, "exp", "recovery");
    replace(html, ResidenceFunction.RESTORE_HP, "hp", "recovery");
    replace(html, ResidenceFunction.RESTORE_MP, "mp", "recovery");
    sendHtmlMessage(player, html);
  }
View Full Code Here

   * Method showManageOther.
   * @param player Player
   */
  private void showManageOther(Player player)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    html.setFile("residence/edit_other.htm");
    replace(html, ResidenceFunction.TELEPORT, "tele", "other");
    replace(html, ResidenceFunction.SUPPORT, "support", "other");
    replace(html, ResidenceFunction.ITEM_CREATE, "item", "other");
    sendHtmlMessage(player, html);
  }
View Full Code Here

   * Method showManageDeco.
   * @param player Player
   */
  private void showManageDeco(Player player)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    html.setFile("residence/edit_deco.htm");
    replace(html, ResidenceFunction.CURTAIN, "curtain", "deco");
    replace(html, ResidenceFunction.PLATFORM, "platform", "deco");
    sendHtmlMessage(player, html);
  }
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.