Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/dist/game/config/L2JMods.properties b/dist/game/config/L2JMods.properties
- index 7e531fa..f0958a4 100644
- --- a/dist/game/config/L2JMods.properties
- +++ b/dist/game/config/L2JMods.properties
- @@ -507,4 +507,17 @@ DualboxCheckWhitelist = 127.0.0.1,0
- # Enables .changepassword voiced command which allows the players to change their account's password ingame.
- # Default: False
- -AllowChangePassword = False
- \ No newline at end of file
- +AllowChangePassword = False
- +
- +# ---------------------------------------------------------------------------
- +# Custom Aggro Range
- +# ---------------------------------------------------------------------------
- +
- +# Enables a custom limit for max aggro range. It's a way to 'fix' the ridiculous aggro range in L2J Servers.
- +# Default: True
- +AllowCustomMaxAggroRange = True
- +
- +# Sets the max limit of the aggro range.
- +# Keep in mind if the Npc has an AI aggro range, this value will be ignored.
- +# Default: 450
- +CustomMaxAggroRange = 450
- \ No newline at end of file
- diff --git a/src/main/java/com/l2jserver/Config.java b/src/main/java/com/l2jserver/Config.java
- index 1c4865a..def4620 100644
- --- a/src/main/java/com/l2jserver/Config.java
- +++ b/src/main/java/com/l2jserver/Config.java
- @@ -774,6 +774,8 @@ public final class Config
- public static int L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
- public static Map<Integer, Integer> L2JMOD_DUALBOX_CHECK_WHITELIST;
- public static boolean L2JMOD_ALLOW_CHANGE_PASSWORD;
- + public static boolean L2JMOD_ALLOW_CUSTOM_MAX_AGGRO_RANGE;
- + public static int L2JMOD_CUSTOM_MAX_AGGRO_RANGE;
- // --------------------------------------------------
- // NPC Settings
- // --------------------------------------------------
- @@ -2507,6 +2509,8 @@ public final class Config
- }
- }
- L2JMOD_ALLOW_CHANGE_PASSWORD = L2JModSettings.getBoolean("AllowChangePassword", false);
- + L2JMOD_ALLOW_CUSTOM_MAX_AGGRO_RANGE = L2JModSettings.getBoolean("AllowCustomMaxAggroRange", false);
- + L2JMOD_CUSTOM_MAX_AGGRO_RANGE = L2JModSettings.getInt("CustomMaxAggroRange", 450);
- // Load PvP L2Properties file (if exists)
- final PropertiesParser PVPSettings = new PropertiesParser(PVP_CONFIG_FILE);
- diff --git a/src/main/java/com/l2jserver/gameserver/model/actor/L2Npc.java b/src/main/java/com/l2jserver/gameserver/model/actor/L2Npc.java
- index 8c49792..97de94c 100644
- --- a/src/main/java/com/l2jserver/gameserver/model/actor/L2Npc.java
- +++ b/src/main/java/com/l2jserver/gameserver/model/actor/L2Npc.java
- @@ -418,7 +418,17 @@ public class L2Npc extends L2Character
- */
- public int getAggroRange()
- {
- - return hasAIValue("aggroRange") ? getAIValue("aggroRange") : getTemplate().getAggroRange();
- + if (hasAIValue("aggroRange"))
- + {
- + return getAIValue("aggroRange");
- + }
- +
- + if (Config.L2JMOD_ALLOW_CUSTOM_MAX_AGGRO_RANGE)
- + {
- + return Math.min(getTemplate().getAggroRange(), Config.L2JMOD_CUSTOM_MAX_AGGRO_RANGE);
- + }
- +
- + return getTemplate().getAggroRange();
- }
- public boolean isInMyClan(L2Npc npc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement