TradeOtherAdd.java 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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.ItemInfo;
  21. import com.l2jserver.gameserver.model.TradeItem;
  22. /**
  23. * @author Yme
  24. */
  25. public final class TradeOtherAdd extends AbstractItemPacket
  26. {
  27. private final TradeItem _item;
  28. public TradeOtherAdd(TradeItem item)
  29. {
  30. _item = item;
  31. }
  32. @Override
  33. protected final void writeImpl()
  34. {
  35. writeC(0x1B);
  36. writeH(1); // item count
  37. writeH(0);
  38. writeD(_item.getObjectId());
  39. writeD(_item.getItem().getDisplayId());
  40. writeQ(_item.getCount());
  41. writeH(_item.getItem().getType2()); // item type2
  42. writeH(_item.getCustomType1());
  43. 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
  44. writeH(_item.getEnchant()); // enchant level
  45. writeH(0x00);
  46. writeH(_item.getCustomType2());
  47. // T1
  48. writeItemElementalAndEnchant(new ItemInfo(_item));
  49. }
  50. }