diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/AISystem/Brains/MonsterBrain.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/AISystem/Brains/MonsterBrain.cs index 345137b..9d65050 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/AISystem/Brains/MonsterBrain.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/AISystem/Brains/MonsterBrain.cs @@ -5,6 +5,7 @@ using DiIiS_NA.Core.Extensions; using DiIiS_NA.Core.Helpers.Math; using DiIiS_NA.Core.Logging; using DiIiS_NA.Core.MPQ; +using DiIiS_NA.D3_GameServer; using DiIiS_NA.D3_GameServer.Core.Types.SNO; using DiIiS_NA.GameServer.Core.Types.SNO; using DiIiS_NA.GameServer.Core.Types.TagMap; @@ -151,7 +152,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains if (CurrentAction != null) return; _powerDelay ??= new SecondsTickTimer(Body.World.Game, 1.0f); // Check if the character has been attacked or if there are any players within 50 units range - if (AttackedBy != null || Body.GetObjectsInRange(50f).Count != 0) + if (AttackedBy != null || Body.GetObjectsInRange(GameModsConfig.Instance.Monster.LookupRange).Count != 0) { // If the power delay hasn't timed out, return if (!_powerDelay.TimedOut) return; @@ -170,13 +171,13 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains // If the character is part of a team, search for alive monsters within a range of 60 units and order them by distance if (Body.Attributes[GameAttributes.Team_Override] == 1) - targets = Body.GetObjectsInRange(60f) + targets = Body.GetObjectsInRange(GameModsConfig.Instance.Monster.LookupRange +10f) .Where(p => !p.Dead) .OrderBy((monster) => PowerMath.Distance2D(monster.Position, Body.Position)) .ToArray(); else // Otherwise, search for different types of actors including players, minions, destructible loot containers, or hirelings that are alive, not loading and not helpers, and order them by distance - targets = Body.GetActorsInRange(50f) + targets = Body.GetActorsInRange(GameModsConfig.Instance.Monster.LookupRange) .Where(p => ((p is Player) && !p.Dead && p.Attributes[GameAttributes.Loading] == false && p.Attributes[GameAttributes.Is_Helper] == false && p.World.BuffManager.GetFirstBuff(p) == null) @@ -295,7 +296,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains } } - else if (Body.GetObjectsInRange(50f).Count != 0) + else if (Body.GetObjectsInRange(GameModsConfig.Instance.Monster.LookupRange).Count != 0) { if (!_powerDelay.TimedOut) return; _powerDelay = new SecondsTickTimer(Body.World.Game, 1.0f); @@ -305,7 +306,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains if (PriorityTarget == null) { - var targets = Body.GetActorsInRange(50f) + var targets = Body.GetActorsInRange(GameModsConfig.Instance.Monster.LookupRange) .Where(p => ((p is LorathNahr_NPC) && !p.Dead) || ((p is CaptainRumford) && !p.Dead) || (p is DesctructibleLootContainer && p.SNO.IsDoorOrBarricade()) diff --git a/src/DiIiS-NA/D3-GameServer/GameModsConfig.cs b/src/DiIiS-NA/D3-GameServer/GameModsConfig.cs index 90cf18e..31cbaf3 100644 --- a/src/DiIiS-NA/D3-GameServer/GameModsConfig.cs +++ b/src/DiIiS-NA/D3-GameServer/GameModsConfig.cs @@ -58,6 +58,8 @@ public class MonsterConfig public float HealthMultiplier { get; set; } = 1; public float DamageMultiplier { get; set; } = 1; + + public float LookupRange { get; set; } = 50f; } public class QuestConfig @@ -145,10 +147,10 @@ public class GameModsConfig if (content.TryFromJson(out GameModsConfig config, out Exception ex)) { Logger.Success("Game mods loaded successfully!"); - Logger.Info("$[italic]$Recreating $[underline]$config.mods.json$[/]$ in order to keep the structure and with all fields...$[/]$"); + Logger.Info("$[italic]$Re-formatting$[/]$ $[white on red underline]$ config.mods.json $[/]$..."); var @new = config.ToJson(Formatting.Indented); File.WriteAllText(@"config.mods.json", @new); - Logger.Success("Game mods re-structured!"); + Logger.Success("Game mods re-formatted!"); Instance = config; return; } @@ -199,10 +201,10 @@ public class GameModsConfig { Multipliers = { - Strength = new(migration.StrengthMultiplier, migration.StrengthParagonMultiplier), - Dexterity = new(migration.DexterityMultiplier, migration.DexterityParagonMultiplier), - Intelligence = new(migration.IntelligenceMultiplier, migration.IntelligenceParagonMultiplier), - Vitality = new(migration.VitalityMultiplier, migration.VitalityParagonMultiplier) + Strength = new(migration.StrengthMultiplier, migration.StrengthParagonMultiplier), + Dexterity = new(migration.DexterityMultiplier, migration.DexterityParagonMultiplier), + Intelligence = new(migration.IntelligenceMultiplier, migration.IntelligenceParagonMultiplier), + Vitality = new(migration.VitalityMultiplier, migration.VitalityParagonMultiplier) } }, Items =