Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. diff --git a/dist/game/config/L2JMods.properties b/dist/game/config/L2JMods.properties
  2. index 7e531fa..f0958a4 100644
  3. --- a/dist/game/config/L2JMods.properties
  4. +++ b/dist/game/config/L2JMods.properties
  5. @@ -507,4 +507,17 @@ DualboxCheckWhitelist = 127.0.0.1,0
  6.  
  7. # Enables .changepassword voiced command which allows the players to change their account's password ingame.
  8. # Default: False
  9. -AllowChangePassword = False
  10. \ No newline at end of file
  11. +AllowChangePassword = False
  12. +
  13. +# ---------------------------------------------------------------------------
  14. +# Custom Aggro Range
  15. +# ---------------------------------------------------------------------------
  16. +
  17. +# Enables a custom limit for max aggro range. It's a way to 'fix' the ridiculous aggro range in L2J Servers.
  18. +# Default: True
  19. +AllowCustomMaxAggroRange = True
  20. +
  21. +# Sets the max limit of the aggro range.
  22. +# Keep in mind if the Npc has an AI aggro range, this value will be ignored.
  23. +# Default: 450
  24. +CustomMaxAggroRange = 450
  25. \ No newline at end of file
  26. diff --git a/src/main/java/com/l2jserver/Config.java b/src/main/java/com/l2jserver/Config.java
  27. index 1c4865a..def4620 100644
  28. --- a/src/main/java/com/l2jserver/Config.java
  29. +++ b/src/main/java/com/l2jserver/Config.java
  30. @@ -774,6 +774,8 @@ public final class Config
  31. public static int L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
  32. public static Map<Integer, Integer> L2JMOD_DUALBOX_CHECK_WHITELIST;
  33. public static boolean L2JMOD_ALLOW_CHANGE_PASSWORD;
  34. + public static boolean L2JMOD_ALLOW_CUSTOM_MAX_AGGRO_RANGE;
  35. + public static int L2JMOD_CUSTOM_MAX_AGGRO_RANGE;
  36. // --------------------------------------------------
  37. // NPC Settings
  38. // --------------------------------------------------
  39. @@ -2507,6 +2509,8 @@ public final class Config
  40. }
  41. }
  42. L2JMOD_ALLOW_CHANGE_PASSWORD = L2JModSettings.getBoolean("AllowChangePassword", false);
  43. + L2JMOD_ALLOW_CUSTOM_MAX_AGGRO_RANGE = L2JModSettings.getBoolean("AllowCustomMaxAggroRange", false);
  44. + L2JMOD_CUSTOM_MAX_AGGRO_RANGE = L2JModSettings.getInt("CustomMaxAggroRange", 450);
  45.  
  46. // Load PvP L2Properties file (if exists)
  47. final PropertiesParser PVPSettings = new PropertiesParser(PVP_CONFIG_FILE);
  48. diff --git a/src/main/java/com/l2jserver/gameserver/model/actor/L2Npc.java b/src/main/java/com/l2jserver/gameserver/model/actor/L2Npc.java
  49. index 8c49792..97de94c 100644
  50. --- a/src/main/java/com/l2jserver/gameserver/model/actor/L2Npc.java
  51. +++ b/src/main/java/com/l2jserver/gameserver/model/actor/L2Npc.java
  52. @@ -418,7 +418,17 @@ public class L2Npc extends L2Character
  53. */
  54. public int getAggroRange()
  55. {
  56. - return hasAIValue("aggroRange") ? getAIValue("aggroRange") : getTemplate().getAggroRange();
  57. + if (hasAIValue("aggroRange"))
  58. + {
  59. + return getAIValue("aggroRange");
  60. + }
  61. +
  62. + if (Config.L2JMOD_ALLOW_CUSTOM_MAX_AGGRO_RANGE)
  63. + {
  64. + return Math.min(getTemplate().getAggroRange(), Config.L2JMOD_CUSTOM_MAX_AGGRO_RANGE);
  65. + }
  66. +
  67. + return getTemplate().getAggroRange();
  68. }
  69.  
  70. public boolean isInMyClan(L2Npc npc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement