Advertisement
tensador125

l2jrusacis argu trade packets

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