2
0

HennaInfo.java 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 com.l2jserver.gameserver.network.serverpackets;
  16. import com.l2jserver.gameserver.model.L2HennaInstance;
  17. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  18. public final class HennaInfo extends L2GameServerPacket
  19. {
  20. private static final String _S__E4_HennaInfo = "[S] e5 HennaInfo";
  21. private final L2PcInstance _activeChar;
  22. private final L2HennaInstance[] _hennas = new L2HennaInstance[3];
  23. private int _count;
  24. public HennaInfo(L2PcInstance player)
  25. {
  26. _activeChar = player;
  27. int j = 0;
  28. for (int i = 0; i < 3; i++)
  29. {
  30. L2HennaInstance henna = _activeChar.getHenna(i+1);
  31. if (henna != null)
  32. _hennas[j++] = henna;
  33. }
  34. _count = j;
  35. }
  36. @Override
  37. protected final void writeImpl()
  38. {
  39. writeC(0xe5);
  40. writeC(_activeChar.getHennaStatINT()); //equip INT
  41. writeC(_activeChar.getHennaStatSTR()); //equip STR
  42. writeC(_activeChar.getHennaStatCON()); //equip CON
  43. writeC(_activeChar.getHennaStatMEN()); //equip MEM
  44. writeC(_activeChar.getHennaStatDEX()); //equip DEX
  45. writeC(_activeChar.getHennaStatWIT()); //equip WIT
  46. writeD(3); // slots?
  47. writeD(_count); //size
  48. for (int i = 0; i < _count; i++)
  49. {
  50. writeD(_hennas[i].getSymbolId());
  51. writeD(_hennas[i].getSymbolId());
  52. }
  53. }
  54. /* (non-Javadoc)
  55. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
  56. */
  57. @Override
  58. public String getType()
  59. {
  60. return _S__E4_HennaInfo;
  61. }
  62. }