Package net.sf.l2j.gameserver.serverpackets

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


      activeChar.sendMessage("Added "+newItem.getItem().getName()+" to Trade List "+tradeList.getListId());
      showShopList(activeChar, tradeListID, 1);
      return;
    }

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    TextBuilder replyMSG = new TextBuilder();
    replyMSG.append("<html><title>Merchant Shop Item Add</title>");
    replyMSG.append("<body>");
    replyMSG.append("<br>Add a new entry in merchantList.");
    replyMSG.append("<table>");
    replyMSG.append("<tr><td width=100>Property</td><td>Edit Field</td></tr>");
    replyMSG.append("<tr><td><br></td><td></td></tr>");
    replyMSG.append("<tr><td>ItemID</td><td><edit var=\"itemID\" width=80></td></tr>");
    replyMSG.append("<tr><td>Price</td><td><edit var=\"price\" width=80></td></tr>");
    replyMSG.append("</table>");
    replyMSG.append("<center><br><br><br>");
    replyMSG.append("<button value=\"Save\" action=\"bypass -h admin_addShopItem " + 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


  {
    L2TradeList tradeList = TradeController.getInstance().getBuyList(tradeListID);
    if (page > tradeList.getItems().size() / PAGE_LIMIT + 1 || page < 1)
      return;

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    TextBuilder html = itemListHtml(tradeList, page);

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

  }
View Full Code Here

    {
      activeChar.sendMessage("Unknown npc template ID" + merchantID);
      return ;
    }

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    TextBuilder replyMSG = new TextBuilder("<html><title>Merchant Shop Lists</title>");
    replyMSG.append("<body>");
    replyMSG.append("<br>Select a list to view");
    replyMSG.append("<table>");
    replyMSG.append("<tr><td>Mecrchant List ID</td></tr>");

    for (L2TradeList tradeList : tradeLists)
    {
      if (tradeList != null)
        replyMSG.append("<tr><td><a action=\"bypass -h admin_showShopList "+tradeList.getListId()+" 1\">Trade List "+tradeList.getListId()+"</a></td></tr>");
    }

    replyMSG.append("</table>");
    replyMSG.append("<center>");
    replyMSG.append("<button value=\"Close\" action=\"bypass -h admin_close_window\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("</center></body></html>");

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

    return ADMIN_COMMANDS;
  }

  private void Show_Npc_Property(L2PcInstance activeChar, L2NpcTemplate npc)
  {
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    String content = HtmCache.getInstance().getHtm("data/html/admin/editnpc.htm");

    if (content != null)
    {
      adminReply.setHtml(content);
      adminReply.replace("%npcId%", String.valueOf(npc.npcId));
      adminReply.replace("%templateId%", String.valueOf(npc.idTemplate));
      adminReply.replace("%name%", npc.name);
      adminReply.replace("%serverSideName%", npc.serverSideName == true ? "1" : "0");
      adminReply.replace("%title%", npc.title);
      adminReply.replace("%serverSideTitle%", npc.serverSideTitle == true ? "1" : "0");
      adminReply.replace("%collisionRadius%", String.valueOf(npc.collisionRadius));
      adminReply.replace("%collisionHeight%", String.valueOf(npc.collisionHeight));
      adminReply.replace("%level%", String.valueOf(npc.level));
      adminReply.replace("%sex%", String.valueOf(npc.sex));
      adminReply.replace("%type%", String.valueOf(npc.type));
      adminReply.replace("%attackRange%", String.valueOf(npc.baseAtkRange));
      adminReply.replace("%hp%", String.valueOf(npc.baseHpMax));
      adminReply.replace("%mp%", String.valueOf(npc.baseMpMax));
      adminReply.replace("%hpRegen%", String.valueOf(npc.baseHpReg));
      adminReply.replace("%mpRegen%", String.valueOf(npc.baseMpReg));
      adminReply.replace("%str%", String.valueOf(npc.baseSTR));
      adminReply.replace("%con%", String.valueOf(npc.baseCON));
      adminReply.replace("%dex%", String.valueOf(npc.baseDEX));
      adminReply.replace("%int%", String.valueOf(npc.baseINT));
      adminReply.replace("%wit%", String.valueOf(npc.baseWIT));
      adminReply.replace("%men%", String.valueOf(npc.baseMEN));
      adminReply.replace("%exp%", String.valueOf(npc.rewardExp));
      adminReply.replace("%sp%", String.valueOf(npc.rewardSp));
      adminReply.replace("%pAtk%", String.valueOf(npc.basePAtk));
      adminReply.replace("%pDef%", String.valueOf(npc.basePDef));
      adminReply.replace("%mAtk%", String.valueOf(npc.baseMAtk));
      adminReply.replace("%mDef%", String.valueOf(npc.baseMDef));
      adminReply.replace("%pAtkSpd%", String.valueOf(npc.basePAtkSpd));
      adminReply.replace("%aggro%", String.valueOf(npc.aggroRange));
      adminReply.replace("%mAtkSpd%", String.valueOf(npc.baseMAtkSpd));
      adminReply.replace("%rHand%", String.valueOf(npc.rhand));
      adminReply.replace("%lHand%", String.valueOf(npc.lhand));
      adminReply.replace("%armor%", String.valueOf(npc.armor));
      adminReply.replace("%walkSpd%", String.valueOf(npc.baseWalkSpd));
      adminReply.replace("%runSpd%", String.valueOf(npc.baseRunSpd));
      adminReply.replace("%factionId%", npc.factionId == null ? "" : npc.factionId);
      adminReply.replace("%factionRange%", String.valueOf(npc.factionRange));
      adminReply.replace("%isUndead%", npc.isUndead ? "1" : "0");
      adminReply.replace("%absorbLevel%", String.valueOf(npc.absorbLevel));
    }
    else
      adminReply.setHtml("<html><head><body>File not found: data/html/admin/editnpc.htm</body></html>");
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

    {
      activeChar.sendMessage("unknown npc template id" + npcId);
      return ;
    }

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    TextBuilder replyMSG = new TextBuilder("<html><title>NPC: "+ npcData.name + "("+npcData.npcId+") 's drop manage</title>");
    replyMSG.append("<body>");
    replyMSG.append("<br>Notes: click[drop_id]to show the detail of drop data,click[del] to delete the drop data!");
    replyMSG.append("<table>");
    replyMSG.append("<tr><td>npc_id itemId category</td><td>item[id]</td><td>type</td><td>del</td></tr>");

    for(L2DropCategory cat:npcData.getDropData())
      for(L2DropData drop : cat.getAllDrops())
      {
        replyMSG.append("<tr><td><a action=\"bypass -h admin_edit_drop " + npcData.npcId + " " + drop.getItemId()+ " " + cat.getCategoryType() + "\">"
            + npcData.npcId + " " + drop.getItemId() + " " + cat.getCategoryType() + "</a></td>" +
            "<td>" + ItemTable.getInstance().getTemplate(drop.getItemId()).getName() + "[" + drop.getItemId() + "]" + "</td><td>" + (drop.isQuestDrop()?"Q":(cat.isSweep()?"S":"D")) + "</td><td>" +
            "<a action=\"bypass -h admin_del_drop " + npcData.npcId + " " + drop.getItemId() +" "+ cat.getCategoryType() +"\">del</a></td></tr>");
      }

    replyMSG.append("</table>");
    replyMSG.append("<center>");
    replyMSG.append("<button value=\"Add DropData\" action=\"bypass -h admin_add_drop "+ npcId + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("<button value=\"Close\" action=\"bypass -h admin_close_window\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("</center></body></html>");

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

  }
View Full Code Here

      con = L2DatabaseFactory.getInstance().getConnection();

      PreparedStatement statement = con.prepareStatement("SELECT mobId, itemId, min, max, category, chance FROM droplist WHERE mobId=" + npcId + " AND itemId=" + itemId+ " AND category=" + category);
      ResultSet dropData = statement.executeQuery();

      NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

      TextBuilder replyMSG = new TextBuilder("<html><title>the detail of dropdata: (" + npcId + " " + itemId + " " + category + ")</title>");
      replyMSG.append("<body>");

      if(dropData.next()){
        replyMSG.append("<table>");
        replyMSG.append("<tr><td>Appertain of NPC</td><td>"+ NpcTable.getInstance().getTemplate(dropData.getInt("mobId")).name + "</td></tr>");
        replyMSG.append("<tr><td>ItemName</td><td>"+ ItemTable.getInstance().getTemplate(dropData.getInt("itemId")).getName() + "(" + dropData.getInt("itemId") + ")</td></tr>");
        replyMSG.append("<tr><td>Category</td><td>"+ ((category==-1)?"sweep":Integer.toString(category)) + "</td></tr>");
        replyMSG.append("<tr><td>MIN(" + dropData.getInt("min") + ")</td><td><edit var=\"min\" width=80></td></tr>");
        replyMSG.append("<tr><td>MAX(" + dropData.getInt("max") + ")</td><td><edit var=\"max\" width=80></td></tr>");
        replyMSG.append("<tr><td>CHANCE("+ dropData.getInt("chance") + ")</td><td><edit var=\"chance\" width=80></td></tr>");
        replyMSG.append("</table>");

        replyMSG.append("<center>");
        replyMSG.append("<button value=\"Save Modify\" action=\"bypass -h admin_edit_drop " + npcId + " " + itemId + " " + category +" $min $max $chance\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
        replyMSG.append("<br><button value=\"DropList\" action=\"bypass -h admin_show_droplist " + dropData.getInt("mobId") +"\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
        replyMSG.append("</center>");
      }

      dropData.close();
      statement.close();

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

      activeChar.sendPacket(adminReply);
    }
    catch(Exception e){}
    finally
View Full Code Here

    }
  }

  private void showAddDropData(L2PcInstance activeChar, L2NpcTemplate npcData)
  {
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    TextBuilder replyMSG = new TextBuilder("<html><title>Add dropdata to " + npcData.name + "(" + npcData.npcId + ")</title>");
    replyMSG.append("<body>");
    replyMSG.append("<table>");
    replyMSG.append("<tr><td>Item-Id</td><td><edit var=\"itemId\" width=80></td></tr>");
    replyMSG.append("<tr><td>MIN</td><td><edit var=\"min\" width=80></td></tr>");
    replyMSG.append("<tr><td>MAX</td><td><edit var=\"max\" width=80></td></tr>");
    replyMSG.append("<tr><td>CATEGORY(sweep=-1)</td><td><edit var=\"category\" width=80></td></tr>");
    replyMSG.append("<tr><td>CHANCE(0-1000000)</td><td><edit var=\"chance\" width=80></td></tr>");
    replyMSG.append("</table>");

    replyMSG.append("<center>");
    replyMSG.append("<button value=\"SAVE\" action=\"bypass -h admin_add_drop " + npcData.npcId + " $itemId $category $min $max $chance\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("<br><button value=\"DropList\" action=\"bypass -h admin_show_droplist " + npcData.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);
  }
View Full Code Here

      if(npcId > 0)
      {
        reLoadNpcDropList(npcId);

        NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
        TextBuilder replyMSG = new TextBuilder("<html><title>Drop data modify 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);
      }
      else
        activeChar.sendMessage("unknown error!");
    }
View Full Code Here

      statement.execute();
      statement.close();

      reLoadNpcDropList(npcId);

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

      adminReply.setHtml(replyMSG.toString());
      activeChar.sendPacket(adminReply);
    }
    catch(Exception e){}
    finally
    {
View Full Code Here

        statement2.execute();
        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

TOP

Related Classes of net.sf.l2j.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.