ExShowManorDefaultInfo.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package net.sf.l2j.gameserver.serverpackets;
  16. import javolution.util.FastList;
  17. import net.sf.l2j.gameserver.model.L2Manor;
  18. /**
  19. * format(packet 0xFE) ch cd [ddddcdcd] c - id h - sub id
  20. *
  21. * c d - size
  22. * [ d - level d - seed price d - seed level d - crop price c d - reward 1 id c
  23. * d - reward 2 id ]
  24. *
  25. * @author l3x
  26. */
  27. public class ExShowManorDefaultInfo extends L2GameServerPacket
  28. {
  29. private static final String _S__FE_1C_EXSHOWSEEDINFO = "[S] FE:25 ExShowManorDefaultInfo";
  30. private FastList<Integer> _crops = null;
  31. public ExShowManorDefaultInfo()
  32. {
  33. _crops = L2Manor.getInstance().getAllCrops();
  34. }
  35. @Override
  36. protected void writeImpl()
  37. {
  38. writeC(0xFE);
  39. writeH(0x25);
  40. writeC(0);
  41. writeD(_crops.size());
  42. for (int cropId : _crops)
  43. {
  44. writeD(cropId); // crop Id
  45. writeD(L2Manor.getInstance().getSeedLevelByCrop(cropId)); // level
  46. writeD(L2Manor.getInstance().getSeedBasicPriceByCrop(cropId)); // seed
  47. // price
  48. writeD(L2Manor.getInstance().getCropBasicPrice(cropId)); // crop
  49. // price
  50. writeC(1); // rewrad 1 Type
  51. writeD(L2Manor.getInstance().getRewardItem(cropId, 1)); // Rewrad 1
  52. // Type Item
  53. // Id
  54. writeC(1); // rewrad 2 Type
  55. writeD(L2Manor.getInstance().getRewardItem(cropId, 2)); // Rewrad 2
  56. // Type Item
  57. // Id
  58. }
  59. }
  60. @Override
  61. public String getType()
  62. {
  63. return _S__FE_1C_EXSHOWSEEDINFO;
  64. }
  65. }