diff --git a/CHANGELOG.md b/CHANGELOG.md index 4494aaa5..2f8861b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,7 @@ -## Version 1.0.7 -* added defensive weapon training - ## Version 1.0.7 * added config options for crusade fixes +* added defensive weapon training +* fixed lich spellbook merging ## Version 1.0.6 * metamagic rods no longer are on by default diff --git a/TabletopTweaks/Bugfixes/Classes/Lich.cs b/TabletopTweaks/Bugfixes/Classes/Lich.cs index 170f410e..563b95da 100644 --- a/TabletopTweaks/Bugfixes/Classes/Lich.cs +++ b/TabletopTweaks/Bugfixes/Classes/Lich.cs @@ -1,11 +1,14 @@ using HarmonyLib; +using Kingmaker.Blueprints; using Kingmaker.Blueprints.Classes; +using Kingmaker.Blueprints.Classes.Spells; using Kingmaker.Blueprints.JsonSystem; using Kingmaker.ElementsSystem; using Kingmaker.RuleSystem; using Kingmaker.RuleSystem.Rules.Damage; using Kingmaker.UnitLogic.Mechanics; using Kingmaker.UnitLogic.Mechanics.Components; +using System.Linq; using TabletopTweaks.Config; using TabletopTweaks.Extensions; @@ -21,6 +24,7 @@ static void Postfix() { Main.LogHeader("Patching Lich Resources"); PatchDeathRush(); + PatchSpellbookMerging(); void PatchDeathRush() { if (ModSettings.Fixes.Lich.IsDisabled("DeathRush")) { return; } @@ -45,6 +49,23 @@ void PatchDeathRush() { }); Main.LogPatch("Patched", DeathRushFeature); } + + void PatchSpellbookMerging() { + + if (ModSettings.Fixes.Lich.IsDisabled("SpellbookMerging")) { return; } + + var LichIncorporateSpellbookFeature = Resources.GetBlueprint("3f16e9caf7c683c40884c7c455ed26af"); + var ExploiterWizardSpellbook = Resources.GetBlueprint("d09794fb6f93e4a40929a965b434070d"); + var NatureMageSpellbook = Resources.GetBlueprint("3ed7e38dc8134af28e1a2b105f74fb7b"); + + LichIncorporateSpellbookFeature.m_AllowedSpellbooks = LichIncorporateSpellbookFeature.m_AllowedSpellbooks + .AddItem(ExploiterWizardSpellbook.ToReference()) + .AddItem(NatureMageSpellbook.ToReference()) + .Distinct() + .ToArray(); + + Main.LogPatch("Patched", LichIncorporateSpellbookFeature); + } } } } diff --git a/TabletopTweaks/Config/Fixes.json b/TabletopTweaks/Config/Fixes.json index dec7c3d0..f4f6b9da 100644 --- a/TabletopTweaks/Config/Fixes.json +++ b/TabletopTweaks/Config/Fixes.json @@ -27,7 +27,8 @@ "Lich": { "DisableAll": false, "Enabled": { - "DeathRush": true + "DeathRush": true, + "SpellbookMerging": true } }, "Trickster": { diff --git a/TabletopTweaks/Info.json b/TabletopTweaks/Info.json index 7f6aad8f..dc9b19df 100644 --- a/TabletopTweaks/Info.json +++ b/TabletopTweaks/Info.json @@ -9,5 +9,5 @@ "ManagerVersion": "0.23.0", "Repository": "https://raw.githubusercontent.com/Vek17/WrathMods-TabletopTweaks/master/Repository.json", "Requirements": [], - "Version": "1.0.6" + "Version": "1.0.7" } \ No newline at end of file