If you change your intelligence to 50 then you should have 32 magicka, and if you change it to 100 you should have 1024 magicka. If I load a save with 50 intelligence (in OpenMW) then it correctly gives me 32 magicka, but if I then try to change it to 100 intelligence then it just gives me 100 magicka. No matter what goes into the ModMagicka it always gives me my current intelligence when I change the player's intelligence in OpenMW. This is all assuming there are no magicka fortification modifiers, I have removed the bonuses from atronach/elves/etc in the actual mod but this is just a snippet so you'll get strange numbers if you use them.
Here is the main script:
Code: Select all
Begin chimtest
float PlayerIntelligence
float fTemp
float NewMagicka
float OldMagicka
If (MenuMode)
Return
EndIf
If ((GetIntelligence) == PlayerIntelligence)
Return
EndIf
Set PlayerIntelligence to (GetIntelligence)
; the goal here is so that at 25 intelligence you cant cast spells and at 100 int you have over 1k magicka: (int/25)^5
Set fTemp to PlayerIntelligence / 25
Set NewMagicka to fTemp
Set NewMagicka to NewMagicka * fTemp
Set NewMagicka to NewMagicka * fTemp
Set NewMagicka to NewMagicka * fTemp
Set NewMagicka to NewMagicka * fTemp
Set fTemp to (NewMagicka - (OldMagicka + PlayerIntelligence))
ModMagicka fTemp
Set OldMagicka to NewMagicka
End chimtest