Package lineage2.gameserver.templates.manor

Examples of lineage2.gameserver.templates.manor.CropProcure


    {
      return;
    }
    if (!Config.ALT_ALLOW_SHADOW_WEAPONS)
    {
      show(new CustomMessage("common.Disabled", player), player);
      return;
    }
    if ((player.getLevel() > 39) || (player.getClassLevel() > 2))
    {
      show("Your level is too high!", player);
View Full Code Here


      ThreadPoolManager.getInstance().schedule(new RestoreOfflineTraders(), 30000L);
    }
    getListeners().onStart();
    if (Config.IS_TELNET_ENABLED)
    {
      statusServer = new TelnetServer();
    }
    else
    {
      _log.info("Telnet server is currently disabled.");
    }
View Full Code Here

      _selectorThreads[i].start();
    }
    LoginServerCommunication.getInstance().start();
    if (Config.SERVICES_OFFLINE_TRADE_RESTORE_AFTER_RESTART)
    {
      ThreadPoolManager.getInstance().schedule(new RestoreOfflineTraders(), 30000L);
    }
    getListeners().onStart();
    if (Config.IS_TELNET_ENABLED)
    {
      statusServer = new TelnetServer();
View Full Code Here

                                                                      // 2
                                                                      // id

      if (_castleCrops.containsKey(item.getItemId()))
      {
        CropProcure crop = _castleCrops.get(item.getItemId());
        writeD(_manorId); // manor
        writeQ(crop.getAmount()); // buy residual
        writeQ(crop.getPrice()); // buy price
        writeC(crop.getReward()); // reward
      }
      else
      {
        writeD(0xFFFFFFFF); // manor
        writeQ(0); // buy residual
View Full Code Here

   * @param type int
   * @return long
   */
  public synchronized long getRewardAmountPerCrop(int castle, int cropId, int type)
  {
    final CropProcure cs = ResidenceHolder.getInstance().getResidence(Castle.class, castle).getCropProcure(CastleManorManager.PERIOD_CURRENT).get(cropId);
    for (SeedData seed : _seeds.values())
    {
      if (seed.getCrop() == cropId)
      {
        return cs.getPrice() / getCropBasicPrice(seed.getReward(type));
      }
    }
    return -1;
  }
View Full Code Here

    {
      for (int i = 0; i < _count; i++)
      {
        int itemId = _items[i];
        long count = _itemQ[i];
        CropProcure crop = castle.getCrop(itemId, CastleManorManager.PERIOD_CURRENT);
        if (crop == null)
        {
          return;
        }
        int rewradItemId = Manor.getInstance().getRewardItem(itemId, castle.getCrop(itemId, CastleManorManager.PERIOD_CURRENT).getReward());
View Full Code Here

    _castleCrops = new TreeMap<Integer, CropProcure>();

    List<Castle> castleList = ResidenceHolder.getInstance().getResidenceList(Castle.class);
    for (Castle c : castleList)
    {
      CropProcure cropItem = c.getCrop(_cropId, CastleManorManager.PERIOD_CURRENT);
      if (cropItem != null && cropItem.getAmount() > 0)
        _castleCrops.put(c.getId(), cropItem);
    }
  }
View Full Code Here

    writeD(_cropId); // crop id
    writeD(_castleCrops.size()); // size

    for (int manorId : _castleCrops.keySet())
    {
      CropProcure crop = _castleCrops.get(manorId);
      writeD(manorId); // manor name
      writeQ(crop.getAmount()); // buy residual
      writeQ(crop.getPrice()); // buy price
      writeC(crop.getReward()); // reward type
    }
  }
View Full Code Here

          int rewardType = rs.getInt("reward_type");
          long price = rs.getLong("price");
          int period = rs.getInt("period");
          if (period == PERIOD_CURRENT)
          {
            procure.add(new CropProcure(cropId, canBuy, rewardType, startBuy, price));
          }
          else
          {
            procureNext.add(new CropProcure(cropId, canBuy, rewardType, startBuy, price));
          }
        }
        castle.setCropProcure(procure, PERIOD_CURRENT);
        castle.setCropProcure(procureNext, PERIOD_NEXT);
        if (!procure.isEmpty() || !procureNext.isEmpty() || !production.isEmpty() || !productionNext.isEmpty())
View Full Code Here

  {
    List<CropProcure> crops = new ArrayList<>();
    List<Integer> cropsIds = Manor.getInstance().getCropsForCastle(castleId);
    for (int cr : cropsIds)
    {
      crops.add(new CropProcure(cr));
    }
    return crops;
  }
View Full Code Here

TOP

Related Classes of lineage2.gameserver.templates.manor.CropProcure

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.