muffin v6.12

This commit is contained in:
alydev 2025-10-09 07:53:51 +10:00
parent e786325cda
commit 0950798597
64 changed files with 40100 additions and 58121 deletions

View file

@ -33,6 +33,8 @@ internal sealed class CombatController : IDisposable
public required CombatData Data { get; init; }
public required DateTime LastDistanceCheck { get; set; }
public bool HasAttemptedFateSync { get; set; }
}
public sealed class CombatData
@ -70,6 +72,8 @@ internal sealed class CombatController : IDisposable
private readonly MovementController _movementController;
private readonly GameFunctions _gameFunctions;
private readonly ITargetManager _targetManager;
private readonly IObjectTable _objectTable;
@ -92,10 +96,11 @@ internal sealed class CombatController : IDisposable
public bool IsRunning => _currentFight != null;
public CombatController(IEnumerable<ICombatModule> combatModules, MovementController movementController, ITargetManager targetManager, IObjectTable objectTable, ICondition condition, IClientState clientState, QuestFunctions questFunctions, ILogger<CombatController> logger)
public CombatController(IEnumerable<ICombatModule> combatModules, MovementController movementController, GameFunctions gameFunctions, ITargetManager targetManager, IObjectTable objectTable, ICondition condition, IClientState clientState, QuestFunctions questFunctions, ILogger<CombatController> logger)
{
_combatModules = combatModules.ToList();
_movementController = movementController;
_gameFunctions = gameFunctions;
_targetManager = targetManager;
_objectTable = objectTable;
_condition = condition;
@ -257,7 +262,7 @@ internal sealed class CombatController : IDisposable
}
}
}
return (from x in _objectTable
IGameObject gameObject = (from x in _objectTable
select new
{
GameObject = x,
@ -267,6 +272,17 @@ internal sealed class CombatController : IDisposable
where x.Priority > 0
orderby x.Priority descending, x.Distance
select x.GameObject).FirstOrDefault();
if (gameObject != null && _currentFight.Data.SpawnType == EEnemySpawnType.FateEnemies && !_currentFight.HasAttemptedFateSync)
{
ushort currentFateId = _gameFunctions.GetCurrentFateId();
if (currentFateId != 0)
{
_logger.LogInformation("Checking FATE sync for FATE {FateId}", currentFateId);
_gameFunctions.SyncToFate(currentFateId);
_currentFight.HasAttemptedFateSync = true;
}
}
return gameObject;
}
public unsafe (int Priority, string Reason) GetKillPriority(IGameObject gameObject)
@ -316,12 +332,12 @@ internal sealed class CombatController : IDisposable
}
List<ComplexCombatData> complexCombatDatas = _currentFight.Data.ComplexCombatDatas;
GameObject* address = (GameObject*)gameObject.Address;
if (address->FateId != 0 && gameObject.TargetObjectId != _clientState.LocalPlayer?.GameObjectId)
if (address->FateId != 0 && _currentFight.Data.SpawnType != EEnemySpawnType.FateEnemies && gameObject.TargetObjectId != _clientState.LocalPlayer?.GameObjectId)
{
return (Priority: null, Reason: "FATE mob");
}
Vector3 value = _clientState.LocalPlayer?.Position ?? Vector3.Zero;
bool flag = _currentFight.Data.SpawnType != EEnemySpawnType.FinishCombatIfAny && ((_currentFight.Data.SpawnType != EEnemySpawnType.OverworldEnemies || !(Vector3.Distance(value, battleNpc.Position) >= 50f)) ? true : false);
bool flag = _currentFight.Data.SpawnType != EEnemySpawnType.FinishCombatIfAny && (_currentFight.Data.SpawnType != EEnemySpawnType.OverworldEnemies || !(Vector3.Distance(value, battleNpc.Position) >= 50f)) && _currentFight.Data.SpawnType != EEnemySpawnType.FateEnemies;
if (complexCombatDatas.Count > 0)
{
for (int i = 0; i < complexCombatDatas.Count; i++)