Examples of TextBuilder


Examples of javolution.text.TextBuilder

      throw  new IllegalArgumentException("Malformed IPv4 number");
    Collection<L2PcInstance> allPlayers = L2World.getInstance().getAllPlayers();
    L2PcInstance[] players = allPlayers.toArray(new L2PcInstance[allPlayers.size()]);
    int CharactersFound = 0;
    String name,ip="0.0.0.0";
    TextBuilder replyMSG = new TextBuilder();
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    adminReply.setFile("data/html/admin/ipfind.htm");
    for (int i = 0; i < players.length; i++)
    {
      ip=players[i].getClient().getConnection().getInetAddress().getHostAddress();
      if (ip.equals(IpAdress))
      {
        name = players[i].getName();
        CharactersFound = CharactersFound+1;
        replyMSG.append("<tr><td width=80><a action=\"bypass -h admin_character_list "+name+"\">"+name+"</a></td><td width=110>" + players[i].getTemplate().className + "</td><td width=40>"+players[i].getLevel()+"</td></tr>");
      }
      if (CharactersFound > 20)
        break;
    }
    adminReply.replace("%results%", replyMSG.toString());
    replyMSG.clear();
    if (CharactersFound==0)
      replyMSG.append("s. Maybe they got d/c? :)");
    else if (CharactersFound > 20)
    {
      adminReply.replace("%number%", " more than "+String.valueOf(CharactersFound));
      replyMSG.append("s.<br>In order to avoid you a client crash I won't <br1>display results beyond the 20th character.");
    }
    else if (CharactersFound==1)
      replyMSG.append(".");
    else
      replyMSG.append("s.");
    adminReply.replace("%ip%", ip);
    adminReply.replace("%number%", String.valueOf(CharactersFound));
    adminReply.replace("%end%", replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

Examples of javolution.text.TextBuilder

      L2PcInstance player = L2World.getInstance().getPlayer(characterName);
      if (player == null)
        throw new IllegalArgumentException("Player doesn't exist");
      chars=player.getAccountChars();
      account = player.getAccountName();
      TextBuilder replyMSG = new TextBuilder();
      NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
      adminReply.setFile("data/html/admin/accountinfo.htm");
      for (String charname : chars.values())
        replyMSG.append(charname+"<br1>");
      adminReply.replace("%characters%", replyMSG.toString());
      adminReply.replace("%account%", account);
      adminReply.replace("%player%", characterName);
      activeChar.sendPacket(adminReply);
    }
    else
View Full Code Here

Examples of javolution.text.TextBuilder

    int npcId = getTemplate().npcId;

    if (_classesToTeach == null)
    {
      NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
      TextBuilder sb = new TextBuilder();
      sb.append("<html><body>");
      sb.append("I cannot teach you. My class list is empty.<br> Ask admin to fix it. Need add my npcid and classes to skill_learn.sql.<br>NpcId:"+npcId+", Your classId:"+player.getClassId().getId()+"<br>");
      sb.append("</body></html>");
      html.setHtml(sb.toString());
      player.sendPacket(html);

      return;
    }

    if (!getTemplate().canTeach(classId))
        {
      NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
            TextBuilder sb = new TextBuilder();
      sb.append("<html><body>");
      sb.append("I cannot teach you any skills.<br> You must find your current class teachers.");
      sb.append("</body></html>");
      html.setHtml(sb.toString());
      player.sendPacket(html);

      return;
    }
View Full Code Here

