HennaItemDrawInfo.java 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (C) 2004-2015 L2J Server
  3. *
  4. * This file is part of L2J Server.
  5. *
  6. * L2J Server is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J Server is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package com.l2jserver.gameserver.network.serverpackets;
  20. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  21. import com.l2jserver.gameserver.model.items.L2Henna;
  22. /**
  23. * @author Zoey76
  24. */
  25. public class HennaItemDrawInfo extends L2GameServerPacket
  26. {
  27. private final L2PcInstance _activeChar;
  28. private final L2Henna _henna;
  29. public HennaItemDrawInfo(L2Henna henna, L2PcInstance player)
  30. {
  31. _henna = henna;
  32. _activeChar = player;
  33. }
  34. @Override
  35. protected final void writeImpl()
  36. {
  37. writeC(0xE4);
  38. writeD(_henna.getDyeId()); // symbol Id
  39. writeD(_henna.getDyeItemId()); // item id of dye
  40. writeQ(_henna.getWearCount()); // total amount of dye require
  41. writeQ(_henna.getWearFee()); // total amount of Adena require to draw symbol
  42. writeD(_henna.isAllowedClass(_activeChar.getClassId()) ? 0x01 : 0x00); // able to draw or not 0 is false and 1 is true
  43. writeQ(_activeChar.getAdena());
  44. writeD(_activeChar.getINT()); // current INT
  45. writeC(_activeChar.getINT() + _henna.getStatINT()); // equip INT
  46. writeD(_activeChar.getSTR()); // current STR
  47. writeC(_activeChar.getSTR() + _henna.getStatSTR()); // equip STR
  48. writeD(_activeChar.getCON()); // current CON
  49. writeC(_activeChar.getCON() + _henna.getStatCON()); // equip CON
  50. writeD(_activeChar.getMEN()); // current MEN
  51. writeC(_activeChar.getMEN() + _henna.getStatMEN()); // equip MEN
  52. writeD(_activeChar.getDEX()); // current DEX
  53. writeC(_activeChar.getDEX() + _henna.getStatDEX()); // equip DEX
  54. writeD(_activeChar.getWIT()); // current WIT
  55. writeC(_activeChar.getWIT() + _henna.getStatWIT()); // equip WIT
  56. }
  57. }