SySt3MGaM3RFr3aKs Posted December 30, 2009 Posted December 30, 2009 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; Quote
Stefoulis15 Posted January 11, 2010 Posted January 11, 2010 the code with the transaction , is already shared by krash Quote
SySt3MGaM3RFr3aKs Posted January 11, 2010 Author Posted January 11, 2010 the code with the transaction , is already shared by krash Seriously ? please post the link. Quote
Stefoulis15 Posted January 11, 2010 Posted January 11, 2010 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. Quote
Recommended Posts
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.