Examples of javolution.text.TextBuilder

        int npcId = getTemplate().npcId;

        if (_classesToTeach == null)
        {
            NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
            TextBuilder sb = new TextBuilder();
            sb.append("<html><body>");
            sb.append("I cannot teach you. My class list is empty.<br> Ask admin to fix it. Need add my npcid and classes to skill_learn.sql.<br>NpcId:"+npcId+", Your classId:"+player.getClassId().getId()+"<br>");
            sb.append("</body></html>");
            html.setHtml(sb.toString());
            player.sendPacket(html);

            return;
        }

        if (!getTemplate().canTeach(classId))
        {
            NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
            TextBuilder sb = new TextBuilder();
            sb.append("<html><body>");
            sb.append("I cannot teach you any skills.<br> You must find your current class teachers.");
            sb.append("</body></html>");
            html.setHtml(sb.toString());
            player.sendPacket(html);

            return;
        }
        if(player.getClassId().getId() < 88)
        {
          NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
            TextBuilder sb = new TextBuilder();
            sb.append("<html><body>");
            sb.append("You must have 3rd class change quest completed.");
            sb.append("</body></html>");
            html.setHtml(sb.toString());
            player.sendPacket(html);

            return;
        }

        L2EnchantSkillLearn[] skills = SkillTreeTable.getInstance().getAvailableEnchantSkills(player);
        ExEnchantSkillList esl = new ExEnchantSkillList();
        int counts = 0;

        for (L2EnchantSkillLearn s: skills)
        {
            L2Skill sk = SkillTable.getInstance().getInfo(s.getId(), s.getLevel());
            if (sk == null) continue;
            counts++;
            esl.addSkill(s.getId(), s.getLevel(), s.getSpCost(), s.getExp());
        }
        if (counts == 0)
        {
            player.sendPacket(new SystemMessage(SystemMessageId.THERE_IS_NO_SKILL_THAT_ENABLES_ENCHANT));
            NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
            int level = player.getLevel();

            if (level < 74)
            {
                SystemMessage sm = new SystemMessage(SystemMessageId.DO_NOT_HAVE_FURTHER_SKILLS_TO_LEARN);
                sm.addNumber(level);
                player.sendPacket(sm);
            }
            else
            {
                TextBuilder sb = new TextBuilder();
                sb.append("<html><body>");
                sb.append("You've learned all skills for your class.<br>");
                sb.append("</body></html>");
                html.setHtml(sb.toString());
                player.sendPacket(html);
            }
        }
        else
        {
View Full Code Here

Examples of javolution.text.TextBuilder

  private void showPage2(L2PcInstance activeChar,String format)
  {
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    adminReply.setFile("data/html/admin/pforge2.htm");
    adminReply.replace("%format%", format);
    TextBuilder replyMSG = new TextBuilder();
    for(int i = 0; i < format.length();i++)
      replyMSG.append(format.charAt(i)+" : <edit var=\"v"+i+"\" width=100><br1>");
    adminReply.replace("%valueditors%", replyMSG.toString());
    replyMSG.clear();
    for(int i = 0; i < format.length();i++)
      replyMSG.append(" \\$v"+i);
    adminReply.replace("%send%", replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

Examples of javolution.text.TextBuilder

      npc2 = NpcTable.getInstance().getTemplate(mid2);


    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    TextBuilder replyMSG = new TextBuilder();
    if (npc1 != null && npc2 != null)
    {
      replyMSG.append("<html><title>Selected mobs to fight</title>");
      replyMSG.append("<body>");
      replyMSG.append("<table>");
      replyMSG.append("<tr><td>First</td><td>Second</td></tr>");
      replyMSG.append("<tr><td>level "+lvl1+"</td><td>level "+lvl2+"</td></tr>");
      replyMSG.append("<tr><td>id "+npc1.npcId+"</td><td>id "+npc2.npcId+"</td></tr>");
      replyMSG.append("<tr><td>"+npc1.name+"</td><td>"+npc2.name+"</td></tr>");
          replyMSG.append("</table>");
          replyMSG.append("<center><br><br><br>");
          replyMSG.append("<button value=\"OK\" action=\"bypass -h admin_fight_calculator_show "+npc1.npcId+" "+npc2.npcId+"\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
          replyMSG.append("</center>");
          replyMSG.append("</body></html>");
    }
    else if (lvl1 != 0 && npc1 == null)
    {
      replyMSG.append("<html><title>Select first mob to fight</title>");
      replyMSG.append("<body><table>");
      L2NpcTemplate[] npcs = NpcTable.getInstance().getAllOfLevel(lvl1);
      for (L2NpcTemplate n : npcs) {
        replyMSG.append("<tr><td><a action=\"bypass -h admin_fight_calculator lvl1 "+lvl1+" lvl2 "+lvl2+" mid1 "+n.npcId+" mid2 "+mid2+"\">"+n.name+"</a></td></tr>");
      }
          replyMSG.append("</table></body></html>");
    }
    else if (lvl2 != 0 && npc2 == null)
    {
      replyMSG.append("<html><title>Select second mob to fight</title>");
      replyMSG.append("<body><table>");
      L2NpcTemplate[] npcs = NpcTable.getInstance().getAllOfLevel(lvl2);
      for (L2NpcTemplate n : npcs) {
        replyMSG.append("<tr><td><a action=\"bypass -h admin_fight_calculator lvl1 "+lvl1+" lvl2 "+lvl2+" mid1 "+mid1+" mid2 "+n.npcId+"\">"+n.name+"</a></td></tr>");
      }
          replyMSG.append("</table></body></html>");
    }
    else {
      replyMSG.append("<html><title>Select mobs to fight</title>");
      replyMSG.append("<body>");
      replyMSG.append("<table>");
      replyMSG.append("<tr><td>First</td><td>Second</td></tr>");
      replyMSG.append("<tr><td><edit var=\"lvl1\" width=80></td><td><edit var=\"lvl2\" width=80></td></tr>");
          replyMSG.append("</table>");
          replyMSG.append("<center><br><br><br>");
          replyMSG.append("<button value=\"OK\" action=\"bypass -h admin_fight_calculator lvl1 $lvl1 lvl2 $lvl2\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
          replyMSG.append("</center>");
          replyMSG.append("</body></html>");
    }

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

Examples of javolution.text.TextBuilder

    double maxHp2 = npc2.getMaxHp();
    int hp2 = (int)(f.calcHpRegen(npc2) * 100000 / f.getRegeneratePeriod(npc2));

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    TextBuilder replyMSG = new TextBuilder();
    replyMSG.append("<html><title>Selected mobs to fight</title>");
    replyMSG.append("<body>");
    replyMSG.append("<table>");
    if (params.length() == 0) {
      replyMSG.append("<tr><td width=140>Parameter</td><td width=70>me</td><td width=70>target</td></tr>");
    } else {
      replyMSG.append("<tr><td width=140>Parameter</td><td width=70>"+((L2NpcTemplate)npc1.getTemplate()).name+
          "</td><td width=70>"+((L2NpcTemplate)npc2.getTemplate()).name+"</td></tr>");
    }
    replyMSG.append("<tr><td>miss</td><td>"+miss1+"%</td><td>"+miss2+"%</td></tr>");
    replyMSG.append("<tr><td>shld</td><td>"+shld2+"%</td><td>"+shld1+"%</td></tr>");
    replyMSG.append("<tr><td>crit</td><td>"+crit1+"%</td><td>"+crit2+"%</td></tr>");
    replyMSG.append("<tr><td>pAtk / pDef</td><td>"+((int)patk1)+" / "+((int)pdef1)+"</td><td>"+((int)patk2)+" / "+((int)pdef2)+"</td></tr>");
    replyMSG.append("<tr><td>made hits</td><td>"+sAtk1+"</td><td>"+sAtk2+"</td></tr>");
    replyMSG.append("<tr><td>dmg per hit</td><td>"+((int)dmg1)+"</td><td>"+((int)dmg2)+"</td></tr>");
    replyMSG.append("<tr><td>got dmg</td><td>"+tdmg2+"</td><td>"+tdmg1+"</td></tr>");
    replyMSG.append("<tr><td>got regen</td><td>"+hp1+"</td><td>"+hp2+"</td></tr>");
    replyMSG.append("<tr><td>had HP</td><td>"+(int)maxHp1+"</td><td>"+(int)maxHp2+"</td></tr>");
    replyMSG.append("<tr><td>die</td>");
    if (tdmg2 - hp1 > 1)
      replyMSG.append("<td>"+(int)(100*maxHp1/(tdmg2 - hp1))+" sec</td>");
    else
      replyMSG.append("<td>never</td>");
    if (tdmg1 - hp2 > 1)
      replyMSG.append("<td>"+(int)(100*maxHp2/(tdmg1 - hp2))+" sec</td>");
    else
      replyMSG.append("<td>never</td>");
    replyMSG.append("</tr>");
        replyMSG.append("</table>");
        replyMSG.append("<center><br>");
    if (params.length() == 0) {
      replyMSG.append("<button value=\"Retry\" action=\"bypass -h admin_fight_calculator_show\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    } else {
      replyMSG.append("<button value=\"Retry\" action=\"bypass -h admin_fight_calculator_show "+((L2NpcTemplate)npc1.getTemplate()).npcId+" "+((L2NpcTemplate)npc2.getTemplate()).npcId+"\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    }
        replyMSG.append("</center>");
        replyMSG.append("</body></html>");
    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);

    if (params.length() != 0)
    {
      ((L2MonsterInstance)npc1).deleteMe();
View Full Code Here

Examples of javolution.text.TextBuilder

        statement2.close();

        reLoadNpcDropList(npcId);

        NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
        TextBuilder replyMSG = new TextBuilder("<html><title>Delete drop data(" + npcId+", "+ itemId+", "+ category + ")complete</title>");
        replyMSG.append("<body>");
        replyMSG.append("<center><button value=\"DropList\" action=\"bypass -h admin_show_droplist "+ npcId + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></center>");
        replyMSG.append("</body></html>");

        adminReply.setHtml(replyMSG.toString());
        activeChar.sendPacket(adminReply);

      }
    }
    catch(Exception e){}
View Full Code Here

Examples of javolution.text.TextBuilder

      return;
    }

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    TextBuilder replyMSG = new TextBuilder();
    replyMSG.append("<html><title>Merchant Shop Item Edit</title>");
    replyMSG.append("<body>");
    replyMSG.append("<br>Edit an entry in merchantList.");
    replyMSG.append("<br>Editing Item: "+item.getName());
    replyMSG.append("<table>");
    replyMSG.append("<tr><td width=100>Property</td><td width=100>Edit Field</td><td width=100>Old Value</td></tr>");
    replyMSG.append("<tr><td><br></td><td></td></tr>");
    replyMSG.append("<tr><td>Price</td><td><edit var=\"price\" width=80></td><td>"+tradeList.getPriceForItemId(itemID)+"</td></tr>");
    replyMSG.append("</table>");
    replyMSG.append("<center><br><br><br>");
    replyMSG.append("<button value=\"Save\" action=\"bypass -h admin_editShopItem " + tradeListID + " " + itemID + " $price\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("<br><button value=\"Back\" action=\"bypass -h admin_showShopList " + tradeListID +" 1\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("</center>");
    replyMSG.append("</body></html>");

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

Examples of javolution.text.TextBuilder

    return false;
  }

  public void sendPendingPetitionList(L2PcInstance activeChar)
  {
        TextBuilder htmlContent = new TextBuilder("<html><body>" +
    "<center><font color=\"LEVEL\">Current Petitions</font><br><table width=\"300\">");
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM HH:mm z");

    if (getPendingPetitionCount() == 0)
      htmlContent.append("<tr><td colspan=\"4\">There are no currently pending petitions.</td></tr>");
    else
      htmlContent.append("<tr><td></td><td><font color=\"999999\">Petitioner</font></td>" +
      "<td><font color=\"999999\">Petition Type</font></td><td><font color=\"999999\">Submitted</font></td></tr>");

    for (Petition currPetition : getPendingPetitions().values())
    {
            if (currPetition == null)
                continue;

      htmlContent.append("<tr><td>");

      if (currPetition.getState() != PetitionState.In_Process)
        htmlContent.append("<button value=\"View\" action=\"bypass -h admin_view_petition " + currPetition.getId() + "\" " +
    "width=\"40\" height=\"15\" back=\"sek.cbui94\" fore=\"sek.cbui92\">");
      else
        htmlContent.append("<font color=\"999999\">In Process</font>");

      htmlContent.append("</td><td>" + currPetition.getPetitioner().getName() +
                         "</td><td>" + currPetition.getTypeAsString() + "</td><td>" +
                         dateFormat.format(new Date(currPetition.getSubmitTime())) + "</td></tr>");
    }

    htmlContent.append("</table><br><button value=\"Refresh\" action=\"bypass -h admin_view_petitions\" width=\"50\" " +
                       "height=\"15\" back=\"sek.cbui94\" fore=\"sek.cbui92\"><br><button value=\"Back\" action=\"bypass -h admin_admin\" " +
    "width=\"40\" height=\"15\" back=\"sek.cbui94\" fore=\"sek.cbui92\"></center></body></html>");

    NpcHtmlMessage htmlMsg = new NpcHtmlMessage(0);
    htmlMsg.setHtml(htmlContent.toString());
    activeChar.sendPacket(htmlMsg);
  }
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.