Package com.l2jfrozen.gameserver.network.serverpackets

Examples of com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage


    html = null;
    sb = null;
    }
  private void karma(L2PcInstance player)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
    TextBuilder sb = new TextBuilder();
    sb.append("<html>");
    sb.append("<body>");
    sb.append("<font color=\"LEVEL\"><center>Rapana the xp eater:<br></center></font>");
    sb.append("<br>");
    sb.append("<center>Players with karma cannot delevel!</center>");
    sb.append("<br>");
    sb.append("</body>");
    sb.append("</html>");
    html.setHtml(sb.toString());
    player.sendPacket(html);
    html = null;
    sb = null;
    }
View Full Code Here


    html = null;
    sb = null;
    }
  private void adena(L2PcInstance player)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
    TextBuilder sb = new TextBuilder();
    sb.append("<html>");
    sb.append("<body>");
    sb.append("<font color=\"LEVEL\"><center>Rapana the xp eater:<br></center></font>");
    sb.append("<br>");
    sb.append("<center>You don't have enough adena!</center>");
    sb.append("<br>");
    sb.append("</body>");
    sb.append("</html>");
    html.setHtml(sb.toString());
    player.sendPacket(html);
    html = null;
    sb = null;
    }
View Full Code Here

    else
    {
      tb.append(end1);
    }

    activeChar.sendPacket(new NpcHtmlMessage(5, tb.toString()));

    end1 = null;
    end2 = null;
    mobs = null;
    tb = null;
View Full Code Here

    else
    {
      tb.append(end1);
    }

    activeChar.sendPacket(new NpcHtmlMessage(5, tb.toString()));

    tb = null;
    mobs = null;
    end1 = null;
    end2 = null;
View Full Code Here

    if(!checkAllowed(activeChar))
      return false;

    if(command.compareTo(PowerPakConfig.BUFFER_COMMAND)==0)
    {
      NpcHtmlMessage htm = new NpcHtmlMessage(activeChar.getLastQuestNpcObject());
      String text = HtmCache.getInstance().getHtm("data/html/default/"+PowerPakConfig.BUFFER_NPC+".htm");
      htm.setHtml(text);
      activeChar.sendPacket(htm);
    }
    return false;
  }
