HennaInfo.java 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * $Header$
  3. *
  4. *
  5. * This program is free software: you can redistribute it and/or modify it under
  6. * the terms of the GNU General Public License as published by the Free Software
  7. * Foundation, either version 3 of the License, or (at your option) any later
  8. * version.
  9. *
  10. * This program is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  12. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  13. * details.
  14. *
  15. * You should have received a copy of the GNU General Public License along with
  16. * this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. package net.sf.l2j.gameserver.serverpackets;
  19. import net.sf.l2j.gameserver.model.L2HennaInstance;
  20. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  21. public final class HennaInfo extends L2GameServerPacket
  22. {
  23. private static final String _S__E4_HennaInfo = "[S] e5 HennaInfo";
  24. private final L2PcInstance _activeChar;
  25. private final L2HennaInstance[] _hennas = new L2HennaInstance[3];
  26. private int _count;
  27. public HennaInfo(L2PcInstance player)
  28. {
  29. _activeChar = player;
  30. int j = 0;
  31. for (int i = 0; i < 3; i++)
  32. {
  33. L2HennaInstance h = _activeChar.getHenna(i+1);
  34. if (h != null)
  35. {
  36. _hennas[j++] = h;
  37. }
  38. }
  39. _count = j;
  40. }
  41. @Override
  42. protected final void writeImpl()
  43. {
  44. writeC(0xe5);
  45. writeC(_activeChar.getHennaStatINT()); //equip INT
  46. writeC(_activeChar.getHennaStatSTR()); //equip STR
  47. writeC(_activeChar.getHennaStatCON()); //equip CON
  48. writeC(_activeChar.getHennaStatMEN()); //equip MEM
  49. writeC(_activeChar.getHennaStatDEX()); //equip DEX
  50. writeC(_activeChar.getHennaStatWIT()); //equip WIT
  51. writeD(3); // slots?
  52. writeD(_count); //size
  53. for (int i = 0; i < _count; i++)
  54. {
  55. writeD(_hennas[i].getSymbolId());
  56. writeD(_hennas[i].getSymbolId());
  57. }
  58. }
  59. /* (non-Javadoc)
  60. * @see net.sf.l2j.gameserver.serverpackets.ServerBasePacket#getType()
  61. */
  62. @Override
  63. public String getType()
  64. {
  65. return _S__E4_HennaInfo;
  66. }
  67. }