HennaItemRemoveInfo.java 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 class HennaItemRemoveInfo extends L2GameServerPacket
  19. {
  20. private static final String _S__E3_HennaItemRemoveInfo = "[S] e7 HennaItemRemoveInfo";
  21. private L2PcInstance _activeChar;
  22. private L2HennaInstance _henna;
  23. public HennaItemRemoveInfo(L2HennaInstance henna, L2PcInstance player)
  24. {
  25. _henna = henna;
  26. _activeChar = player;
  27. }
  28. @Override
  29. protected final void writeImpl()
  30. {
  31. writeC(0xe7);
  32. writeD(_henna.getSymbolId()); //symbol Id
  33. writeD(_henna.getItemIdDye()); //item id of dye
  34. writeQ(0x00); // total amount of dye require
  35. writeQ(_henna.getPrice() / 5); //total amount of aden require to remove symbol
  36. writeD(1); //able to remove or not 0 is false and 1 is true
  37. writeQ(_activeChar.getAdena());
  38. writeD(_activeChar.getINT()); //current INT
  39. writeC(_activeChar.getINT() - _henna.getStatINT()); //equip INT
  40. writeD(_activeChar.getSTR()); //current STR
  41. writeC(_activeChar.getSTR() - _henna.getStatSTR()); //equip STR
  42. writeD(_activeChar.getCON()); //current CON
  43. writeC(_activeChar.getCON() - _henna.getStatCON()); //equip CON
  44. writeD(_activeChar.getMEN()); //current MEM
  45. writeC(_activeChar.getMEN() - _henna.getStatMEM()); //equip MEM
  46. writeD(_activeChar.getDEX()); //current DEX
  47. writeC(_activeChar.getDEX() - _henna.getStatDEX()); //equip DEX
  48. writeD(_activeChar.getWIT()); //current WIT
  49. writeC(_activeChar.getWIT() - _henna.getStatWIT()); //equip WIT
  50. }
  51. /* (non-Javadoc)
  52. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
  53. */
  54. @Override
  55. public String getType()
  56. {
  57. return _S__E3_HennaItemRemoveInfo;
  58. }
  59. }