TradeOwnAdd.java 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.TradeList;
  17. /**
  18. * This class ...
  19. *
  20. * @author Yme
  21. * @version $Revision: 1.2.2.1.2.3 $ $Date: 2005/03/27 15:29:39 $
  22. */
  23. public final class TradeOwnAdd extends L2GameServerPacket
  24. {
  25. private static final String _S__30_TRADEOWNADD = "[S] 1a TradeOwnAdd";
  26. private TradeList.TradeItem _item;
  27. public TradeOwnAdd(TradeList.TradeItem item)
  28. {
  29. _item = item;
  30. }
  31. @Override
  32. protected final void writeImpl()
  33. {
  34. writeC(0x1a);
  35. writeH(1); // items added count
  36. writeH(_item.getItem().getType1()); // item type1
  37. writeD(_item.getObjectId());
  38. writeD(_item.getItem().getItemId());
  39. writeQ(_item.getCount());
  40. writeH(_item.getItem().getType2()); // item type2
  41. writeH(0x00); // ?
  42. writeD(_item.getItem().getBodyPart()); // rev 415 slot 0006-lr.ear 0008-neck 0030-lr.finger 0040-head 0080-?? 0100-l.hand 0200-gloves 0400-chest 0800-pants 1000-feet 2000-?? 4000-r.hand 8000-r.hand
  43. writeH(_item.getEnchant()); // enchant level
  44. writeH(0x00);
  45. writeH(_item.getCustomType2());
  46. // T1
  47. writeH(_item.getAttackElementType());
  48. writeH(_item.getAttackElementPower());
  49. for (byte i = 0; i < 6; i++)
  50. writeH(_item.getElementDefAttr(i));
  51. writeH(0x00); // Enchant effect 1
  52. writeH(0x00); // Enchant effect 2
  53. writeH(0x00); // Enchant effect 3
  54. }
  55. /* (non-Javadoc)
  56. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
  57. */
  58. @Override
  59. public String getType()
  60. {
  61. return _S__30_TRADEOWNADD;
  62. }
  63. }