Skyrim Special Edition

File information

Last updated

Original upload

Created by

nicholasdwebb

Uploaded by

nicholasdwebb

Virus scan

Safe to use

Tags for this mod

About this mod

Maintain your spells by sacrificing a portion of your max Magicka. Based on Invested Magic by NineInchNall, but with reduced script usage and a few bug fixes.

Requirements
Permissions and credits
Translations
  • Spanish
  • Mandarin
Changelogs
One of my biggest complaints about the magic system in Skyrim is that most spells do not last more than one or two minutes. This makes using spells like Mage Armor or pretty much everything in the Conjuration school unnecessarily tedious. This mod gets around that by making the spells permanent - but using them reduces your max Magicka.

For example, you can summon a Flame Atronach permanently, but doing so will reduce your Magicka by 80 points. If you have the Apprentice Conjuration perk, this cost is reduced to 40 points. If the atronach is killed in battle, or you dispel it yourself, your Magicka points will be returned to you.
This system applies to pretty much all of the Conjuration spells (including Dawnguard and Dragonborn spells), with the exception of spells that are already permanent summons such as Dead Thrall.
Spells in the other schools function as toggles. So if you cast a spell like Candlelight, it will reduce your Magicka by 15 points (or 7 with Novice Alteration). It will stay active until you cast the spell again, which will dispel it and return your Magicka points.


At this point, you're probably wondering:"Why did you make this when Invested Magic already exists?" (if you aren't familiar with NineInchNall's excellent mod, you can see the oldrim version here). There are a couple of reasons I did this. 

1. There isn't an SSE version available that works properly. There is one posted on the nexus that was ported by someone else, but several important features have been removed, like the changes to perks rendered useless by the new magic system. It also introduced new bugs, such as a few Conjuration spells relying on Alteration perks for some reason.

2. While the original Invested Magic is a very well made mod, it does have a few bugs that significantly threw off the balance of my game as a heavy magic user. Most notably, if your spell is dispelled in an unusual way it may not return your Magicka correctly. For example, in some cases when a summon dies or is stolen by an enemy (an admittedly rare occurrence), you may not get your Magicka back. A more common bug is that that the Mage Armor spells (Oakflesh, Ironflesh, etc.) will return more Magicka than you invested on occasion. This bug caused me to have over 120 extra points of Magicka after ~20 hours of play. 

Fixing these bugs requires that the script that handles your Magicka investments be able to correctly respond to every situation that may cause your spells to be dispelled. I initially wanted to rewrite the script in Invested Magicka to do this, but it proved too difficult to do comprehensively. As a result, I used another method of handling the Magicka investments that does not directly alter your max Magicka. As a bonus, this method greatly reduces the script-load this mod places on the game. The trade off is that it takes me a long time to make each spell work. I'll give a full technical description of the differences between these mods below.

The technical description:
Spoiler:  
Show

The primary difference between Invested Magicka and this mod is that invested Magicka uses a script to adjust your max Magicka every time a spell is cast or dispelled. Here is a snippet of the relevant code:

Int Property MagickaPenalty = 25 Auto
  if theCaster.HasPerk(CostReductionPerk)
    MagickaPenalty = MagickaPenalty / 2
  endif
  theCaster.ModAV("Magicka", -1 * MagickaPenalty)

The MagickaPenalty Property is the cost of the spell as defined in the spell's MagicEffect form. The script then uses this cost to reduce your Magicka. When the spell is removed, it uses the .ModAV() command to return your Magicka. This does not always work perfectly for the reasons I've already described.

The method I used in this mod is based on the idea used in ToggleSpells by ErikRedbeard. This method uses a predefined debuff associated with each spell that will reduce your Magicka by a set amount. The debuff has a set of conditions that will change the amount removed based on any relevant perks and how many instances of the spell are present. Here is the part of my script that applies the debuff:

Spell Property togglespellnegative  Auto
Game.GetPlayer().AddSpell(togglespellnegative) 


The togglespellnegative property is the specific debuff that corresponds to the spell. When the spell is dispelled, the debuff is removed with the .RemoveSpell() command. This guarantees that even if the script doesn't know exactly what to do in an unusual situation, such as when a summon is stolen, your Magicka will not be permanently damaged. And since most of the legwork is being done by the conditional effects of the debuff, it reduces script load.
For those that are interested, I've included the complete main script of my mod here: 
Spoiler:  
Show

