Package com.l2jfrozen.gameserver.network.serverpackets

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


  /**
   * @param activeChar
   */
  private void addMenu(L2PcInstance activeChar)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(activeChar.getObjectId());
    TextBuilder sb = new TextBuilder();
    sb.append("<html><body><font color=\"009900\">Editing Walkers</font><br>");
    sb.append("<br>");
    sb.append("Is chosen NPCID: " + _npcid + "<br>");
    sb.append("Number of the current point: " + _point + "<br>");
    sb.append("Number of the current route: " + _routeid + "<br>");

    if(_mode == 1)
    {
      sb.append("Mode: Run<br>");
    }
    else
    {
      sb.append("Mode: Step<br>");
    }

    if(_text.isEmpty())
    {
      sb.append("The phrase is not established<br>");
    }
    else
    {
      sb.append("The phrase: " + _text + "<br>");
    }

    sb.append("<edit var=\"id\" width=80 height=15><br>");
    sb.append("<button value=\"To establish a phrase\" action=\"bypass -h admin_walker_setmessage $id width=80 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>");
    sb.append("<button value=\"To add a point\" action=\"bypass -h admin_walker_setpoint width=80 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>");
    sb.append("<button value=\"To change a mode\" action=\"bypass -h admin_walker_setmode width=80 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>");
    sb.append("<button value=\"The main menu\" action=\"bypass -h admin_walker_menu width=80 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>");
    sb.append("</body></html>");
    html.setHtml(sb.toString());
    activeChar.sendPacket(html);
  }
