Package com.l2jfrozen.gameserver.network.serverpackets

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


    htmlContent.append("</body></html>");

    currPetition = null;
    dateFormat = null;

    NpcHtmlMessage htmlMsg = new NpcHtmlMessage(0);
    htmlMsg.setHtml(htmlContent.toString());
    activeChar.sendPacket(htmlMsg);

    htmlMsg = null;
    htmlContent = null;
  }
View Full Code Here


      {
        showHtmlFile(player, res);
      }
      else if(res.startsWith("<html>"))
      {
        NpcHtmlMessage npcReply = new NpcHtmlMessage(5);
        npcReply.setHtml(res);
        npcReply.replace("%playername%", player.getName());
        player.sendPacket(npcReply);
        npcReply = null;
      }
      else
      {
View Full Code Here

      }
     
      //Send message to client if message not empty
      if(content != null)
      {
        NpcHtmlMessage npcReply = new NpcHtmlMessage(5);
        npcReply.setHtml(content);
        npcReply.replace("%playername%", player.getName());
        player.sendPacket(npcReply);
      }
    }
    return content;
  }
View Full Code Here

            player.sendMessage("Congratulations! You are now level "+lvl+".");
            player.broadcastStatusUpdate();
            player.broadcastUserInfo();
            player.sendPacket(new UserInfo(player));
            player.sendSkillList();
            NpcHtmlMessage html = new NpcHtmlMessage(1);
              html.setFile(PARENT_DIR+"delevel.htm");
              sendHtmlMessage(player, html);
              levels = k - lvl;
              player.destroyItemByItemId("delevel", ItemConsumeId, ItemConsumeNumEveryLevel*levels, player, true);
          }
          else
View Full Code Here

        // Notify the L2PcInstance AI with AI_INTENTION_INTERACT
        player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
      }
      else
      {
        NpcHtmlMessage html = new NpcHtmlMessage(1);
          html.setFile(PARENT_DIR+"delevel.htm");
          sendHtmlMessage(player, html);
      }
    }
    // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
    player.sendPacket(ActionFailed.STATIC_PACKET);
