Package l2p.gameserver.serverpackets

Examples of l2p.gameserver.serverpackets.NpcHtmlMessage


    else if(command.startsWith("WithdrawP"))
    {
      int val = Integer.parseInt(command.substring(10));
      if(val == 9)
      {
        NpcHtmlMessage html = new NpcHtmlMessage(player, this);
        html.setFile("data/html/npc-friend/personal.htm");
        html.replace("%npcname%", getName());
        player.sendPacket(html);
      }
      else
      {
        showRetrieveWindow(player, val);
View Full Code Here


        {
          filename = "data/html/fortress/SupportUnitCaptain-" + 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

      }
      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 if(!player.isGM() // Player is not GM
          && player.isClanLeader() // Player is clan leader of clan (then he is the lord)
          && getCastle() != null && getCastle().getId() > 0 // Verification of castle
View Full Code Here

    // to initial screen.
  }

  private void showMessageWindow(L2Player player, String filename)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    html.setFile(getHtmlPath() + filename);
    html.replace("%objectId%", String.valueOf(getObjectId()));
    html.replace("%npcId%", String.valueOf(getNpcId()));
    html.replace("%npcname%", getName());
    player.sendPacket(html);
  }
View Full Code Here

          {
            content = content.replaceAll("%stoneColor%", stoneColor);
            content = content.replaceAll("%stoneValue%", String.valueOf(stoneValue));
            content = content.replaceAll("%stoneCount%", String.valueOf(stoneCount));
            content = content.replaceAll("%stoneItemId%", String.valueOf(stoneId));
            NpcHtmlMessage html = new NpcHtmlMessage(player, this);
            html.setHtml(content);
            player.sendPacket(html);
          }
          else
          {
            _log.warning("Problem with HTML text " + SevenSigns.SEVEN_SIGNS_HTML_PATH + "signs_17.htm: " + path);
          }
          break;
        case 18: // Exchange Seal Stones for Ancient Adena - SevenSigns 18 xxxx xxxxxx
          int convertStoneId = Integer.parseInt(command.substring(14, 18));
          long convertCount = 0;
          try
          {
            convertCount = Long.parseLong(command.substring(19).trim());
          }
          catch(Exception NumberFormatException)
          {
            player.sendMessage(new CustomMessage("common.IntegerAmount", player));
            break;
          }
          L2ItemInstance convertItem = player.getInventory().getItemByItemId(convertStoneId);
          if(convertItem == null)
          {
            player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2SignsPriestInstance.DontHaveAnySSType", player));
            break;
          }
          long totalCount = convertItem.getCount();
          long ancientAdenaReward = 0;
          if(convertCount <= totalCount && convertCount > 0)
          {
            switch(convertStoneId)
            {
              case SevenSigns.SEAL_STONE_BLUE_ID:
                ancientAdenaReward = SevenSigns.calcAncientAdenaReward(convertCount, 0, 0);
                break;
              case SevenSigns.SEAL_STONE_GREEN_ID:
                ancientAdenaReward = SevenSigns.calcAncientAdenaReward(0, convertCount, 0);
                break;
              case SevenSigns.SEAL_STONE_RED_ID:
                ancientAdenaReward = SevenSigns.calcAncientAdenaReward(0, 0, convertCount);
                break;
            }
            L2ItemInstance temp = player.getInventory().getItemByItemId(convertStoneId);
            if(temp != null && temp.getCount() >= convertCount)
            {
              player.getInventory().destroyItemByItemId(convertStoneId, convertCount, true);
              ancientAdena = ItemTable.getInstance().createItem(SevenSigns.ANCIENT_ADENA_ID);
              ancientAdena.setCount(ancientAdenaReward);
              player.getInventory().addItem(ancientAdena);
              player.sendPacket(SystemMessage.removeItems(convertStoneId, convertCount), SystemMessage.obtainItems(SevenSigns.ANCIENT_ADENA_ID, ancientAdenaReward, 0));
            }
          }
          else
          {
            player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2SignsPriestInstance.DontHaveSSAmount", player));
          }
          break;
        case 19: // Seal Information (for when joining a cabal)
          int chosenSeal = Integer.parseInt(command.substring(16));
          String fileSuffix = SevenSigns.getSealName(chosenSeal, true) + "_" + SevenSigns.getCabalShortName(cabal);
          showChatWindow(player, val, fileSuffix, false);
          break;
        case 20: // Seal Status (for when joining a cabal)
          StringBuffer contentBuffer = new StringBuffer("<html><body><font color=\"LEVEL\">[Seal Status]</font><br>");
          for(int i = 1; i < 4; i++)
          {
            int sealOwner = SevenSigns.getInstance().getSealOwner(i);
            if(sealOwner != SevenSigns.CABAL_NULL)
            {
              contentBuffer.append("[" + SevenSigns.getSealName(i, false) + ": " + SevenSigns.getCabalName(sealOwner) + "]<br>");
            }
            else
            {
              contentBuffer.append("[" + SevenSigns.getSealName(i, false) + ": Nothingness]<br>");
            }
          }
          contentBuffer.append("<a action=\"bypass -h npc_" + getObjectId() + "_SevenSigns 3 " + cabal + "\">Go back.</a></body></html>");
          NpcHtmlMessage html2 = new NpcHtmlMessage(player, this);
          html2.setHtml(contentBuffer.toString());
          player.sendPacket(html2);
          break;
        default:
          // 1 = Purchase Record Intro
          // 5 = Contrib Seal Stones Intro
View Full Code Here

        filename += "mammblack_1.htm";
        break;
      default:
        filename = getHtmlPath(npcId, val);
    }
    player.sendPacket(new NpcHtmlMessage(player, this, filename, val));
  }
