Examples of NpcHtmlMessage

  • l2p.gameserver.serverpackets.NpcHtmlMessage
  • lineage2.gameserver.network.serverpackets.NpcHtmlMessage
    the HTML parser in the client knowns these standard and non-standard tags and attributes VOLUMN UNKNOWN UL U TT TR TITLE TEXTCODE TEXTAREA TD TABLE SUP SUB STRIKE SPIN SELECT RIGHT PRE P OPTION OL MULTIEDIT LI LEFT INPUT IMG I HTML H7 H6 H5 H4 H3 H2 H1 FONT EXTEND EDIT COMMENT COMBOBOX CENTER BUTTON BR BODY BAR ADDRESS A SEL LIST VAR FORE READONL ROWS VALIGN FIXWIDTH BORDERCOLORLI BORDERCOLORDA BORDERCOLOR BORDER BGCOLOR BACKGROUND ALIGN VALU READONLY MULTIPLE SELECTED TYP TYPE MAXLENGTH CHECKED SRC Y X QUERYDELAY NOSCROLLBAR IMGSRC B FG SIZE FACE COLOR DEFFON DEFFIXEDFONT WIDTH VALUE TOOLTIP NAME MIN MAX HEIGHT DISABLED ALIGN MSG LINK HREF ACTION ClassId fstring
  • net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage
    the HTML parser in the client knowns these standard and non-standard tags and attributes VOLUMN UNKNOWN UL U TT TR TITLE TEXTCODE TEXTAREA TD TABLE SUP SUB STRIKE SPIN SELECT RIGHT PRE P OPTION OL MULTIEDIT LI LEFT INPUT IMG I HTML H7 H6 H5 H4 H3 H2 H1 FONT EXTEND EDIT COMMENT COMBOBOX CENTER BUTTON BR BODY BAR ADDRESS A SEL LIST VAR FORE READONL ROWS VALIGN FIXWIDTH BORDERCOLORLI BORDERCOLORDA BORDERCOLOR BORDER BGCOLOR BACKGROUND ALIGN VALU READONLY MULTIPLE SELECTED TYP TYPE MAXLENGTH CHECKED SRC Y X QUERYDELAY NOSCROLLBAR IMGSRC B FG SIZE FACE COLOR DEFFON DEFFIXEDFONT WIDTH VALUE TOOLTIP NAME MIN MAX HEIGHT DISABLED ALIGN MSG LINK HREF ACTION @version $Revision: 1.3.2.1.2.3 $ $Date: 2005/03/27 15:29:57 $

  • Examples of net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage

                  filename = "data/html/chamberlain/chamberlain-busy.htm";          // Busy because of siege
              else if (condition == COND_OWNER)                        // Clan owns castle
                  filename = "data/html/chamberlain/chamberlain.htm";              // Owner message window
        }

        NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
        html.setFile(filename);
        html.replace("%objectId%", String.valueOf(getObjectId()));
        html.replace("%npcId%", String.valueOf(getNpcId()));
        html.replace("%npcname%", getName());
        player.sendPacket(html);
      }
    View Full Code Here

    Examples of net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage

                            content = content.replaceAll("%stoneValue%", String.valueOf(stoneValue));
                            content = content.replaceAll("%stoneCount%", String.valueOf(stoneCount));
                            content = content.replaceAll("%stoneItemId%", String.valueOf(stoneId));
                            content = content.replaceAll("%objectId%", String.valueOf(getObjectId()));

                            NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
                            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));
                        int convertCount = 0;

                        try
                        {
                            convertCount = Integer.parseInt(command.substring(19).trim());
                        }
                        catch (Exception NumberFormatException)
                        {
                            player.sendMessage("You must enter an integer amount.");
                            break;
                        }

                        L2ItemInstance convertItem = player.getInventory().getItemByItemId(convertStoneId);

                        if (convertItem == null)
                        {
                            player.sendMessage("You do not have any seal stones of that type.");
                            break;
                        }

                        int totalCount = convertItem.getCount();
                        int 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;
                            }

                            if (player.destroyItemByItemId("SevenSigns", convertStoneId, convertCount, this,
                                                           true))
                            {
                                player.addAncientAdena("SevenSigns", ancientAdenaReward, this, true);

                                // Send inventory update packet
                                iu = new InventoryUpdate();
                                iu.addModifiedItem(player.getInventory().getAncientAdenaInstance());
                                iu.addModifiedItem(convertItem);
                                sendPacket(iu);

                                // Update current load as well
                                su = new StatusUpdate(player.getObjectId());
                                su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad());
                                sendPacket(su);
                            }
                        }
                        else
                        {
                            player.sendMessage("You do not have that many seal stones.");
                        }
                        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)
                        TextBuilder contentBuffer = new TextBuilder("<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 html = new NpcHtmlMessage(getObjectId());
                        html.setHtml(contentBuffer.toString());
                        player.sendPacket(html);
                        break;
                    default:
                        // 1 = Purchase Record Intro
                        // 5 = Contrib Seal Stones Intro
    View Full Code Here

    Examples of net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage

            int condition = validateCondition(player);
            if (condition == COND_BUSY_BECAUSE_OF_SIEGE) filename = "data/html/mercmanager/mercmanager-busy.htm"; // Busy because of siege
            else if (condition == COND_OWNER) // Clan owns castle
                filename = "data/html/mercmanager/mercmanager.htm"; // Owner message window

            NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
            html.setFile(filename);
            html.replace("%objectId%", String.valueOf(getObjectId()));
            html.replace("%npcId%", String.valueOf(getNpcId()));
            html.replace("%npcname%", getName());
            player.sendPacket(html);
        }
    View Full Code Here

    Examples of net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage

          StatusUpdate statusUpdate = new StatusUpdate(playerInstance.getObjectId());

          statusUpdate.addAttribute(StatusUpdate.CUR_LOAD, playerInstance.getCurrentLoad());
          playerInstance.sendPacket(statusUpdate);

          NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(0);

          npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>Your team won the event. Look in your inventory, there should be your reward.</body></html>");
          playerInstance.sendPacket(npcHtmlMessage);
        }

        return "TvT Event: Event finish. Team " + team.getName() + " won with " + team.getPoints() + " kills.";
      }
    View Full Code Here

    Examples of net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage

        if (playerInstance == null || !isParticipating())
          return;

        if (command.equals("tvt_event_participation"))
        {
          NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(0);
          int playerLevel = playerInstance.getLevel();

          if (playerInstance.isCursedWeaponEquiped())
            npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>Cursed weapon owners are not allowed to participate.</body></html>");
          else if (playerInstance.getKarma() > 0)
            npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>Chaotic players are not allowed to participate.</body></html>");
          else if (_teams[0].getParticipatedPlayerCount() >= Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS && _teams[1].getParticipatedPlayerCount() >= Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS)
            npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>Sorry the event is full!</body></html>");
          else if (playerLevel < Config.TVT_EVENT_MIN_LVL || playerLevel > Config.TVT_EVENT_MAX_LVL)
            npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>Only players from level " + Config.TVT_EVENT_MIN_LVL + " to level " + Config.TVT_EVENT_MAX_LVL + " are allowed tro participate.</body></html>");
          else if (_teams[0].getParticipatedPlayerCount() > 19 && _teams[1].getParticipatedPlayerCount() > 19)
            npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>The event is full! Maximum of " + Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS + "  player are allowed in one team.</body></html>");
          else if (addParticipant(playerInstance))
            npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>You are on the registration list now.</body></html>");
          else // addParticipant returned false cause playerInstance == null
            return;

          playerInstance.sendPacket(npcHtmlMessage);
        }
        else if (command.equals("tvt_event_remove_participation"))
        {
          removeParticipant(playerInstance.getName());

          NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(0);

          npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>You are not longer on the registration list.</body></html>");
          playerInstance.sendPacket(npcHtmlMessage);
        }
      }
    View Full Code Here

    Examples of net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage

          asl.addSkill(s.getId(), s.getLevel(), s.getLevel(), s.getSpCost(), 1);
        }

        if (counts == 0)
        {
            NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
            int minlevel = SkillTreeTable.getInstance().getMinLevelForNewSkill(player);

            if (minlevel > 0)
                {
                    // No more skills to learn, come back when you level.
                SystemMessage sm = new SystemMessage(SystemMessageId.DO_NOT_HAVE_FURTHER_SKILLS_TO_LEARN);
                sm.addNumber(minlevel);
                player.sendPacket(sm);
            }
                else
                {
                    TextBuilder sb = new TextBuilder();
                    sb.append("<html><head><body>");
                    sb.append("You've learned all skills.<br>");
                    sb.append("</body></html>");
                    html.setHtml(sb.toString());
                    player.sendPacket(html);
            }
        }
        else
        {
    View Full Code Here

    Examples of net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage

            }
             else if (command.startsWith("admin_event_see"))
            {
                String eventName = command.substring(16);
                try {
                    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);


                    DataInputStream in =
                        new DataInputStream(
                          new BufferedInputStream(
                            new FileInputStream ("data/events/" + eventName)));
                      BufferedReader inbr =
                        new BufferedReader(new InputStreamReader(in));


                    TextBuilder replyMSG = new TextBuilder("<html><body>");
                    replyMSG.append("<center><font color=\"LEVEL\">" + eventName + "</font><font color=\"FF0000\"> bY " + inbr.readLine() + "</font></center><br>");

                    replyMSG.append("<br>" + inbr.readLine());
                    replyMSG.append("</body></html>");
                    adminReply.setHtml(replyMSG.toString());
                    activeChar.sendPacket(adminReply);
                    }
                    catch (Exception e) {System.out.println(e);}

            }
            else if (command.startsWith("admin_event_del"))
            {
                String eventName = command.substring(16);
                File file = new File("data/events/" + eventName);
                file.delete();
                showMainPage(activeChar);

            }

            else if (command.startsWith("admin_event_name"))
            {
                tempName+=command.substring(17);
                showNewEventPage(activeChar);

            }

            else if (command.equalsIgnoreCase("admin_delete_buffer"))
            {
                try {tempBuffer+=tempBuffer.substring(0,tempBuffer.length()-10);
                showNewEventPage(activeChar); }
                catch (Exception e) {tempBuffer="";}
            }

            else if (command.startsWith("admin_event_store"))
            {

                try{
                    FileOutputStream file = new FileOutputStream("data/events/" + tempName);
                    PrintStream p = new PrintStream(file);
                    p.println(activeChar.getName());
                    p.println(tempBuffer);
                    file.close();
                }
                catch (Exception e) {System.out.println(e);}
                tempBuffer = "";
                tempName = "";
                showMainPage(activeChar);
            }
            else if (command.startsWith("admin_event_set"))
            {
                L2Event.eventName = command.substring(16);
                showEventParameters(activeChar, 2);

            }
            else if (command.startsWith("admin_event_change_teams_number"))
            {
                showEventParameters(activeChar, Integer.parseInt(command.substring(32)));
                    }
            else if (command.startsWith("admin_event_panel"))
            {
                 showEventControl(activeChar);
             }
            else if (command.startsWith("admin_event_control_begin"))
            {


                try {

                L2Event.active = true;
                L2Event.players.clear();
                L2Event.connectionLossData.clear();

                for(int j=0;j<L2Event.teamsNumber;j++){
                    LinkedList<String> link = new LinkedList<String>();
                    L2Event.players.put(j+1,link);

                }
                int i = 0;



                while(L2Event.participatingPlayers.size()>0){
                    String target = getMaxLeveledPlayer();

                    if(!target.equals("")) {

                        L2Event.players.get(i+1).add(target);
                        i=(i+1)%L2Event.teamsNumber;
                    }



                }

                destroyEventNpcs();
                npcsDeleted = true;

                } catch(Exception e) {System.out.println(e);}
                showEventControl(activeChar);
            }
            else if (command.startsWith("admin_event_control_teleport"))
            {
                StringTokenizer st = new StringTokenizer(command.substring(29),"-");

                while(st.hasMoreElements()){
                    teleportTeam(activeChar, Integer.parseInt(st.nextToken()));
                }
                showEventControl(activeChar);
            }


            else if (command.startsWith("admin_event_control_sit"))
            {
                StringTokenizer st = new StringTokenizer(command.substring(24),"-");

                while(st.hasMoreElements()){
                    sitTeam(Integer.parseInt(st.nextToken()));
                }
                showEventControl(activeChar);
            }
            else if (command.startsWith("admin_event_control_kill"))
            {
                StringTokenizer st = new StringTokenizer(command.substring(25),"-");

                while(st.hasMoreElements()){
                    killTeam(activeChar, Integer.parseInt(st.nextToken()));
                }
                showEventControl(activeChar);
            }
            else if (command.startsWith("admin_event_control_res"))
            {
                StringTokenizer st = new StringTokenizer(command.substring(24),"-");

                while(st.hasMoreElements()){
                    resTeam(Integer.parseInt(st.nextToken()));
                }
                showEventControl(activeChar);
            }
              else if (command.startsWith("admin_event_control_poly"))
            {
                StringTokenizer st0 = new StringTokenizer(command.substring(25));
                StringTokenizer st = new StringTokenizer(st0.nextToken(),"-");
                String id = st0.nextToken();
                while(st.hasMoreElements()){
                    polyTeam(Integer.parseInt(st.nextToken()), id);
                }
                showEventControl(activeChar);
            }
            else if (command.startsWith("admin_event_control_unpoly"))
            {
                StringTokenizer st = new StringTokenizer(command.substring(27),"-");

                while(st.hasMoreElements()){
                    unpolyTeam(Integer.parseInt(st.nextToken()));
                }
                showEventControl(activeChar);
            }
            else if (command.startsWith("admin_event_control_prize"))
            {
                StringTokenizer st0 = new StringTokenizer(command.substring(26));
                StringTokenizer st = new StringTokenizer(st0.nextToken(),"-");
                String n = st0.nextToken();
                StringTokenizer st1 = new StringTokenizer(n,"*");
                n = st1.nextToken();
                String type = "";
                if(st1.hasMoreElements()) type = st1.nextToken();

                String id = st0.nextToken();
                while(st.hasMoreElements()){
                    regardTeam(activeChar, Integer.parseInt(st.nextToken()),Integer.parseInt(n), Integer.parseInt(id), type);
                }
                showEventControl(activeChar);
            }
            else if (command.startsWith("admin_event_control_finish"))
            {
                for(int i = 0; i<L2Event.teamsNumber; i++){
                    telePlayersBack(i+1);
                }

                L2Event.eventName = "";
                L2Event.teamsNumber = 0;
                L2Event.names.clear();
                L2Event.participatingPlayers.clear();
                L2Event.players.clear();
                L2Event.id = 12760;
                L2Event.npcs.clear();
                L2Event.active = false;
                npcsDeleted = false;


            }


            else if (command.startsWith("admin_event_announce"))
            {
                StringTokenizer st = new StringTokenizer(command.substring(21));
                L2Event.id = Integer.parseInt(st.nextToken());
                L2Event.teamsNumber = Integer.parseInt(st.nextToken());
                String temp = " ";
                String temp2 = "";
                while(st.hasMoreElements()){
                    temp+=st.nextToken() + " ";
                }

                st = new StringTokenizer(temp,"-");

                Integer i = 1;

                while(st.hasMoreElements()){
                    temp2 = st.nextToken();
                    if(!temp2.equals(" ")){
                     L2Event.names.put (i, temp2.substring(1,temp2.length()-1));
                     i++;}
                }


                L2Event.participatingPlayers.clear();

                muestraNpcConInfoAPlayers(activeChar, L2Event.id);

                PlaySound _snd = new PlaySound(1,"B03_F",0,0,0,0,0);
                activeChar.sendPacket(_snd);
                activeChar.broadcastPacket(_snd);

                NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

                TextBuilder replyMSG = new TextBuilder("<html><body>");

                replyMSG.append("<center><font color=\"LEVEL\">[ L2J EVENT ENGINE</font></center><br>");
                replyMSG.append("<center>The event <font color=\"LEVEL\">"+ L2Event.eventName + "</font> has been announced, now you can type //event_panel to see the event panel control</center><br>");
                replyMSG.append("</body></html>");
                adminReply.setHtml(replyMSG.toString());
                activeChar.sendPacket(adminReply);
          }


        return true;
    View Full Code Here

    Examples of net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage

       }


        public void showMainPage(L2PcInstance activeChar)
      {
        NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

        TextBuilder replyMSG = new TextBuilder("<html><body>");

        replyMSG.append("<center><font color=\"LEVEL\">[ L2J EVENT ENGINE ]</font></center><br>");
        replyMSG.append("<br><center><button value=\"Create NEW event \" action=\"bypass -h admin_event_new\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
        replyMSG.append("<center><br>Stored Events<br></center>");
        replyMSG.append(showStoredEvents());
            replyMSG.append("</body></html>");

            adminReply.setHtml(replyMSG.toString());
            activeChar.sendPacket(adminReply);
      }
    View Full Code Here

    Examples of net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage

            adminReply.setHtml(replyMSG.toString());
            activeChar.sendPacket(adminReply);
      }
        public void showNewEventPage(L2PcInstance activeChar)
        {
            NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

            TextBuilder replyMSG = new TextBuilder("<html><body>");

            replyMSG.append("<center><font color=\"LEVEL\">[ L2J EVENT ENGINE ]</font></center><br>");
            replyMSG.append("<br><center>Event's Title <br><font color=\"LEVEL\">");
            if(tempName.equals(""))
                replyMSG.append("Use //event_name text to insert a new title");
            else replyMSG.append(tempName);
            replyMSG.append("</font></center><br><br>Event's description<br>");
           if(tempBuffer.equals(""))
                replyMSG.append("Use //add text o //delete_buffer to modify this text field");
            else replyMSG.append(tempBuffer);

           if(!(tempName.equals("")&&tempBuffer.equals(""))) replyMSG.append("<br><button value=\"Crear\" action=\"bypass -h admin_event_store\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");


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

            adminReply.setHtml(replyMSG.toString());
            activeChar.sendPacket(adminReply);
        }
    View Full Code Here

    Examples of net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage

            adminReply.setHtml(replyMSG.toString());
            activeChar.sendPacket(adminReply);
        }
        public void showEventParameters(L2PcInstance activeChar, int teamnumbers)
        {
            NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

            TextBuilder replyMSG = new TextBuilder("<html><body>");

            replyMSG.append("<center><font color=\"LEVEL\">[ L2J EVENT ENGINE ]</font></center><br>");
            replyMSG.append("<center><font color=\"LEVEL\">" + L2Event.eventName + "</font></center><br>");
            replyMSG.append("<br><center><button value=\"Change number of teams to\" action=\"bypass -h admin_event_change_teams_number $event_teams_number\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"> <edit var=\"event_teams_number\" width=100 height=20><br><br>");
            replyMSG.append("<font color=\"LEVEL\">Team's Names</font><br>");
            for (int i = 0; i<teamnumbers; i++){
                replyMSG.append((i+1) + ".- <edit var=\"event_teams_name" + (i+1) + "\" width=100 height=20><br>");
            }
            replyMSG.append("<br><br>Announcer NPC id<edit var=\"event_npcid\" width=100 height=20><br><br><button value=\"Announce Event!!\" action=\"bypass -h admin_event_announce $event_npcid " + teamnumbers + " ");
            for (int i = 0; i<teamnumbers; i++){
                replyMSG.append("$event_teams_name" + (i+1) + " - ");
            }
            replyMSG.append("\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
            replyMSG.append("</body></html>");

            adminReply.setHtml(replyMSG.toString());
            activeChar.sendPacket(adminReply);
        }
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. 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.