View Full Code Here

        text = text.replace("-h custom_do", "bbs_bbs");
        BaseBBSManager.separateAndSend(text, player);
      }
      else
      {
        NpcHtmlMessage htm = new NpcHtmlMessage(player.getLastQuestNpcObject());
        htm.setHtml(text);
        player.sendPacket(htm);
      }
    }
    else if(parameters.startsWith("RestoreAll")) {
      if(player.getAdena()<PowerPakConfig.BUFFER_PRICE*3) {
        player.sendMessage("You don't have enough adena");
        return;
      }
      player.getStatus().setCurrentCp(player.getMaxCp());
      player.getStatus().setCurrentMp(player.getMaxMp());
      player.getStatus().setCurrentHp(player.getMaxHp());
      player.reduceAdena("Buff", PowerPakConfig.BUFFER_PRICE*3, null, true);
    }
    else if(parameters.startsWith("RestorePetAll")) {
      if(player.getAdena()<PowerPakConfig.BUFFER_PRICE*3) {
        player.sendMessage("You don't have enough adena");
        return;
      }
      player.getPet().getStatus().setCurrentMp(player.getPet().getMaxMp());
      player.getPet().getStatus().setCurrentHp(player.getPet().getMaxHp());
      player.reduceAdena("Buff", PowerPakConfig.BUFFER_PRICE*3, null, true);
    }
    else if(parameters.startsWith("RestoreCP")) {
      if(player.getAdena()<PowerPakConfig.BUFFER_PRICE) {
        player.sendMessage("You don't have enough adena");
        return;
      }
      player.getStatus().setCurrentCp(player.getMaxCp());
      player.reduceAdena("Buff", PowerPakConfig.BUFFER_PRICE, null, true);
    }
    else if(parameters.startsWith("RestoreMP")) {
      if(player.getAdena()<PowerPakConfig.BUFFER_PRICE) {
        player.sendMessage("You don't have enough adena");
        return;
      }
      player.getStatus().setCurrentMp(player.getMaxMp());
      player.reduceAdena("Buff", PowerPakConfig.BUFFER_PRICE, null, true);
    }
    else if(parameters.startsWith("RestorePetMP")) {
      if(player.getAdena()<PowerPakConfig.BUFFER_PRICE) {
        player.sendMessage("You don't have enough adena");
        return;
      }
      player.getPet().getStatus().setCurrentMp(player.getPet().getMaxMp());
      player.reduceAdena("Buff", PowerPakConfig.BUFFER_PRICE, null, true);
    }
    else if(parameters.startsWith("RestoreHP")) {
      if(player.getAdena()<PowerPakConfig.BUFFER_PRICE) {
        player.sendMessage("You don't have enough adena");
        return;
      }
      player.getStatus().setCurrentHp(player.getMaxHp());
      player.reduceAdena("Buff", PowerPakConfig.BUFFER_PRICE, null, true);
    }
    else if(parameters.startsWith("RestorePetHP")) {
      if(player.getAdena()<PowerPakConfig.BUFFER_PRICE) {
        player.sendMessage("You don't have enough adena");
        return;
      }
      player.getPet().getStatus().setCurrentHp(player.getPet().getMaxHp());
      player.reduceAdena("Buff", PowerPakConfig.BUFFER_PRICE, null, true);
    }
    else if(parameters.startsWith("MakeBuffs") || parameters.startsWith("RestoreBuffs"))
    {
      String buffName = parameters.substring(9).trim();
      int totaladena = 0;
      ArrayList<Buff> buffs = null;
      if(parameters.startsWith("RestoreBuffs"))
        buffs = getOwnBuffs(player.getObjectId());
      else 
        buffs = BuffTable.getInstance().getBuffsForName(buffName);
      if(buffs!=null && buffs.size()==1)
      {
        if(!getOwnBuffs(player.getObjectId()).contains(buffs.get(0)))
          getOwnBuffs(player.getObjectId()).add(buffs.get(0));
      }
      if(buffs==null || buffs.size()==0){
        player.sendMessage("Your buff set is missing");
        return;
      }
      for(Buff buff: buffs)
      {
       
        L2Skill skill = SkillTable.getInstance().getInfo(buff._skillId, buff._skillLevel);
        if(skill!=null)
        {
          if(player.getLevel()>= buff._minLevel && player.getLevel()<=buff._maxLevel)
          {
            if(buff._price>0)
            {
              totaladena+=buff._price;
              if(player.getAdena()<totaladena)
              {
                player.sendMessage("You don't have enough adena");
                break;
              }
            }
            if(!buff._force && buffer!=null)
            {
              buffer.setBusy(true);
              buffer.setCurrentMp(buffer.getMaxMp());
              buffer.setTarget(player);
              //buffer.doCast(skill);
              skill.getEffects(buffer, player,false,false,false);
              buffer.setBusy(false);
            } else
              skill.getEffects(player, player,false,false,false);
          }
          try
          {
            Thread.sleep(100); // Delay for the packet...
          }
          catch(InterruptedException e)
          {
            if(Config.ENABLE_ALL_EXCEPTIONS)
              e.printStackTrace();
          }
        }
      }
      if(totaladena>0)
        player.reduceAdena("Buff", totaladena, null, true);
      if(_visitedPages.get(player.getObjectId())!=null)
        handleCommand(command,player,"Chat "+_visitedPages.get(player.getObjectId()));
      else
        useVoicedCommand(PowerPakConfig.BUFFER_COMMAND, player, "");
    }else if(parameters.startsWith("MakePetBuffs") || parameters.startsWith("RestorePetBuffs"))
    {
      if(player.getPet()==null){
        player.sendMessage("You have not a summoned pet");
        return;
      }
     
      String buffName = parameters.substring(12).trim();
     
      int totaladena = 0;
      ArrayList<Buff> buffs = null;
      if(parameters.startsWith("RestorePetBuffs"))
        buffs = getOwnBuffs(player.getPet().getObjectId());
      else 
        buffs = BuffTable.getInstance().getBuffsForName(buffName);
     
      if(buffs!=null && buffs.size()==1)
      {
       
        if(!getOwnBuffs(player.getPet().getObjectId()).contains(buffs.get(0))){
          getOwnBuffs(player.getPet().getObjectId()).add(buffs.get(0));
        }
      }
      if(buffs==null || buffs.size()==0){
        player.sendMessage("Your pet buff set is missing");
        return;
      }
      for(Buff buff: buffs)
      {
       
        L2Skill skill = SkillTable.getInstance().getInfo(buff._skillId, buff._skillLevel);
        if(skill!=null)
        {
          if(player.getLevel()>= buff._minLevel && player.getLevel()<=buff._maxLevel)
          {
            if(buff._price>0)
            {
              totaladena+=buff._price;
              if(player.getAdena()<totaladena)
              {
                player.sendMessage("You don't have enough adena");
                break;
              }
            }
            if(!buff._force && buffer!=null)
            {
              buffer.setBusy(true);
              buffer.setCurrentMp(buffer.getMaxMp());
              buffer.setTarget(player.getPet());
              skill.getEffects(buffer, player.getPet(),false,false,false);
              //buffer.doCast(skill);
              buffer.setBusy(false);
            } else
              skill.getEffects(player, player.getPet(),false,false,false);
          }
          try
          {
            Thread.sleep(100); // Delay for the packet...
          }
          catch(InterruptedException e)
          {
            if(Config.ENABLE_ALL_EXCEPTIONS)
              e.printStackTrace();
          }
        }
      }
      if(totaladena>0)
        player.reduceAdena("Buff", totaladena, null, true);
      if(_visitedPages.get(player.getObjectId())!=null)
        handleCommand(command,player,"Chat "+_visitedPages.get(player.getObjectId()));
      else
        useVoicedCommand(PowerPakConfig.BUFFER_COMMAND, player, "");
     
     
    //SCHEMAS
    }else if (currentCommand.startsWith("menu"))
    {
      NpcHtmlMessage html = new NpcHtmlMessage(1);
      html.setFile(PARENT_DIR + "menu.htm");
      sendHtmlMessage(player, html);
    }
    // handles giving effects {support player, support pet, givebuffs}
    else if (currentCommand.startsWith("support"))
    {
      String targettype = st.nextToken();
      showGiveBuffsWindow(player, targettype);
    }
    else if (currentCommand.startsWith("givebuffs"))
    {
      String targettype = st.nextToken();
      String scheme_key = st.nextToken();
      int cost = Integer.parseInt(st.nextToken());
      if (cost == 0 || cost <= player.getInventory().getAdena())
      {
        L2Character target = player;
        if (targettype.equalsIgnoreCase("pet"))
          target = player.getPet();
       
        if (target != null)
        {
          for (L2Skill sk : CharSchemesTable.getInstance().getScheme(player.getObjectId(), scheme_key))
            if(buffer!=null)
            {
              buffer.setBusy(true);
              buffer.setCurrentMp(buffer.getMaxMp());
              buffer.setTarget(target);
              //buffer.doCast(skill);
              sk.getEffects(buffer, target,false,false,false);
              buffer.setBusy(false);
            } else
              sk.getEffects(target, target,false,false,false);
         
            //sk.getEffects(buffer, target);
         
          player.reduceAdena("NPC Buffer", cost, null, true);
       
        }else
        {
          player.sendMessage("Incorrect Target");
          // go to main menu
          NpcHtmlMessage html = new NpcHtmlMessage(1);
          html.setFile(PARENT_DIR + "menu.htm");
          sendHtmlMessage(player, html);
        }
      }
      else
      {
View Full Code Here

        tb.append("<tr><td width=\"90\"><a action=\"bypass -h custom_dobuff givebuffs " + targettype + " " + e.getKey() + " " + String.valueOf(cost) + "\">" + e.getKey() + "</a></td><td>Fee: " + String.valueOf(cost) + "</td></tr>");
      }
      tb.append("</table>");
    }
    tb.append("</body></html>");
    NpcHtmlMessage html = new NpcHtmlMessage(1);
    html.setHtml(tb.toString());
    sendHtmlMessage(player, html);
  }
