xRelic

No Enchanting Near Npcs L2JFrozen 1132

Jul 9th, 2021
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. com.l2jfrozen.gameserver.network.clientpacketsRequestEnchantItem.java
  2.  
  3. protected void runImpl()
  4. {
  5. final L2PcInstance activeChar = getClient().getActiveChar();
  6. +
  7. + Collection<L2Character> knowns = activeChar.getKnownList().getKnownCharactersInRadius(400);
  8. +
  9. if (activeChar == null || _objectId == 0)
  10. return;
  11.  
  12.  
  13. +
  14. + for (L2Object wh1 : knowns)
  15. + {
  16. + if (Config.ENCHANT_PROTECTOR)
  17. + if (wh1 instanceof L2NpcInstance)
  18. + {
  19. + activeChar.sendMessage("You Cannot enchant near Npcs.");
  20. + return;
  21. + }
  22. + }
  23. +
  24. if (activeChar.isOnline() == 0)
  25. {
  26. activeChar.setActiveEnchantItem(null);
  27. return;
  28. }
  29.  
  30. final L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);
  31. L2ItemInstance scroll = activeChar.getActiveEnchantItem();
  32. activeChar.setActiveEnchantItem(null);
  33.  
  34.  
  35. Config.java
  36.  
  37. +
  38. + //==========================================================================
  39. + public static boolean ENCHANT_PROTECTOR;
  40. + //==========================================================================
  41. +
  42.  
  43.  
  44. //=================================Search Section Of L2JFrozenSettings.getProperty And Add This Line ======================================
  45.  
  46.  
  47. +
  48. + //==========================================================================+=============================
  49. + ENCHANT_PROTECTOR = Boolean.parseBoolean(L2JFrozenSettings.getProperty("EnchantProtector", "true"));
  50. + //==========================================================================+=============================
  51. +
  52.  
  53. gameserver\config\functions\l2jfrozen.properties
  54.  
  55.  
Advertisement
Add Comment
Please, Sign In to add comment