Scriptname togglespell extends activemagiceffect  
float max = 1.0
bool applyxp = false
Event OnEffectStart(Actor akTarget, Actor akCaster)
        if Game.GetPlayer() == akCaster
                ; spell is being used by player
                if (spellschool == "CONJURATION")
                        if dualwield || Game.GetPlayer().HasPerk(TwinSouls)
                                max = 2.0
                                ; spell can have 2 instances
                                if togglespellglobal.getValue() == 1
                                        ; only one instance is active and a second one is about to be applied
                                        applyxp = true
                                        ; apply xp, assuming Magicka doesn't run out
                                elseif togglespellglobal.getValue() == 2
                                        if dualwield != true
                                                Utility.Wait(1.5)
                                                ; wait for previous summon to be removed
                                        endif
                                        ; two instances are active, xp shouldn't be reapplied
                                        togglespellglobal.setValue(1.0)
                                        ; reset for the next loop
                                endif
                        endif
                endif
                if Game.getPlayer().hasMagicEffect(togglespelleffect) == 1 && togglespellglobal.getValue() == 1
                        ; if player has the spell already applied
                        Game.GetPlayer().RemoveSpell(togglespellnegative)
                        ; remove negative effects
                        if max == 2.0
                                 ; if player can have more than one active
                                 togglespellglobal.Mod(1.0)
                                 Game.GetPlayer().AddSpell(togglespellnegative)
                                 ; reapply correctly if multiple instances are present (dual wielding bound swords or twin souls conjurations)
                        elseif spellschool == "CONJURATION"
                                ; spell is a conjuration spell but only one can be active at a time
                                togglespellglobal.setValue(1.0)
                                Game.GetPlayer().AddSpell(togglespellnegative) 
                                ; reapply neg effect
                        else
                                 togglespellglobal.SetValue(0.0)
                                 self.dispel()
                                 ; dispel and mark as empty
                        endif
                elseif togglespellglobal.getValue() == 0
                        ; spell is not present
                        Game.GetPlayer().AddSpell(togglespellnegative) 
                        togglespellglobal.setValue(1.0)
                        ; apply negative effect and increase global var
                        applyxp = true
                        ; apply xp if magicka is available
                endif
                if Game.GetPlayer().GetActorValue("magicka") <= 1
                        ; out of Magicka
                        Debug.Notification("Insufficient Magicka")
                        togglespellglobal.Mod(-1.0)
                        Game.GetPlayer().RemoveSpell(togglespellnegative)
                        ; decrease global var and remove negative effect
                        if dualwield || togglespellglobal.getValue() == 0
                                ; spell should be disabled or is a dual wielded bound weapon
                                self.dispel()
                        elseif togglespellglobal.getValue() > 0
                                ; spell instance is still active
                                Game.GetPlayer().AddSpell(togglespellnegative) 
                                ; reapply with updated count
                        endif
                elseif applyxp == true
                        Game.AdvanceSkill(spellschool, spellxpmagnitude)
                        ; apply xp since the spell was not dispelled due to low Magicka
                endif
        endif
        ; Debug.Notification(togglespellglobal.getValue())
EndEvent
Event OnEffectFinish(Actor akTarget, Actor akCaster)
        if Game.GetPlayer() == akCaster 
         ; spell being used by player 
                if Game.getPlayer().hasMagicEffect(togglespelleffect)!=1
                ; spell is no longer active
                        Game.GetPlayer().RemoveSpell(togglespellnegative)
                        togglespellglobal.SetValue(0.0)
                        ; remove negative effect and zero global var
                else
                ; another instance of the spell is still active
                        Game.GetPlayer().RemoveSpell(togglespellnegative)
                        ; remove negative effect 
                        togglespellglobal.setValue(1.0)
                        Game.GetPlayer().AddSpell(togglespellnegative) 
                        ; reapply negative effect with updated count
                endif
        endif
        ; Debug.Notification(togglespellglobal.getValue())
EndEvent
MagicEffect Property togglespelleffect  Auto
GlobalVariable Property togglespellglobal  Auto
Spell Property togglespellnegative  Auto
String Property spellschool Auto
Int Property spellxpmagnitude Auto
bool Property dualwield Auto
Perk Property TwinSouls Auto



In case you're wondering why I didn't just port the ToggleSpells mod to SSE instead of writing my own script, that mod has a few significant limitations: it only covers a few spells, it does not properly adjust the cost of the spell if you have a half-cost perk, and it does not award xp for casting the spells. My script and the more complex conditions I have applied to the debuffs correct these issues.


I've also made a few tweaks to the extraneous functionality of the original Invested Magicka mod. These changes are listed below.

