Jump to content

[Share] Enchant, preventing exploits.


Recommended Posts

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;

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...