ExStorageMaxCount.java 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  17. /**
  18. * Format: (ch)ddddddd
  19. * d: Number of Inventory Slots
  20. * d: Number of Warehouse Slots
  21. * d: Number of Freight Slots (unconfirmed) (200 for a low level dwarf)
  22. * d: Private Sell Store Slots (unconfirmed) (4 for a low level dwarf)
  23. * d: Private Buy Store Slots (unconfirmed) (5 for a low level dwarf)
  24. * d: Dwarven Recipe Book Slots
  25. * d: Normal Recipe Book Slots
  26. * @author -Wooden-
  27. * format from KenM
  28. */
  29. public class ExStorageMaxCount extends L2GameServerPacket
  30. {
  31. private static final String _S__FE_2E_EXSTORAGEMAXCOUNT = "[S] FE:2f ExStorageMaxCount";
  32. private L2PcInstance _activeChar;
  33. private int _inventory;
  34. private int _warehouse;
  35. private int _freight;
  36. private int _privateSell;
  37. private int _privateBuy;
  38. private int _receipeD;
  39. private int _recipe;
  40. public ExStorageMaxCount(L2PcInstance character)
  41. {
  42. _activeChar = character;
  43. _inventory = _activeChar.getInventoryLimit();
  44. _warehouse = _activeChar.getWareHouseLimit();
  45. _privateSell = _activeChar.getPrivateSellStoreLimit();
  46. _privateBuy = _activeChar.getPrivateBuyStoreLimit();
  47. _freight = _activeChar.getFreightLimit();
  48. _receipeD = _activeChar.getDwarfRecipeLimit();
  49. _recipe = _activeChar.getCommonRecipeLimit();
  50. }
  51. /* (non-Javadoc)
  52. * @see net.sf.l2j.gameserver.serverpackets.ServerBasePacket#writeImpl()
  53. */
  54. @Override
  55. protected void writeImpl()
  56. {
  57. writeC(0xfe);
  58. writeH(0x2f);
  59. writeD(_inventory);
  60. writeD(_warehouse);
  61. writeD(_freight);
  62. writeD(_privateSell);
  63. writeD(_privateBuy);
  64. writeD(_receipeD);
  65. writeD(_recipe);
  66. }
  67. /* (non-Javadoc)
  68. * @see net.sf.l2j.gameserver.BasePacket#getType()
  69. */
  70. @Override
  71. public String getType()
  72. {
  73. return _S__FE_2E_EXSTORAGEMAXCOUNT;
  74. }
  75. }