From 434f48b558044a070157bdc41f75ef9f4e5ef0a5 Mon Sep 17 00:00:00 2001 From: gonlad_x Date: Thu, 22 Oct 2026 10:59:17 +0200 Subject: [PATCH 1/3] add option in Ennemies tab to prevent malenia from recovering HP on hits --- .gitignore | 3 +- TarnishedTool/Enums/HotkeyActions.cs | 1 + TarnishedTool/ViewModels/EnemyViewModel.cs | 46 +++++++++++++++++++ TarnishedTool/ViewModels/SettingsViewModel.cs | 1 + TarnishedTool/Views/Tabs/EnemyTab.xaml | 35 +++++++++++++- 5 files changed, 84 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index add57be7..a5811b0b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ bin/ obj/ /packages/ riderModule.iml -/_ReSharper.Caches/ \ No newline at end of file +/_ReSharper.Caches/ +/resources/ diff --git a/TarnishedTool/Enums/HotkeyActions.cs b/TarnishedTool/Enums/HotkeyActions.cs index d2b569cd..be5c2331 100644 --- a/TarnishedTool/Enums/HotkeyActions.cs +++ b/TarnishedTool/Enums/HotkeyActions.cs @@ -146,6 +146,7 @@ public enum HotkeyActions RestOnRevive, DrawNavigationRoute, RykardNoMega, + MaleniaNoHpRecovery, LionMainLightning, LionMainFrost, LionMainWind, diff --git a/TarnishedTool/ViewModels/EnemyViewModel.cs b/TarnishedTool/ViewModels/EnemyViewModel.cs index c35e1dc8..94736b3a 100644 --- a/TarnishedTool/ViewModels/EnemyViewModel.cs +++ b/TarnishedTool/ViewModels/EnemyViewModel.cs @@ -54,6 +54,24 @@ public class EnemyViewModel : BaseViewModel private const float LionTripleTransitionDuration = 15f; private const int ChangeHpRateOffset = 0x9c; + private static readonly (uint RowId, float ChangeHpRate)[] MaleniaHpRecoveryRows = + { + (18400, -1.5f), + (18401, -5f), + (18402, -10f), + (18403, -18f), + (18405, -0.5f), + (18410, -0.4f), + (18411, -0.8f), + (18412, -1.6f), + (18413, -3.2f), + (18414, -4.8f), + (18415, -6.4f), + (18416, -8.2f), + (18417, -10.6f), // on grab + (18418, -12.8f), + (18419, -16.4f), + }; private static readonly uint[] MainBossPhaseSpEffectRowIds = { @@ -351,6 +369,18 @@ public bool IsRykardNoMegaEnabled } } + private bool _isMaleniaNoHpRecoveryEnabled; + + public bool IsMaleniaNoHpRecoveryEnabled + { + get => _isMaleniaNoHpRecoveryEnabled; + set + { + if (!SetProperty(ref _isMaleniaNoHpRecoveryEnabled, value)) return; + SetMaleniaNoHpRecovery(_isMaleniaNoHpRecoveryEnabled); + } + } + private void SetLionPhaseSpEffectsLockState(uint entityId, bool locked, uint[] spEffectRowIds) { var chrIns = _chrInsService.ChrInsByEntityId(entityId); @@ -502,6 +532,7 @@ private void OnGameFirstLoaded() if (IsNoMoveEnabled) _enemyService.ToggleNoMove(true); if (IsDisableAiEnabled) _enemyService.ToggleDisableAi(true); if (IsRykardNoMegaEnabled) _enemyService.ToggleRykardMega(true); + if (IsMaleniaNoHpRecoveryEnabled) SetMaleniaNoHpRecovery(true); if (IsTargetingViewEnabled) _enemyService.ToggleTargetingView(true); if (IsDrawReducedTargetViewEnabled && IsTargetingViewEnabled) _enemyService.ToggleReducedTargetingView(true); @@ -532,6 +563,8 @@ private void RegisterHotkeys() () => { IsDrawNavigationRouteEnabled = !IsDrawNavigationRouteEnabled; }); _hotkeyManager.RegisterAction(HotkeyActions.RykardNoMega, () => { IsRykardNoMegaEnabled = !IsRykardNoMegaEnabled; }); + _hotkeyManager.RegisterAction(HotkeyActions.MaleniaNoHpRecovery, + () => { IsMaleniaNoHpRecoveryEnabled = !IsMaleniaNoHpRecoveryEnabled; }); _hotkeyManager.RegisterAction(HotkeyActions.LionMainLightning, () => SafeExecute(ForceLionMainBossLightningPhase)); _hotkeyManager.RegisterAction(HotkeyActions.LionMainFrost, () => SafeExecute(ForceLionMainBossFrostPhase)); @@ -577,6 +610,19 @@ private void RemoveSerpentHunterPercentageDamage(bool enabled) } } + private void SetMaleniaNoHpRecovery(bool enabled) + { + var (tableIndex, slotIndex) = ParamIndices.All["SpEffectParam"]; + + foreach (var (rowId, vanillaChangeHpRate) in MaleniaHpRecoveryRows) + { + nint row = _paramService.GetParamRow(tableIndex, slotIndex, rowId); + if (row == 0) continue; + + _paramService.Write(row, ChangeHpRateOffset, enabled ? 0f : vanillaChangeHpRate); + } + } + private void ApplyLionSpEffects(uint entityId) { var chrIns = _chrInsService.ChrInsByEntityId(entityId); diff --git a/TarnishedTool/ViewModels/SettingsViewModel.cs b/TarnishedTool/ViewModels/SettingsViewModel.cs index 6b1e2dc8..36f0ae2d 100644 --- a/TarnishedTool/ViewModels/SettingsViewModel.cs +++ b/TarnishedTool/ViewModels/SettingsViewModel.cs @@ -125,6 +125,7 @@ public SettingsViewModel(ISettingsService settingsService, HotkeyManager hotkeyM new("Rest On Revive", HotkeyActions.RestOnRevive), new("Draw Enemy Nav Route", HotkeyActions.DrawNavigationRoute), new("Rykard No Mega", HotkeyActions.RykardNoMega), + new("Malenia No HP Recovery", HotkeyActions.MaleniaNoHpRecovery), new("Lion Main Lightning Phase", HotkeyActions.LionMainLightning), new("Lion Main Frost Phase", HotkeyActions.LionMainFrost), new("Lion Main Wind Phase", HotkeyActions.LionMainWind), diff --git a/TarnishedTool/Views/Tabs/EnemyTab.xaml b/TarnishedTool/Views/Tabs/EnemyTab.xaml index be3169be..faee4ce3 100644 --- a/TarnishedTool/Views/Tabs/EnemyTab.xaml +++ b/TarnishedTool/Views/Tabs/EnemyTab.xaml @@ -21,6 +21,7 @@ + + + + + + + + + + + + + + @@ -268,7 +301,7 @@ - From 77286cf165bb68c8e4b1f2c43973d9dcbcbf2ea9 Mon Sep 17 00:00:00 2001 From: gonlad_x Date: Thu, 22 Oct 2026 13:00:36 +0200 Subject: [PATCH 2/3] small change in copies --- TarnishedTool/Views/Tabs/EnemyTab.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TarnishedTool/Views/Tabs/EnemyTab.xaml b/TarnishedTool/Views/Tabs/EnemyTab.xaml index faee4ce3..6b4dd493 100644 --- a/TarnishedTool/Views/Tabs/EnemyTab.xaml +++ b/TarnishedTool/Views/Tabs/EnemyTab.xaml @@ -230,7 +230,7 @@ Height="12" Margin="10,0,0,0" VerticalAlignment="Center" - ToolTip="Malenia heals nothing from hits, including grabs" + ToolTip="Prevents Malenia from getting HP back from hits" ToolTipService.InitialShowDelay='100'> Date: Thu, 22 Oct 2026 18:03:38 +0200 Subject: [PATCH 3/3] remove useless comment --- TarnishedTool/ViewModels/EnemyViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TarnishedTool/ViewModels/EnemyViewModel.cs b/TarnishedTool/ViewModels/EnemyViewModel.cs index 94736b3a..79df7b9d 100644 --- a/TarnishedTool/ViewModels/EnemyViewModel.cs +++ b/TarnishedTool/ViewModels/EnemyViewModel.cs @@ -68,7 +68,7 @@ private static readonly (uint RowId, float ChangeHpRate)[] MaleniaHpRecoveryRows (18414, -4.8f), (18415, -6.4f), (18416, -8.2f), - (18417, -10.6f), // on grab + (18417, -10.6f), (18418, -12.8f), (18419, -16.4f), };