Package l2p.gameserver.serverpackets

Examples of l2p.gameserver.serverpackets.NpcHtmlMessage


    filename += suffix != null ? suffix + ".htm" : ".htm";
    if(filename.equals(Olympiad.OLYMPIAD_HTML_PATH + "noble_desc0.htm"))
    {
      filename = Olympiad.OLYMPIAD_HTML_PATH + "noble_main.htm";
    }
    player.sendPacket(new NpcHtmlMessage(player, this, filename, val));
  }
View Full Code Here


    if(!hasHennas)
    {
      html1.append("You don't have any symbol to remove!");
    }
    html1.append("</body></html>");
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    html.setHtml(html1.toString());
    player.sendPacket(html);
  }
View Full Code Here

              String oldVar = player.getVar("ng1");
              player.setVar("ng1", oldVar == null ? "1" : String.valueOf(Integer.parseInt(oldVar) + 1));
              Functions.addItem(player, 57, 11567);
              player.addExpAndSp(Experience.LEVEL[6] - player.getExp(), 127, false, false);
            }
            player.sendPacket(new NpcHtmlMessage(player, this, "data/html/newbiehelper/q1-2.htm", val));
            return;
          }
          else
          {
            player.sendPacket(new NpcHtmlMessage(player, this, "data/html/newbiehelper/q1-1.htm", val).replace("%tonpc%", getQuestNpc(1, player)));
            return;
          }
        }
        if(player.getLevel() < 10)
        {
          if(player.getVarB("p1q2"))
          {
            if(!player.getVarB("ng2"))
            {
              // TODO: адена?
              String oldVar = player.getVar("ng2");
              player.setVar("ng2", oldVar == null ? "1" : String.valueOf(Integer.parseInt(oldVar) + 1));
              long addexp = Experience.LEVEL[10] - player.getExp();
              player.addExpAndSp(addexp, addexp / 24, false, false);
            }
            player.sendPacket(new NpcHtmlMessage(player, this, "data/html/newbiehelper/q3-1.htm", val).replace("%tonpc%", getQuestNpc(3, player)));
            return;
          }
          else
          {
            player.sendPacket(new NpcHtmlMessage(player, this, "data/html/newbiehelper/q2-1.htm", val).replace("%tonpc%", getQuestNpc(2, player)));
            return;
          }
        }
        if(player.getLevel() < 15)
        {
          if(player.getVarB("p1q3"))
          {
            if(!player.getVarB("ng3"))
            {
              String oldVar = player.getVar("ng3");
              player.setVar("ng3", oldVar == null ? "1" : String.valueOf(Integer.parseInt(oldVar) + 1));
              Functions.addItem(player, 57, 38180);
              long addexp = Experience.LEVEL[15] - player.getExp();
              player.addExpAndSp(addexp, addexp / 22, false, false);
            }
            player.sendPacket(new NpcHtmlMessage(player, this, "data/html/newbiehelper/q4-1.htm", val).replace("%tonpc%", getQuestNpc(4, player)));
            return;
          }
          else
          {
            player.sendPacket(new NpcHtmlMessage(player, this, "data/html/newbiehelper/q3-1.htm", val).replace("%tonpc%", getQuestNpc(3, player)));
            return;
          }
        }
        if(player.getLevel() < 18)
        {
          if(player.getVarB("p1q4"))
          {
            if(!player.getVarB("ng4"))
            {
              String oldVar = player.getVar("ng4");
              player.setVar("ng4", oldVar == null ? "1" : String.valueOf(Integer.parseInt(oldVar) + 1));
              Functions.addItem(player, 57, 10018);
              long addexp = Experience.LEVEL[18] - player.getExp();
              player.addExpAndSp(addexp, addexp / 5, false, false);
            }
            player.sendPacket(new NpcHtmlMessage(player, this, "data/html/newbiehelper/q4-2.htm", val));
            return;
          }
          else
          {
            player.sendPacket(new NpcHtmlMessage(player, this, "data/html/newbiehelper/q4-1.htm", val).replace("%tonpc%", getQuestNpc(4, player)));
            return;
          }
        }
        player.sendPacket(new NpcHtmlMessage(player, this, "data/html/newbiehelper/q-no.htm", val));
        return;
      }
      else
      {
        player.sendPacket(new NpcHtmlMessage(player, this, "data/html/newbiehelper/q-no.htm", val));
        return;
      }
    }
    super.showChatWindow(player, val);
  }
