2
0

GMHennaInfo.java 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. /**
  19. *
  20. * @author KenM
  21. */
  22. public class GMHennaInfo extends L2GameServerPacket
  23. {
  24. private final L2PcInstance _activeChar;
  25. private final L2HennaInstance[] _hennas = new L2HennaInstance[3];
  26. private int _count;
  27. public GMHennaInfo(L2PcInstance activeChar)
  28. {
  29. _activeChar = activeChar;
  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. /**
  42. * @see com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket#getType()
  43. */
  44. @Override
  45. public String getType()
  46. {
  47. return "[S] 0xf0 GMHennaInfo";
  48. }
  49. /**
  50. * @see com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket#writeImpl()
  51. */
  52. @Override
  53. protected void writeImpl()
  54. {
  55. writeC(0xf0);
  56. writeC(_activeChar.getHennaStatINT());
  57. writeC(_activeChar.getHennaStatSTR());
  58. writeC(_activeChar.getHennaStatCON());
  59. writeC(_activeChar.getHennaStatMEN());
  60. writeC(_activeChar.getHennaStatDEX());
  61. writeC(_activeChar.getHennaStatWIT());
  62. writeD(3); // slots?
  63. writeD(_count); //size
  64. for (int i = 0; i < _count; i++)
  65. {
  66. writeD(_hennas[i].getSymbolId());
  67. writeD(0x01);
  68. }
  69. }
  70. }