View Full Code Here

    tb.append("</table>");
    tb.append("<br><font color=\"LEVEL\">Max schemes per player: " + String.valueOf(4) + "</font>");
    tb.append("<br><br>");
    tb.append("<a action=\"bypass -h custom_dobuff menu\">Back</a>");
    tb.append("</body></html>");
    NpcHtmlMessage html = new NpcHtmlMessage(1);
    html.setHtml(tb.toString());
    sendHtmlMessage(player, html);
  }
View Full Code Here

   * @param skill_group
   * @param scheme_key
   */
  private void showEditSchemeWindow(L2PcInstance player, String skill_group, String scheme_key)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(1);
    html.setFile(PARENT_DIR + "schememenu.htm");
    html.replace("%typesframe%", getTypesFrame(scheme_key));
    if (skill_group.equalsIgnoreCase("unselected"))
    {
      html.replace("%schemelistframe%", getPlayerSchemeListFrame(player, skill_group, scheme_key));
      html.replace("%skilllistframe%", getGroupSkillListFrame(player, null, null));
      html.replace("%myschemeframe%", getPlayerSkillListFrame(player, null, null));
    }
    else
    {
      html.replace("%schemelistframe%", getPlayerSchemeListFrame(player, skill_group, scheme_key));
      html.replace("%skilllistframe%", getGroupSkillListFrame(player, skill_group, scheme_key));
      html.replace("%myschemeframe%", getPlayerSkillListFrame(player, skill_group, scheme_key));
    }
    sendHtmlMessage(player, html);
  }
View Full Code Here

  {
    if(path.indexOf("..") != -1)
      return;

    String filename = "data/html/help/" + path;
    NpcHtmlMessage html = new NpcHtmlMessage(1);
    html.setFile(filename);
    activeChar.sendPacket(html);
  }
View Full Code Here

TOP

Related Classes of com.l2jfrozen.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.