View Full Code Here

    {
      val = st.nextToken();
    }
    if(actualCommand.equalsIgnoreCase("banish"))
    {
      NpcHtmlMessage html = new NpcHtmlMessage(player, this);
      html.setFile("data/html/residence/Banish.htm");
      sendHtmlMessage(player, html);
    }
    else if(actualCommand.equalsIgnoreCase("banish_foreigner"))
    {
      if(!isHaveRigths(player, getPrivDismiss()))
      {
        player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2ResidenceManager.NotAuthorizedToDoThis", player));
        return;
      }
      getResidence().banishForeigner(player);
      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"))
      {
        showDepositWindowClan(player);
      }
      else if(val.equalsIgnoreCase("withdraw"))
      {
        int value = Integer.valueOf(st.nextToken());
        if(value == 9)
        {
          NpcHtmlMessage html = new NpcHtmlMessage(player, this);
          html.setFile("data/html/residence/clan.htm");
          html.replace("%npcname%", getName());
          player.sendPacket(html);
        }
        else
        {
          showWithdrawWindowClan(player, value);
        }
      }
      else
      {
        NpcHtmlMessage html = new NpcHtmlMessage(player, this);
        html.setFile("data/html/residence/vault.htm");
        sendHtmlMessage(player, html);
      }
      return;
    }
    else if(actualCommand.equalsIgnoreCase("door"))
    {
      if(isHaveRigths(player, getPrivDoors()))
      {
        if(val.equalsIgnoreCase("open"))
        {
          getResidence().openCloseDoors(player, true);
        }
        else if(val.equalsIgnoreCase("close"))
        {
          getResidence().openCloseDoors(player, false);
        }
        NpcHtmlMessage html = new NpcHtmlMessage(player, this);
        html.setFile("data/html/residence/door.htm");
        sendHtmlMessage(player, html);
      }
      else
      {
        player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2ResidenceManager.NotAuthorizedToDoThis", player));
      }
    }
    else if(actualCommand.equalsIgnoreCase("functions"))
    {
      if(!isHaveRigths(player, getPrivUseFunctions()))
      {
        player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2ResidenceManager.NotAuthorizedToDoThis", player));
        return;
      }
      if(val.equalsIgnoreCase("tele"))
      {
        if(!getResidence().isFunctionActive(ResidenceFunction.TELEPORT))
        {
          NpcHtmlMessage html = new NpcHtmlMessage(player, this);
          html.setFile("data/html/residence/teleportNotActive.htm");
          sendHtmlMessage(player, html);
          return;
        }
        NpcHtmlMessage html = new NpcHtmlMessage(player, this);
        html.setFile("data/html/residence/teleport.htm");
        String template = "<a action=\"bypass -h scripts_Util:Gatekeeper %loc% %price% @811;%name%\">%name% - %price% Adena</a><br1>";
        String teleport_list = "";
        for(TeleportLocation loc : getResidence().getFunction(ResidenceFunction.TELEPORT).getTeleports())
        {
          teleport_list += template.replaceAll("%loc%", loc._target).replaceAll("%price%", String.valueOf(loc._price)).replaceAll("%name%", loc._name);
        }
        html.replace("%teleList%", teleport_list);
        sendHtmlMessage(player, html);
      }
      else if(val.equalsIgnoreCase("item_creation"))
      {
        if(!getResidence().isFunctionActive(ResidenceFunction.ITEM_CREATE))
        {
          NpcHtmlMessage html = new NpcHtmlMessage(player, this);
          html.setFile("data/html/residence/itemNotActive.htm");
          sendHtmlMessage(player, html);
          return;
        }
        NpcHtmlMessage html = new NpcHtmlMessage(player, this);
        html.setFile("data/html/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("data/html/residence/supportNotActive.htm");
          sendHtmlMessage(player, html);
          return;
        }
        NpcHtmlMessage html = new NpcHtmlMessage(player, this);
        html.setFile("data/html/residence/support.htm");
        String template = "<a action=\"bypass -h npc_%objectId%_support %id% %level%\">%name%</a><br1>";
        String support_list = "";
        int i = 0;
        for(Object[] buff : getResidence().getFunction(ResidenceFunction.SUPPORT).getBuffs())
        {
          L2Skill s = (L2Skill) buff[0];
          support_list += template.replaceAll("%id%", String.valueOf(s.getId())).replaceAll("%level%", String.valueOf(s.getLevel())).replaceAll("%name%", s.getName() + " Lv." + s.getDisplayLevel());
          if(++i % 5 == 0)
          {
            support_list += "<br>";
          }
        }
        html.replace("%magicList%", support_list);
        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("data/html/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.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2ResidenceManager.NotAuthorizedToDoThis", player));
        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(Msg.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(Msg.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(Msg.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("data/html/residence/manage.htm");
        sendHtmlMessage(player, html);
      }
      return;
    }
    else if(actualCommand.equalsIgnoreCase("support"))
View Full Code Here

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

    }
  }

  private void showManageRecovery(L2Player player)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    html.setFile("data/html/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

    sendHtmlMessage(player, html);
  }

  private void showManageOther(L2Player player)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    html.setFile("data/html/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

    sendHtmlMessage(player, html);
  }

  private void showManageDeco(L2Player player)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    html.setFile("data/html/residence/edit_deco.htm");
    replace(html, ResidenceFunction.CURTAIN, "curtain", "deco");
    replace(html, ResidenceFunction.PLATFORM, "platform", "deco");
    sendHtmlMessage(player, html);
  }
View Full Code Here

      }
      else
      {
        if(CastleManorManager.getInstance().isDisabled())
        {
          NpcHtmlMessage html = new NpcHtmlMessage(player, this);
          html.setFile("data/html/npcdefault.htm");
          html.replace("%objectId%", String.valueOf(getObjectId()));
          html.replace("%npcname%", getName());
          player.sendPacket(html);
        }
        else
        {
          showMessageWindow(player, 0);
View Full Code Here

    {
      return;
    }
    if(CastleManorManager.getInstance().isDisabled())
    {
      NpcHtmlMessage html = new NpcHtmlMessage(player, this);
      html.setFile("data/html/npcdefault.htm");
      html.replace("%objectId%", String.valueOf(getObjectId()));
      html.replace("%npcname%", getName());
      player.sendPacket(html);
      return;
    }
    int condition = validateCondition(player);
    if(condition <= COND_ALL_FALSE)
View Full Code Here

TOP

Related Classes of l2p.gameserver.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.