Secret Experience

Secret Experience (https://secretexperience.net/)
-   [Lineage] Java Mods (https://secretexperience.net/lineage-java-mods/)
-   -   [L2JServer] PHX Multisell bug fix (https://secretexperience.net/lineage-java-mods/32609-phx-multisell-bug-fix.html)

allanalcantara 16-08-2011 12:35 PM

PHX Multisell bug fix
 
1 Anexo(s)
Código:

Index: java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java        (revision 2745)
+++ java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java        (working copy)
@@ -88,6 +88,8 @@
        {
                PcInventory inv = player.getInventory();
               
+                boolean maintainItemFound = false;
+               
                // given the template entry and information about maintaining enchantment and applying taxes
                // re-create the instance of the entry that will be used for this exchange
                // i.e. change the enchantment level of select ingredient/products and adena amount appropriately.
@@ -126,10 +128,26 @@
                        }
                        if (newIng)
                        {
+                                // If there is a maintainIngredient, then we do not need to check the enchantment parameter
+                                //  as the enchant level will be checked elsewhere
+                                if (maintainEnchantment && e.getMantainIngredient())
+                                {
+                                        maintainItemFound = true;
+                                }
                                // if it's a new ingredient, just store its info directly (item id, count, enchantment)
                                _ingredientsList.add(L2Multisell.getInstance().new MultiSellIngredient(e));
                        }
                }
+               
+                // If there is no maintainIngredient, then we must make sure that the
+                //  enchantment is not kept from the client packet, as it may have been forged
+                if (!maintainItemFound)
+                {
+                        for (MultiSellIngredient product : entry.getProducts())
+                        {
+                                product.setEnchantmentLevel(0);
+                        }
+                }
                // now check if the player has sufficient items in the inventory to cover the ingredients' expences
                for (MultiSellIngredient e : _ingredientsList)
                {



Horários baseados na GMT -3. Agora são 08:21 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.