Package net.sf.l2j.gameserver.model

Examples of net.sf.l2j.gameserver.model.L2TradeList


          else
          {
            buy = (Integer.parseInt(val+"2"));
          }
        }
        L2TradeList list = TradeController.getInstance().getBuyList(buy);
        if (list != null && list.getNpcId().equals(String.valueOf(getNpcId())))
        {
          BuyList bl = new BuyList(list, player.getAdena(), 0);
          player.sendPacket(bl);
        }
        else
View Full Code Here


    private void showBuyWindow(L2PcInstance player, int val)
    {
        player.tempInvetoryDisable();
        if (Config.DEBUG) _log.fine("Showing buylist");
        L2TradeList list = TradeController.getInstance().getBuyList(val);
        if ((list != null) && (list.getNpcId().equals(String.valueOf(getNpcId()))))
        {
            BuyList bl = new BuyList(list, player.getAdena(), 0);
            player.sendPacket(bl);
        }
        else
View Full Code Here

    {
        double taxRate = 0;
        if (getIsInTown()) taxRate = getCastle().getTaxRate();
        player.tempInvetoryDisable();
        if (Config.DEBUG) _log.fine("Showing buylist");
        L2TradeList list = TradeController.getInstance().getBuyList(val);

        if (list != null && list.getNpcId().equals(String.valueOf(getNpcId())))
        {
            BuyList bl = new BuyList(list, player.getAdena(), taxRate);
            player.sendPacket(bl);
        }
        else
View Full Code Here

    private void showBuyWindow(L2PcInstance player, String val)
    {
        double taxRate = 0;
        player.tempInvetoryDisable();

        L2TradeList list = TradeController.getInstance().getBuyList(Integer.parseInt(val));

        if (list != null ) {
            list.getItems().get(0).setCount(1);
          BuyList bl = new BuyList(list, player.getAdena(), taxRate);
            player.sendPacket(bl);
        } else {
            _log.info("possible client hacker: " + player.getName() + " attempting to buy from GM shop! < Ban him!");
            _log.info("buylist id:" + val);
View Full Code Here

      switch (ask) { // Main action
      case 1: // Seed purchase
        if (castleId != getCastle().getCastleId()) {
          player.sendPacket(new SystemMessage(SystemMessageId.HERE_YOU_CAN_BUY_ONLY_SEEDS_OF_S1_MANOR));
        } else {
          L2TradeList tradeList = new L2TradeList(0);
          FastList<SeedProduction> seeds = getCastle().getSeedProduction(CastleManorManager.PERIOD_CURRENT);

          for (SeedProduction s : seeds) {
            L2ItemInstance item = ItemTable.getInstance().createDummyItem(s.getId());
            item.setPriceToSell(s.getPrice());
            item.setCount(s.getCanProduce());
            if ((item.getCount() > 0) && (item.getPriceToSell() > 0))
              tradeList.addItem(item);
          }

          BuyListSeed bl = new BuyListSeed(tradeList, castleId, player.getAdena());
          player.sendPacket(bl);
        }
View Full Code Here

    {
        player.tempInvetoryDisable();

        if (Config.DEBUG) _log.fine("Showing wearlist");

        L2TradeList list = TradeController.getInstance().getBuyList(val);

        if (list != null)
        {
            WearList bl = new WearList(list, player.getAdena(), player.getExpertiseIndex());
            player.sendPacket(bl);
View Full Code Here

        player.tempInvetoryDisable();

        if (Config.DEBUG) _log.fine("Showing buylist");

        L2TradeList list = TradeController.getInstance().getBuyList(val);

        if (list != null && list.getNpcId().equals(String.valueOf(getNpcId())))
        {
            BuyList bl = new BuyList(list, player.getAdena(), taxRate);
            player.sendPacket(bl);
        }
        else
View Full Code Here

  private void editShopItem(L2PcInstance activeChar, String[] args)
  {
    int tradeListID = Integer.parseInt(args[1]);
    int itemID = Integer.parseInt(args[2]);
    L2TradeList tradeList = TradeController.getInstance().getBuyList(tradeListID);

    L2Item item = ItemTable.getInstance().getTemplate(itemID);
    if (tradeList.getPriceForItemId(itemID) < 0)
    {
      return;
    }

    if (args.length > 3)
    {
      int price = Integer.parseInt(args[3]);
      int order =  findOrderTradeList(itemID, tradeList.getPriceForItemId(itemID), tradeListID);

      tradeList.replaceItem(itemID, Integer.parseInt(args[3]));
      updateTradeList(itemID, price, tradeListID, order);

      activeChar.sendMessage("Updated price for "+item.getName()+" in Trade List "+tradeListID);
      showShopList(activeChar, tradeListID, 1);
      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>");
View Full Code Here

  private void delShopItem(L2PcInstance activeChar, String[] args)
  {
    int tradeListID = Integer.parseInt(args[1]);
    int itemID = Integer.parseInt(args[2]);
    L2TradeList tradeList = TradeController.getInstance().getBuyList(tradeListID);

    if (tradeList.getPriceForItemId(itemID) < 0)
      return;

    if (args.length > 3)
    {
      int order =  findOrderTradeList(itemID, tradeList.getPriceForItemId(itemID), tradeListID);

      tradeList.removeItem(itemID);
      deleteTradeList(tradeListID, order);

      activeChar.sendMessage("Deleted "+ItemTable.getInstance().getTemplate(itemID).getName()+" from Trade List "+tradeListID);
      showShopList(activeChar, tradeListID, 1);
      return;
    }

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    TextBuilder replyMSG = new TextBuilder();
    replyMSG.append("<html><title>Merchant Shop Item Delete</title>");
    replyMSG.append("<body>");
    replyMSG.append("<br>Delete entry in merchantList.");
    replyMSG.append("<br>Item to Delete: "+ItemTable.getInstance().getTemplate(itemID).getName());
    replyMSG.append("<table>");
    replyMSG.append("<tr><td width=100>Property</td><td width=100>Value</td></tr>");
    replyMSG.append("<tr><td><br></td><td></td></tr>");
    replyMSG.append("<tr><td>Price</td><td>"+tradeList.getPriceForItemId(itemID)+"</td></tr>");
    replyMSG.append("</table>");
    replyMSG.append("<center><br><br><br>");
    replyMSG.append("<button value=\"Confirm\" action=\"bypass -h admin_delShopItem " + tradeListID + " " + itemID + " 1\"  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>");
View Full Code Here

  private void addShopItem(L2PcInstance activeChar, String[] args)
  {
    int tradeListID = Integer.parseInt(args[1]);

    L2TradeList tradeList = TradeController.getInstance().getBuyList(tradeListID);
    if (tradeList == null)
    {
      activeChar.sendMessage("TradeList not found!");
      return;
    }

    if (args.length > 3)
    {
      int order = tradeList.getItems().size() + 1; // last item order + 1
      int itemID = Integer.parseInt(args[2]);
      int price = Integer.parseInt(args[3]);

      L2ItemInstance newItem = ItemTable.getInstance().createDummyItem(itemID);
      newItem.setPriceToSell(price);
      newItem.setCount(-1);
      tradeList.addItem(newItem);
      storeTradeList(itemID, price, tradeListID, order);

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

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.model.L2TradeList

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.