Advertisement
tensador125

l2jmega argu trade packets

Jan 18th, 2024
1,071
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.44 KB | Gaming | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2jMega_gameserver2
  3. diff --git java/net/sf/l2j/gameserver/model/tradelist/TradeItem.java java/net/sf/l2j/gameserver/model/tradelist/TradeItem.java
  4. index 4b25019..ae2240e 100644
  5. --- java/net/sf/l2j/gameserver/model/tradelist/TradeItem.java
  6. +++ java/net/sf/l2j/gameserver/model/tradelist/TradeItem.java
  7. @@ -10,11 +10,13 @@
  8.     private int _enchant;
  9.     private int _count;
  10.     private int _price;
  11. +   private int _augmentationId;
  12.    
  13.     public TradeItem(ItemInstance item, int count, int price)
  14.     {
  15.         _objectId = item.getObjectId();
  16.         _item = item.getItem();
  17. +       _augmentationId = item.isAugmented() ? item.getAugmentation().getAugmentationId() : 0;
  18.         _enchant = item.getEnchantLevel();
  19.         _count = count;
  20.         _price = price;
  21. @@ -38,6 +40,12 @@
  22.         _price = price;
  23.     }
  24.    
  25. +   public int getAugmentationId()
  26. +   {          
  27. +   return _augmentationId;
  28. +   }
  29. +  
  30. +  
  31.     public void setObjectId(int objectId)
  32.     {
  33.         _objectId = objectId;
  34. diff --git java/net/sf/l2j/gameserver/network/serverpackets/TradeItemUpdate.java java/net/sf/l2j/gameserver/network/serverpackets/TradeItemUpdate.java
  35. index c2af70d..c22d514 100644
  36. --- java/net/sf/l2j/gameserver/network/serverpackets/TradeItemUpdate.java
  37. +++ java/net/sf/l2j/gameserver/network/serverpackets/TradeItemUpdate.java
  38. @@ -51,11 +51,22 @@
  39.             writeD(item.getItem().getItemId());
  40.             writeD(availableCount);
  41.             writeH(item.getItem().getType2());
  42. -           writeH(0x00);
  43. +              int _augorg = 0;
  44. +              int _aug = 0;
  45. +              int _aug2 = 0;
  46. +              int _aug3 = 0;
  47. +              if (item.getAugmentationId() > 0)
  48. +              {
  49. +                  _augorg = item.getAugmentationId();    
  50. +                  _aug = _augorg>>16;
  51. +                  _aug2 = _aug;
  52. +                  _aug3 = _augorg-(_aug<<16);
  53. +              }                
  54. +                  writeH(_aug2);
  55.             writeD(item.getItem().getBodyPart());
  56.             writeH(item.getEnchant());
  57.             writeH(0x00);
  58. -           writeH(0x00);
  59. +           writeH(_aug3);
  60.         }
  61.     }
  62.  }
  63. \ No newline at end of file
  64. diff --git java/net/sf/l2j/gameserver/network/serverpackets/TradeOtherAdd.java java/net/sf/l2j/gameserver/network/serverpackets/TradeOtherAdd.java
  65. index eb4d155..023fb3d 100644
  66. --- java/net/sf/l2j/gameserver/network/serverpackets/TradeOtherAdd.java
  67. +++ java/net/sf/l2j/gameserver/network/serverpackets/TradeOtherAdd.java
  68. @@ -26,11 +26,22 @@
  69.         writeD(_item.getItem().getItemId());
  70.         writeD(_item.getCount());
  71.         writeH(_item.getItem().getType2()); // item type2
  72. -       writeH(0x00); // ?
  73. +          int _augorg = 0;
  74. +          int _aug = 0;
  75. +          int _aug2 = 0;
  76. +          int _aug3 = 0;
  77. +          if (_item.getAugmentationId() > 0)
  78. +          {
  79. +              _augorg = _item.getAugmentationId();    
  80. +              _aug = _augorg>>16;
  81. +              _aug2 = _aug;
  82. +              _aug3 = _augorg-(_aug<<16);
  83. +          }                
  84. +              writeH(_aug2);
  85.        
  86.         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
  87.         writeH(_item.getEnchant()); // enchant level
  88. -       writeH(0x00); // ?
  89. +       writeH(_aug3);
  90.         writeH(0x00);
  91.     }
  92.  }
  93. diff --git java/net/sf/l2j/gameserver/network/serverpackets/TradeOwnAdd.java java/net/sf/l2j/gameserver/network/serverpackets/TradeOwnAdd.java
  94. index 19e583e..425c842 100644
  95. --- java/net/sf/l2j/gameserver/network/serverpackets/TradeOwnAdd.java
  96. +++ java/net/sf/l2j/gameserver/network/serverpackets/TradeOwnAdd.java
  97. @@ -26,11 +26,22 @@
  98.         writeD(_item.getItem().getItemId());
  99.         writeD(_item.getCount());
  100.         writeH(_item.getItem().getType2()); // item type2
  101. -       writeH(0x00); // ?
  102. +        int _augorg = 0;
  103. +        int _aug = 0;
  104. +        int _aug2 = 0;
  105. +        int _aug3 = 0;
  106. +        if (_item.getAugmentationId() > 0) {
  107. +            _augorg = _item.getAugmentationId();    
  108. +            _aug = _augorg>>16;
  109. +            _aug2 = _aug;
  110. +            _aug3 = _augorg-(_aug<<16);
  111. +        }
  112. +        
  113. +            writeH(_aug2);
  114.        
  115.         writeD(_item.getItem().getBodyPart()); // slot
  116.         writeH(_item.getEnchant()); // enchant level
  117.         writeH(0x00); // ?
  118. -       writeH(0x00);
  119. +       writeH(_aug3);
  120.     }
  121.  }
  122. \ No newline at end of file
  123. diff --git java/net/sf/l2j/gameserver/network/serverpackets/TradeStart.java java/net/sf/l2j/gameserver/network/serverpackets/TradeStart.java
  124. index 20969d8..1b84a34 100644
  125. --- java/net/sf/l2j/gameserver/network/serverpackets/TradeStart.java
  126. +++ java/net/sf/l2j/gameserver/network/serverpackets/TradeStart.java
  127. @@ -40,11 +40,27 @@
  128.             writeD(temp.getItemId());
  129.             writeD(temp.getCount());
  130.             writeH(item.getType2());
  131. +              int _augorg = 0;
  132. +              int _aug = 0;
  133. +              int _aug2 = 0;
  134. +              int _aug3 = 0;
  135. +              if (temp.isAugmented()) {
  136. +                  _augorg = temp.getAugmentation().getAugmentationId();    
  137. +                  _aug = _augorg>>16;
  138. +                  _aug2 = _aug;
  139. +                  _aug3 = _augorg-(_aug<<16);
  140. +              }
  141. +              if (temp.isAugmented())
  142. +                  writeH(_aug2);
  143. +              if (temp.isAugmented() == false)
  144.             writeH(temp.getCustomType1());
  145.             writeD(item.getBodyPart());
  146.             writeH(temp.getEnchantLevel());
  147.             writeH(temp.getCustomType2());
  148. -           writeH(0x00);
  149. +              if (temp.isAugmented())
  150. +                  writeH(_aug3);
  151. +                  if (temp.isAugmented() == false)
  152. +                      writeH(0x00);
  153.         }
  154.     }
  155.  }
  156. \ No newline at end of file
  157.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement