Skip to content

[Share] Enchant, preventing exploits.

Featured Replies

This is based on Interlude L2J, but it is adapted to other Chronicles too.

 

It protects the server from some kind of Enchant exploits ( Is not already shared )

 

Here is the Diff file:

Index: /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java
===================================================================
--- /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java (revision 12)
+++ /trunk/Eclipse-Game/java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java (revision 164)
@@ -61,8 +61,20 @@
         L2PcInstance activeChar = getClient().getActiveChar();
         if (activeChar == null || _objectId == 0) return;
+        
+        if (activeChar.isProcessingTransaction())
+        {
+        	activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
+        	activeChar.setActiveEnchantItem(null);
+        	return;
+        }

         L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);
         L2ItemInstance scroll = activeChar.getActiveEnchantItem();
-        activeChar.setActiveEnchantItem(null);
+        if (item == null || scroll == null)
+        {
+        	activeChar.setActiveEnchantItem(null);
+        	return;
+        }
+        
         if (item == null || scroll == null) return;
         
@@ -74,5 +86,6 @@
         {
         	activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
-            return;
+        	activeChar.setActiveEnchantItem(null);
+        	return;
         }
     	
@@ -89,4 +102,26 @@
             return;
         }
+        
+        switch (item.getLocation())
+        {
+        case INVENTORY:
+        case PAPERDOLL:
+        {
+        	if (item.getOwnerId() != activeChar.getObjectId())
+        	{
+        		activeChar.setActiveEnchantItem(null);
+        		return;
+        	}
+        	break;
+        }
+        default:
+        {
+        	Util.handleIllegalPlayerAction(activeChar,"Player "
+        			+activeChar.getName()
+        			+" tried to use enchant Exploit!", IllegalPlayerAction.PUNISH_KICKBAN);
+        	return;
+        }
+        }
+        
         int itemType2 = item.getItem().getType2();
         boolean enchantItem = false;

  • 2 weeks later...

the code with the transaction , is already shared by krash

Seriously ? please post the link.

 

 

http://www.maxcheaters.com/forum/index.php?topic=90430.0

he had it here. but now it has the other way to fix it.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.