2
0

TradeOtherAdd.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 net.sf.l2j.gameserver.serverpackets;
  16. import net.sf.l2j.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 TradeOtherAdd extends L2GameServerPacket
  24. {
  25. private static final String _S__31_TRADEOTHERADD = "[S] 1b TradeOtherAdd";
  26. private TradeList.TradeItem _item;
  27. public TradeOtherAdd(TradeList.TradeItem item)
  28. {
  29. _item = item;
  30. }
  31. @Override
  32. protected final void writeImpl()
  33. {
  34. writeC(0x1b);
  35. writeH(1); // item count
  36. writeH(_item.getItem().getType1()); // item type1
  37. writeD(_item.getObjectId());
  38. writeD(_item.getItem().getItemId());
  39. writeD(_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(0x00);
  46. // T1
  47. writeD(_item.getAttackAttrElement());
  48. writeD(_item.getAttackAttrElementVal());
  49. writeD(_item.getDefAttrFire());
  50. writeD(_item.getDefAttrWater());
  51. writeD(_item.getDefAttrWind());
  52. writeD(_item.getDefAttrEarth());
  53. writeD(_item.getDefAttrHoly());
  54. writeD(_item.getDefAttrUnholy());
  55. }
  56. /* (non-Javadoc)
  57. * @see net.sf.l2j.gameserver.serverpackets.ServerBasePacket#getType()
  58. */
  59. @Override
  60. public String getType()
  61. {
  62. return _S__31_TRADEOTHERADD;
  63. }
  64. }