View Full Code Here


      else if(command.startsWith("open_doors"))
      {
        if(condition == COND_HALL_OWNER)
        {
          getClanHall().openCloseDoors(true);
          player.sendPacket(new NpcHtmlMessage(getObjectId(), "<html><body>You have <font color=\"LEVEL\">opened</font> the clan hall door.<br>Outsiders may enter the clan hall while the door is open. Please close it when you've finished your business.<br><center><button value=\"Close\" action=\"bypass -h npc_" + getObjectId() + "_close_doors\" width=70 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></center></body></html>"));
        }
        else if(condition == COND_CASTLE_OWNER)
        {
          //DoorTable doorTable = DoorTable.getInstance();
          StringTokenizer st = new StringTokenizer(command.substring(10), ", ");
          st.nextToken(); // Bypass first value since its castleid/hallid

          while(st.hasMoreTokens())
          {
            getCastle().openDoor(player, Integer.parseInt(st.nextToken()));
          }

          st = null;
          return;
        }
        else if(condition == COND_FORT_OWNER)
        {
          StringTokenizer st = new StringTokenizer(command.substring(10), ", ");
          st.nextToken(); // Bypass first value since its castleid/hallid/fortid

          while(st.hasMoreTokens())
          {
            getFort().openDoor(player, Integer.parseInt(st.nextToken()));
          }

          st = null;
          return;
        }

      }

      if(command.startsWith("RideWyvern"))
      {
        if(!player.isClanLeader())
        {
          player.sendMessage("Only clan leaders are allowed.");
          return;
        }
        if(player.getPet() == null)
        {
          if(player.isMounted())
          {
            SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
            sm.addString("You Already Have a Pet or Are Mounted.");
            player.sendPacket(sm);
          }
          else
          {
            SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
            sm.addString("Summon your Strider first.");
            player.sendPacket(sm);
          }
          return;
        }
        else if(player.getPet().getNpcId() == 12526 || player.getPet().getNpcId() == 12527 || player.getPet().getNpcId() == 12528)
        {
          if(player.getInventory().getItemByItemId(1460) != null && player.getInventory().getItemByItemId(1460).getCount() >= 10)
          {
            if(player.getPet().getLevel() < 55)
            {
              SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
              sm.addString("Your Strider Has not reached the required level.");
              player.sendPacket(sm);
            }
            else
            {
              if(!player.disarmWeapons())
                return;
              player.getPet().unSummon(player);
              player.getInventory().destroyItemByItemId("Wyvern", 1460, 10, player, player.getTarget());
              Ride mount = new Ride(player.getObjectId(), Ride.ACTION_MOUNT, 12621);
              player.sendPacket(mount);
              player.broadcastPacket(mount);
              player.setMountType(mount.getMountType());
              player.addSkill(SkillTable.getInstance().getInfo(4289, 1));
              SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
              sm.addString("The Wyvern has been summoned successfully!");
              player.sendPacket(sm);
            }
          }
          else
          {
            SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
            sm.addString("You need 10 Crystals: B Grade.");
            player.sendPacket(sm);
          }
          return;
        }
        else
        {
          SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
          sm.addString("Unsummon your pet.");
          player.sendPacket(sm);
          sm = null;
          return;
        }
      }
      else if(command.startsWith("close_doors"))
      {
        if(condition == COND_HALL_OWNER)
        {
          getClanHall().openCloseDoors(false);
          player.sendPacket(new NpcHtmlMessage(getObjectId(), "<html><body>You have <font color=\"LEVEL\">closed</font> the clan hall door.<br>Good day!<br><center><button value=\"To Begining\" action=\"bypass -h npc_" + getObjectId() + "_Chat\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></center></body></html>"));
        }
        else if(condition == COND_CASTLE_OWNER)
        {
          //DoorTable doorTable = DoorTable.getInstance();
          StringTokenizer st = new StringTokenizer(command.substring(11), ", ");
View Full Code Here

    {
      filename = "data/html/doormen/fortress/" + getTemplate().npcId + ".htm"; // Owner message window
    }

    // Prepare doormen for clan hall
    NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
    String str;
    if(getClanHall() != null)
    {
      if(condition == COND_HALL_OWNER)
      {
        str = "<html><body>Hello!<br><font color=\"55FFFF\">" + getName() + "</font>, I am honored to serve your clan.<br>How may i assist you?<br>";
        str += "<center><br><button value=\"Open Door\" action=\"bypass -h npc_%objectId%_open_doors\" width=70 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>";
        str += "<button value=\"Close Door\" action=\"bypass -h npc_%objectId%_close_doors\" width=70 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>";
        if(getClanHall().getId() >= 36 && getClanHall().getId() <= 41)
        {
          str += "<button value=\"Wyvern Exchange\" action=\"bypass -h npc_%objectId%_RideWyvern\" width=85 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></center></body></html>";
        }
        else
        {
          str += "</center></body></html>";
        }
      }
      else
      {
        L2Clan owner = ClanTable.getInstance().getClan(getClanHall().getOwnerId());
        if(owner != null && owner.getLeader() != null)
        {
          str = "<html><body>Hello there!<br>This clan hall is owned by <font color=\"55FFFF\">" + owner.getLeader().getName() + " who is the Lord of the ";
          str += owner.getName() + "</font> clan.<br>";
          str += "I am sorry, but only the clan members who belong to the <font color=\"55FFFF\">" + owner.getName() + "</font> clan can enter the clan hall.</body></html>";
        }
        else
        {
          str = "<html><body>" + getName() + ":<br1>Clan hall <font color=\"LEVEL\">" + getClanHall().getName() + "</font> have no owner clan.<br>You can rent it at auctioneers..</body></html>";
        }
      }
      html.setHtml(str);
    }
    else
    {
      html.setFile(filename);
    }

    html.replace("%objectId%", String.valueOf(getObjectId()));
    player.sendPacket(html);

    filename = null;
    html = null;
    str = null;
View Full Code Here

    return _adminCommands;
  }

  public void showMainPage(L2PcInstance activeChar)
  {
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    TextBuilder replyMSG = new TextBuilder("<html><body>");

    replyMSG.append("<center><font color=\"LEVEL\">[VIP Engine]</font></center><br><br><br>");
    replyMSG.append("<table><tr><td><edit var=\"input1\" width=\"50\"></td><td><edit var=\"input2\" width=\"50\"></td><td><edit var=\"input3\" width\"50\"></td></tr></table>");

    replyMSG.append("<table border=\"0\"><tr>");
    replyMSG.append("<td width=\"100\"><button value=\"Set Team\" action=\"bypass -h admin_vip_setteam $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    replyMSG.append("<td width=\"100\"><button value=\"Random Team\" action=\"bypass -h admin_vip_randomteam\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    replyMSG.append("</tr><tr>");

    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG.append("<td width=\"100\"><button value=\"Set Time\" action=\"bypass -h admin_vip_settime $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    replyMSG.append("<td width=\"100\"><button value=\"Set Delay\" action=\"bypass -h admin_vip_setdelay $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    replyMSG.append("<td width=\"100\"><button value=\"Set Area\" action=\"bypass -h admin_vip_setarea $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    replyMSG.append("</tr><tr>");

    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG.append("<td width=\"100\"><button value=\"End NPC\" action=\"bypass -h admin_vip_endnpc $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    replyMSG.append("<td width=\"100\"><button value=\"Join NPC\" action=\"bypass -h admin_vip_joinnpc $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");  
    replyMSG.append("<td width=\"100\"><button value=\"Join LOC\" action=\"bypass -h admin_vip_joinlocxyz $input1 $input2 $input3\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    replyMSG.append("</tr><tr>");

    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG.append("<td width=\"100\"><button value=\"VIP Reward\" action=\"bypass -h admin_vip_vipreward $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    replyMSG.append("<td width=\"100\"><button value=\"VIP Reward Am\" action=\"bypass -h admin_vip_viprewardamount $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");

    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG.append("<td width=\"100\"><button value=\"Not VIP Reward\" action=\"bypass -h admin_vip_notvipreward $input1\" width=130 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    replyMSG.append("<td width=\"100\"><button value=\"Not VIP Reward Am\" action=\"bypass -h admin_vip_notviprewardamount $input1\" width=130 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");

    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG.append("<td width=\"100\"><button value=\"The VIP Reward\" action=\"bypass -h admin_vip_thevipreward $input1\" width=130 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    replyMSG.append("<td width=\"100\"><button value=\"The VIP Reward Am\" action=\"bypass -h admin_vip_theviprewardamount $input1\" width=130 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    replyMSG.append("</tr><tr>");

    replyMSG.append("</tr></table><br><table><tr>");
    replyMSG.append("<td width=\"100\"><button value=\"Start Join\" action=\"bypass -h admin_vip_joininit\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    replyMSG.append("</tr></table><br><br>");

    replyMSG.append("<font color=\"LEVEL\">VIP Settings...</font><br1>");
    replyMSG.append("Team:&nbsp;<font color=\"FFFFFF\">" + VIP._teamName + "</font><br>");
    replyMSG.append("Delay:&nbsp;<font color=\"FFFFFF\">" + VIP._delay/1000/60 + "</font><br1>");
    replyMSG.append("Time:&nbsp;<font color=\"FFFFFF\">" + VIP._time/1000/60 + "</font><br>");
    replyMSG.append("End NPC ID:&nbsp;<font color=\"FFFFFF\">" + VIP._endNPC + " (" + VIP.getNPCName(VIP._endNPC, activeChar) + ")</font><br1>");
    replyMSG.append("Join NPC ID:&nbsp;<font color=\"FFFFFF\">" + VIP._joinNPC + " (" + VIP.getNPCName(VIP._joinNPC, activeChar) + ")</font><br>");
    replyMSG.append("Start Location:&nbsp;<font color=\"FFFFFF\">" + VIP._startX + "," + VIP._startY + "," + VIP._startZ + "</font><br1>");
    replyMSG.append("End Location:&nbsp;<font color=\"FFFFFF\">" + VIP._endX + "," + VIP._endY + "," + VIP._endZ + "</font><br1>");
    replyMSG.append("Join Location:&nbsp;<font color=\"FFFFFF\">" + VIP._joinX + "," + VIP._joinY + "," + VIP._joinZ + "</font><br>");
    replyMSG.append("VIP Team Reward:&nbsp;<font color=\"FFFFFF\">" + VIP.getItemName(VIP._vipReward, activeChar) + " (" + VIP._vipRewardAmount + ")</font><br1>");
    replyMSG.append("Not VIP Team Reward:&nbsp;<font color=\"FFFFFF\">" + VIP.getItemName(VIP._notVipReward, activeChar) + " (" + VIP._notVipRewardAmount + ")</font><br1>");
    replyMSG.append("VIP Reward:&nbsp;<font color=\"FFFFFF\">" + VIP.getItemName(VIP._theVipReward, activeChar) + " (" + VIP._theVipRewardAmount + ")</font><br>");

    replyMSG.append("</body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

  {
    if(_state == ACCEPTING_BETS)
      return;
    int npcId = getTemplate().npcId;
    String filename, search;
    NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
    filename = getHtmlPath(npcId, 5);
    html.setFile(filename);
    for(int i = 0; i < 8; i++)
    {
      int n = i + 1;
      search = "Mob" + n;
      html.replace(search, MonsterRace.getInstance().getMonsters()[i].getTemplate().name);
    }
    html.replace("1race", String.valueOf(_raceNumber));
    html.replace("%objectId%", String.valueOf(getObjectId()));
    player.sendPacket(html);
    player.sendPacket(ActionFailed.STATIC_PACKET);

    search = null;
    filename = null;
View Full Code Here

  public void showMonsterInfo(L2PcInstance player)
  {
    int npcId = getTemplate().npcId;
    String filename, search;
    NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
    filename = getHtmlPath(npcId, 6);
    html.setFile(filename);
    for(int i = 0; i < 8; i++)
    {
      int n = i + 1;
      search = "Mob" + n;
      html.replace(search, MonsterRace.getInstance().getMonsters()[i].getTemplate().name);
    }
    html.replace("%objectId%", String.valueOf(getObjectId()));
    player.sendPacket(html);
    player.sendPacket(ActionFailed.STATIC_PACKET);

    search = null;
    filename = null;
View Full Code Here

    if(_state != ACCEPTING_BETS)
      return;
    int npcId = getTemplate().npcId;
    SystemMessage sm;
    String filename, search, replace;
    NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
    if(val < 10)
    {
      filename = getHtmlPath(npcId, 2);
      html.setFile(filename);
      for(int i = 0; i < 8; i++)
      {
        int n = i + 1;
        search = "Mob" + n;
        html.replace(search, MonsterRace.getInstance().getMonsters()[i].getTemplate().name);
      }
      search = "No1";
      if(val == 0)
      {
        html.replace(search, "");
      }
      else
      {
        html.replace(search, "" + val);
        player.setRace(0, val);
      }
    }
    else if(val < 20)
    {
      if(player.getRace(0) == 0)
        return;
      filename = getHtmlPath(npcId, 3);
      html.setFile(filename);
      html.replace("0place", "" + player.getRace(0));
      search = "Mob1";
      replace = MonsterRace.getInstance().getMonsters()[player.getRace(0) - 1].getTemplate().name;
      html.replace(search, replace);
      search = "0adena";
      if(val == 10)
      {
        html.replace(search, "");
      }
      else
      {
        html.replace(search, "" + _cost[val - 11]);
        player.setRace(1, val - 10);
      }
    }
    else if(val == 20)
    {
      if(player.getRace(0) == 0 || player.getRace(1) == 0)
        return;
      filename = getHtmlPath(npcId, 4);
      html.setFile(filename);
      html.replace("0place", "" + player.getRace(0));
      search = "Mob1";
      replace = MonsterRace.getInstance().getMonsters()[player.getRace(0) - 1].getTemplate().name;
      html.replace(search, replace);
      search = "0adena";
      int price = _cost[player.getRace(1) - 1];
      html.replace(search, "" + price);
      search = "0tax";
      int tax = 0;
      html.replace(search, "" + tax);
      search = "0total";
      int total = price + tax;
      html.replace(search, "" + total);
    }
    else
    {
      if(player.getRace(0) == 0 || player.getRace(1) == 0)
        return;
      int ticket = player.getRace(0);
      int priceId = player.getRace(1);
      if(!player.reduceAdena("Race", _cost[priceId - 1], this, true))
        return;
      player.setRace(0, 0);
      player.setRace(1, 0);
      sm = new SystemMessage(SystemMessageId.ACQUIRED);
      sm.addNumber(_raceNumber);
      sm.addItemName(4443);
      player.sendPacket(sm);
      L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), 4443);
      item.setCount(1);
      item.setEnchantLevel(_raceNumber);
      item.setCustomType1(ticket);
      item.setCustomType2(_cost[priceId - 1] / 100);
      player.getInventory().addItem("Race", item, player, this);
      InventoryUpdate iu = new InventoryUpdate();
      iu.addItem(item);
      L2ItemInstance adenaupdate = player.getInventory().getItemByItemId(57);
      iu.addModifiedItem(adenaupdate);
      player.sendPacket(iu);
      iu = null;
      item = null;
      return;
    }
    html.replace("1race", String.valueOf(_raceNumber));
    html.replace("%objectId%", String.valueOf(getObjectId()));
    player.sendPacket(html);
    player.sendPacket(ActionFailed.STATIC_PACKET);

    sm = null;
    html = null;
View Full Code Here

        }
  }
  //mod 2
  private void delevelInfo(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("Hello traveler, I am the delevel manager!<br> I can reduce your level, one level at a time.<br>So, I believe you didn't come here just to waste my time<Br>You can't find any service like mine anywhere in this region.<br>Well then,do you want to decrease your previous experience? I can help you do so for 1,000 adena!<br>");
    sb.append("<br>");
    sb.append("<br><br>");
    sb.append("<center><a action=\"bypass -h npc_" + getObjectId() + "_delevel\">Delevel</a></center>");
    sb.append("<br><br><br><br>");
    sb.append("</body>");
    sb.append("</html>");
    html.setHtml(sb.toString());
    player.sendPacket(html);
    html = null;
    sb = null;
    }
View Full Code Here

    sb = null;
    }
 
  private void lowlevel(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>Your level is too low!</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 aio(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>Aio buffers are not allowed to 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

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.