Morrowind
0 of 0

File information

Last updated

Original upload

Created by

Pharis

Uploaded by

pharispharispharis

Virus scan

Safe to use

About this mod

Lua magicka regeneration for all actors based on Willpower, current fatigue ratio, and optionally current magicka ratio.

Permissions and credits
Mirrors
Donations



Requires OpenMW 0.48 RC or 0.49 Dev Build.

Versions 1.1.0 and higher require the 0.49 dev build (and a very recent one at that), the original version is still available here and on Github though.

I intentionally omitted using intelligence in the calculations because I wanted to keep max magicka separate from regeneration unlike in Oblivion and Skyrim. As active effects aren't currently accessible with Lua unfortunately you will have to manually disable player regeneration if you have the stunted magicka effect. The stunted magicka effect is now accounted for in version 1.1.0.

The included plugin simply sets the fRestMagickaMult GMST to zero to prevent stacking of vanilla regeneration with the mod.

Interface

As of version 1.2.0 there is an interface other Lua scripts can use to affect regeneration for any actor.

The interface can be accessed by requiring the "openmw.interfaces" package as such:

local I = require("openmw.interfaces")

The interface name is "PharisMagickaRegeneration". It can only be used in scripts on players, NPCs, or creatures.

Magicka Handlers:

Add handler that gets called every regeneration tick to edit the magicka delta. The handlers are called in the order they are added after stat calculations are done and before the delta is clamped to prevent overflow or negative regen.

This example in particular just gives Tarhiel a worse time than he already has.

local self = require("openmw.self")

if (self.recordId == "agronian guy") then 
I.PharisMagickaRegeneration.addMagickaHandler(
function (data)
-- Cause fuck that guy in particular I guess
data.delta = data.delta / 2
end
)
end

Regen Suppression:

Temporarily halt all magicka regeneration for a given duration in seconds. The second argument is an optional bool that determines whether any existing suppression on this actor will be forcefully overridden. A 'force' value of nil or false will only override a timer if the new time is longer than the current timer's remaining duration. This function will return a bool telling you whether or not suppression was successfully applied.

I.PharisMagickaRegeneration.suppressRegen(seconds, force)

Remove active regeneration suppression. This will have no effect on regeneration stopped by the Stunted Magicka effect. Be wary of possible incompatibilities with other mods using the interface.

I.PharisMagickaRegeneration.removeSuppression()

Get remaining time on regeneration suppression timer in seconds.

I.PharisMagickaRegeneration.getSuppressionSecondsRemaining()