View Full Code Here

        {
          plyr.setAccountAccesslevel(0, "admin_unban_menu", 0);
        }
      }
    }
    activeChar.sendPacket(new NpcHtmlMessage(5).setFile("data/html/admin/charmanage.htm"));
    return true;
  }
View Full Code Here

    }
  }

  public void showMainPage(L2Player activeChar)
  {
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    TextBuilder replyMSG = new TextBuilder("<html><body>");
    replyMSG.append("<center><table width=260><tr><td width=40>");
    replyMSG.append("<button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\">");
    replyMSG.append("</td><td width=180>");
    replyMSG.append("<center>Enchant Equip</center>");
    replyMSG.append("</td><td width=40>");
    replyMSG.append("</td></tr></table></center><br>");
    replyMSG.append("<center><table width=270><tr><td>");
    replyMSG.append("<button value=\"Underwear\" action=\"bypass -h admin_setun $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Helmet\" action=\"bypass -h admin_seteh $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Cloak\" action=\"bypass -h admin_setba $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Mask\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Necklace\" action=\"bypass -h admin_seten $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td></tr></table>");
    replyMSG.append("</center><center><table width=270><tr><td>");
    replyMSG.append("<button value=\"Weapon\" action=\"bypass -h admin_setew $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Chest\" action=\"bypass -h admin_setec $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Shield\" action=\"bypass -h admin_setes $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Earring\" action=\"bypass -h admin_setre $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Earring\" action=\"bypass -h admin_setle $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td></tr></table>");
    replyMSG.append("</center><center><table width=270><tr><td>");
    replyMSG.append("<button value=\"Gloves\" action=\"bypass -h admin_seteg $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Leggings\" action=\"bypass -h admin_setel $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Boots\" action=\"bypass -h admin_seteb $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Ring\" action=\"bypass -h admin_setrf $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td><td>");
    replyMSG.append("<button value=\"Ring\" action=\"bypass -h admin_setlf $menu_command\" width=50 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td></tr></table>");
    replyMSG.append("</center><br>");
    replyMSG.append("<center>[Enchant 0-65535]</center>");
    replyMSG.append("<center><edit var=\"menu_command\" width=100 height=15></center><br>");
    replyMSG.append("</body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

    return null;
  }

  public static void showHtmlFile(L2Player player, String file, L2NpcInstance npc, L2Player member)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
    html.setFile("data/html/SepulcherNpc/" + file);
    if(member != null)
    {
      html.replace("%member%", member.getName());
    }
    player.sendPacket(html);
  }
View Full Code Here

    {
      fis = new FileInputStream(file);
      byte[] raw = new byte[fis.available()];
      fis.read(raw);
      String content = new String(raw, "UTF-8");
      NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
      adminReply.setHtml(content);
      targetChar.sendPacket(adminReply);
    }
    catch(Exception e)
    {
    }
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.