1. Invested Magicka: "Stability increases stagger resistance [when mage armor spells are active] and prevents your mage armor spells from being released when you run out of magicka."
  • My mod only increases stagger resistance, since the script does not dispel already active spells when you run out of magicka (it will still prevent you from casting a spell if you don't have the Magicka). 

2. Invested Magicka: "Summoner increases the number of creatures you can control." 
  • My mod does not extend the casting range of the Conjuration spells like Invested Magicka, so the original functionality of the Summoner perk (increasing the distance summons can be cast from) is still useful. You can still use the Twin Souls perk to get more than one summon.

3. Invested Magicka: "Dark Souls actually does what it says. (Beth screwed the pooch on this one.)" 
  • My mod also includes a fix for this. However, I corrected the way that the perk is used by the relative conjuration spells, rather than using a script to add the 100 points of extra health after the fact as Invested Magicka does.

4. Invested Magicka: "Necromancy gives your undead rapid healing." 
  • Same. However, my version increases the healing proportionally to the skill required to reanimate the undead (i.e., the Raise Zombie spell will give less healing than Revenant)

5. Invested Magicka: "Elemental Potency lets atronachs scale with your level. Srsly."
  • Same. I've also made the base level Atronachs scale (they will reach 60% of your level) while the Potent Atronachs will reach 80%. If enough people like this feature, I can make all summons scale with player level.

6. Invested Magicka: "Atromancy grants you resistance to the element of the atronach(s) you summon. 25% for a regular summon, 50% for thralls."
  • Also the same. Credit to NineInchNall, I just ported his script for this function as is.

I did not include NineInchNall's changes to the destruction tree, as I prefer to use a mod like Full Magic Scaling for that functionality.

There are a few other changes I've made that are worth mentioning:
  • Reanimated corpses will turn into ash when they are killed or dispelled. This was removed by Invested Magicka so that you could continually revive the same corpse. I feel that this is a bit unbalanced and reduces the utility of spells like Dead Thrall. Daedra can still be reanimated infinite times, just like the base game.
  • Dread Zombie (the most powerful reanimate corpse spell) will work on enemies up to level 99.
  • Spell costs generally scale linearly rather than exponentially (i.e. a spell that is twice as powerful costs twice as much). This makes using high level mage armor spells in particular more reasonable than in Invested Magicka, which charged 400 points to use Dragonhide.
  • Your Active Effects tab will give an exact accounting of which spells are active and how much Magicka is being used by each.


Here is a list of all spells this mod currently changes:
Spoiler:  
Show
  • Flame Atronach
  • Frost Atronach
  • Storm Atronach
  • Bound Sword
  • Bound Dagger
  • Bound Battleaxe
  • Bound Bow
  • Invisibility
  • Flame Cloak
  • Frost Cloak
  • Lightning Cloak
  • Candlelight
  • Oakflesh
  • Ironflesh
  • Stoneflesh
  • Ebonyflesh
  • Dragonhide
  • Waterbreaking
  • Conjure Familiar
  • Raise Zombie
  • Reanimate Corpse
  • Revenant
  • Dread Zombie
  • Muffle
  • Conjure Dremora Lord
  • Stendarr's Aura
  • Whirlwind Cloak
  • Conjure Wrathman
  • Conjure Mistman
  • Conjure Boneman
  • Conjure Ash Spawn
  • Conjure Seeker

If you would like to see another spell added, feel free to ask.

Compatibility:
This should be compatible with anything that doesn't edit the spells I mentioned. If you are using a perk overhaul, some of the features of this mod may not function. Here is my loadorder, so you can see which mods I've actually verified to be compatible:
Spoiler:  
Show

*Unofficial Skyrim Special Edition Patch.esp
*BSAssets.esm
*BSHeartland.esm
*BS_DLC_patch.esp
*SMIM-SE-Merged-All.esp
*EnhancedLightsandFX.esp
*Darkend.esp
*SkyUI_SE.esp
*Modern Brawl Bug Fix.esp
*Hothtrooper44_Armor_Ecksstra.esp
*undeadfx.esp
*Full Magic Scaling.esp
*Chesko_WearableLantern.esp
*Customizable Camera.esp
*SoundsofSkyrimComplete.esp
*Hothtrooper44_ArmorCompilation.esp
*Immersive Weapons.esp
*Wildcat - Combat of Skyrim.esp
*Wild World.esp
*AmazingFollowerTweaks.esp
*TKDodge.esp
*PassiveWeaponEnchantmentRecharging.esp
*NoBSAIProjectileDodge.esp
*AcquisitiveSoulGemMultithreaded.esp
*EK_RingLimiter.esp
*SkyHUD.esp
*SmartCast_1_0.esp
*Dual Sheath Redux.esp
*All Geared Up.esp
*aMidianborn_Skyforge_Weapons.esp
*AMB Glass Variants Lore.esp
*Differently Ebony.esp
*Beards.esp
*imp_helm_legend.esp
*JulesRankPerks.esp
*AddPerkPoints.esp
*Better Vampires.esp
*Ars Metallica.esp
*Vigilant.esp
*MusicMerge_NR.esp
*Skyrim Flora Overhaul.esp
*Dual Wield Parrying_LeftHand.esp
*Verdant - A Skyrim Grass Plugin SSE Version.esp
*BetterDeadThralls.esp
*EnhancedCharacterEdit.esp
*Equipping Overhaul.esp
*Apocalypse - Magic of Skyrim.esp
*FNIS.esp
*Footprints.esp
*CharacterMakingExtender.esp
*High Level Enemies.esp
*High Level Enemies - Dragonborn.esp
*High Level Enemies - Dawnguard.esp
*CollectBodies.esp
*Vigilant Voiced.esp
*Extended UI.esp
*NirShor-MusicalLore.esp
*Open Cities Skyrim.esp
*Alternate Start - Live Another Life.esp
*Relationship Dialogue Overhaul.esp
*RDO - AFT v1.66 Patch.esp
*RealisticWaterTwo.esp
*Convenient Horses.esp
*RealisticWaterTwo - Open Cities.esp
*Mortal Enemies - Rival Remix - NoRunWalkChanges.esp
*Sustained Magic.esp
togglespells - mine.esp
*Dual Sheath Redux Patch.esp
*Bashed Patch, 0.esp
*my tweaks.esp
CH Bruma Patch.esp
Fantasy Soundtrack Project - Combat.esp
XPMSSE.esp
Pickpocket100Chance.esp
RealisticWaterTwo - Watercolor.esp
Fantasy Soundtrack Project.esp
Skysan_Icicle.esp
Proper Aiming.esp



Does this support OrdinatorPlease stop asking me and read the spoiler here:
Spoiler:  
Show

The spell costs in this mod are controlled by the vanilla cost reduction perks. Even though Ordinator removes them from the skill trees, it leaves the original perks present in the game. So with Ordinator, the spells impacted by this mod will never receive the benefits of the half-cost perks. However, you can get around this by re-adding the perks to your character with the console. This won't impact the cost of other spells, as those are only paying attention to Ordinator's new perk system.

You could even take it a step further with one of my favorite mods, Exciting Skill Ranks: https://www.nexusmods.com/skyrimspecialedition/mods/13067/

This has an option that will automatically add the relevant cost perks once your skill reaches the appropriate level. Since they will be added by a script, it doesn't matter that the perks have been hidden on the skill tree. Effectively, this mod will be doing the work of adding the perks by console for you, and doing so at an appropriate level to maintain the balance of your game. While this doesn't make my mod work perfectly with Ordinator, since it still won't have the more granular cost reduction that Ordinator's perk tree offers, it will be relatively balanced. 


Vaati88 has been kind enough to make a variety of patches for Sustained Magic and a few other mods, most notably Apocalypse Magic
Get it here: https://www.nexusmods.com/skyrimspecialedition/mods/26450
Don't forget to endorse his work!
Note: I did do a test of his patch and noticed that he forgot to include a file. I've added the missing file to the optional downloads on this mod. You still need his patch to get the full effect.

TheOneWhoSlaysU/YesMan have also created a few patches for sustained magic. I haven't tested them but they are available if you want some additional functionality:
  • Sustained Wards - cast wards once and forget about it
  • UI Debuffs - Uses survival mode's UI debuff to show your spent magicka from sustained spells. Seems like a great addition

Future Plans:
1. If I have the time, I might add support for the Apocalypse Magic mod. made by Vaati88
2. If enough people need it, I might add support for more than two concurrent instances of the same summon.
3. I may add a more robust xp system. implemented

Known Issues/Limitations:
1. My script only handles conjuring a max of two of the same summon at once. If you have a mod that allows you to summon more, they will not work properly. However, you could still summon more than two of different summons (i.e. two flame atronachs and a frost atronach).
2. Your summons might not always follow you into new cells. This is an issue present in the base game with other permanent summons such as Dead Thrall. Moving to another new cell should bring your summon back. Alternatively, you can dispel it to remove the Magicka penalty by using the "Dispel Magic" spell that is automatically added when this mod loads.
3. You are only awarded experience when you first cast the spell. It is possible to make the script continuously add experience whenever your spell is active in combat situations, but that would require a fair bit of work and would mean that the script would have to be continuously monitoring for changes in combat status. I did not feel that this was worth it.
  • If you are worried about this slowing down your xp progression, I recommend Smart Cast to automatically activate and deactivate your spells based on your context, such as activating Mage Armor when a weapon is drawn, activating muffle while sneaking, etc. That way, your spells will be recast more frequently and xp gain won't be reduced. However, this is an oldrim mod that you will have to port yourself (remember to unpack the BSA when you do this). 
  • The new XP system has been implemented that awards XP over time during combat
4. I believe it is possible that if your system is particularly weak or overloaded with scripts and you attempt to summon two creatures at the same time, it may only apply the debuff for one of them. I have not been able to make this happen in testing, but if it happens to you I'd be interested to know that it is in fact possible.