View Full Code Here

    player.sendPacket(ActionFailed.STATIC_PACKET);
  }

  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

    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

    }
 
  @SuppressWarnings("unused")
  private void showhtml(L2PcInstance player)
  {
    NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
    TextBuilder sb = new TextBuilder();
    sb.append("<html>");
    sb.append("<title>%player%</title>");
    sb.append("<body><center>");
    sb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center><br>");
    sb.append("Hello there, if you want to low your current level, you came to the right place!<br>");
    sb.append("You have just to choose the <font color=FF0000>number</font> of level you would like to be.<br>");
    sb.append("In exchange, i am going to take you <font color=LEVEL>1000 Adena</font> for <font color=LEVEL>each level");
    sb.append("</font> you decrease.<br>");
    sb.append("Remember: You can't choose a number higher than your current level.<br>");

    sb.append("<table width=270><tr>");
    sb.append("<td><edit var=\"lv\" width=50></td>");
    sb.append("<td><button value=\"Change my level to: \" action=\"bypass -h npc_" + getObjectId() + "_delevel $lv\" width=180 height=21 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    sb.append("</tr></table>");


    sb.append("<br><br><br><br>");
    sb.append("<center>");
    sb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center>");
    sb.append("</body></html>");
    html.setHtml(sb.toString());
    player.sendPacket(html);
    html = null;
    sb = null;
  }
View Full Code Here

   */
  public static void showEventHtml(L2PcInstance eventPlayer, String objectId)
  {
    try
    {
      NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

      TextBuilder replyMSG = new TextBuilder("<html><title>"+_eventName+"</title><body>");
      replyMSG.append("<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center><br1>");
      replyMSG.append("<center><font color=\"3366CC\">Current event:</font></center><br1>");
      replyMSG.append("<center>Name:&nbsp;<font color=\"00FF00\">" + _eventName + "</font></center><br1>");
      replyMSG.append("<center>Description:&nbsp;<font color=\"00FF00\">" + _eventDesc + "</font></center><br><br>");

      if(!_started && !_joining)
        replyMSG.append("<center>Wait till the admin/gm start the participation.</center>");
      else if(Config.CTF_EVEN_TEAMS.equals("SHUFFLE") && !checkMaxPlayers(_playersShuffle.size()))
      {
        if(!_started)
        {
          replyMSG.append("Currently participated: <font color=\"00FF00\">" + _playersShuffle.size() + ".</font><br>");
          replyMSG.append("Max players: <font color=\"00FF00\">" + _maxPlayers + "</font><br><br>");
          replyMSG.append("<font color=\"FFFF00\">You can't participate to this event.</font><br>");
        }
      }
      else if(eventPlayer.isCursedWeaponEquiped() && !Config.CTF_JOIN_CURSED)
      {
        replyMSG.append("<font color=\"FFFF00\">You can't participate to this event with a cursed Weapon.</font><br>");
      }
      else if(!_started && _joining && eventPlayer.getLevel()>=_minlvl && eventPlayer.getLevel()<=_maxlvl)
      {
        synchronized(_players){
          if(_players.contains(eventPlayer) || _playersShuffle.contains(eventPlayer) || checkShufflePlayers(eventPlayer))
          {
            if(Config.CTF_EVEN_TEAMS.equals("NO") || Config.CTF_EVEN_TEAMS.equals("BALANCE"))
              replyMSG.append("You participated already in team <font color=\"LEVEL\">" + eventPlayer._teamNameCTF + "</font><br><br>");
            else if(Config.CTF_EVEN_TEAMS.equals("SHUFFLE"))
              replyMSG.append("<center><font color=\"3366CC\">You participated already!</font></center><br><br>");
             
            replyMSG.append("<center>Joined Players: <font color=\"00FF00\">" + _playersShuffle.size() + "</font></center><br>");

            replyMSG.append("<center><font color=\"3366CC\">Wait till event start or remove your participation!</font><center>");
            replyMSG.append("<center><button value=\"Remove\" action=\"bypass -h npc_" + objectId+ "_ctf_player_leave\" width=85 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center>");
          }
          else
          {
            replyMSG.append("<center><font color=\"3366CC\">You want to participate in the event?</font></center><br>");
            replyMSG.append("<center><td width=\"200\">Min lvl: <font color=\"00FF00\">" + _minlvl + "</font></center></td><br>");
            replyMSG.append("<center><td width=\"200\">Max lvl: <font color=\"00FF00\">" + _maxlvl + "</font></center></td><br><br>");
            replyMSG.append("<center><font color=\"3366CC\">Teams:</font></center><br>");

            if(Config.CTF_EVEN_TEAMS.equals("NO") || Config.CTF_EVEN_TEAMS.equals("BALANCE"))
            {
              replyMSG.append("<center><table border=\"0\">");

              for(String team : _teams)
              {
                replyMSG.append("<tr><td width=\"100\"><font color=\"LEVEL\">" + team + "</font>&nbsp;(" + teamPlayersCount(team) + " joined)</td>");
                replyMSG.append("<center><td width=\"60\"><button value=\"Join\" action=\"bypass -h npc_" + objectId + "_ctf_player_join " + team
                    + "\" width=85 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center></td></tr>");
              }
              replyMSG.append("</table></center>");
            }
            else if(Config.CTF_EVEN_TEAMS.equals("SHUFFLE"))
            {
              replyMSG.append("<center>");

              for(String team : _teams)
                replyMSG.append("<tr><td width=\"100\"><font color=\"LEVEL\">" + team + "</font> &nbsp;</td>");

              replyMSG.append("</center><br>");

              replyMSG.append("<center><button value=\"Join Event\" action=\"bypass -h npc_" + objectId + "_ctf_player_join eventShuffle\" width=85 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center>");
              replyMSG.append("<center><font color=\"3366CC\">Teams will be reandomly generated!</font></center><br>");
              replyMSG.append("<center>Joined Players:</font> <font color=\"LEVEL\">" + _playersShuffle.size() + "</center></font><br>");
              replyMSG.append("<center>Reward: <font color=\"LEVEL\">" + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName()+ "</center></font>");
            }
          }
        }
       
      }
      else if(_started && !_joining)
        replyMSG.append("<center>"+_eventName+" match is in progress.</center>");
      else if(eventPlayer.getLevel() < _minlvl || eventPlayer.getLevel() > _maxlvl)
      {
        replyMSG.append("Your lvl: <font color=\"00FF00\">" + eventPlayer.getLevel() + "</font><br>");
        replyMSG.append("Min lvl: <font color=\"00FF00\">" + _minlvl + "</font><br>");
        replyMSG.append("Max lvl: <font color=\"00FF00\">" + _maxlvl + "</font><br><br>");
        replyMSG.append("<font color=\"FFFF00\">You can't participate to this event.</font><br>");
      }

      replyMSG.append("</body></html>");
      adminReply.setHtml(replyMSG.toString());
      eventPlayer.sendPacket(adminReply);

      // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
      eventPlayer.sendPacket( ActionFailed.STATIC_PACKET );
    }
View Full Code Here

        {
          if(teamName!=null && (player._teamNameCTF.equals(teamName)) ){
           
            player.addItem(_eventName+" Event: " + _eventName, _rewardId, _rewardAmount, player, true);

            NpcHtmlMessage nhm = new NpcHtmlMessage(5);
            TextBuilder replyMSG = new TextBuilder("");

            replyMSG.append("<html><body>");
            replyMSG.append("<font color=\"FFFF00\">Your team wins the event. Look in your inventory for the reward.</font>");
            replyMSG.append("</body></html>");

            nhm.setHtml(replyMSG.toString());
            player.sendPacket(nhm);

            // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
            player.sendPacket( ActionFailed.STATIC_PACKET );
           
          }else if(teamName==null ){ //TIE
           
            int minus_reward = 0;
            if(_topScore!=0)
              minus_reward = _rewardAmount/2;
            else //nobody took flags
              minus_reward = _rewardAmount/4;
           
            player.addItem(_eventName+" Event: " + _eventName, _rewardId, minus_reward, player, true);

            NpcHtmlMessage nhm = new NpcHtmlMessage(5);
            TextBuilder replyMSG = new TextBuilder("");

            replyMSG.append("<html><body>");
            replyMSG.append("<font color=\"FFFF00\">Your team had a tie in the event. Look in your inventory for the reward.</font>");
            replyMSG.append("</body></html>");

            nhm.setHtml(replyMSG.toString());
            player.sendPacket(nhm);

            // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
            player.sendPacket( ActionFailed.STATIC_PACKET );
           
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.