Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Script to stop healing during sleep


BinaryStyles
 Share

Recommended Posts

I'm attempting to circumvent the healing that takes place during sleep.  I have not been able to figure out what causes the healing in the first place, but here is my script to try to get around it (doesn't work):

 

Scriptname _SleepNoHealth extends activemagiceffect Hidden 
{This script prevents healing during sleep.}
 
MagicEffect property AlchFortifyHealRate auto
MagicEffect property DA11AbFortifyHealRate auto
MagicEffect property EnchFortifyHealRateConstantSelf auto
MagicEffect property RaceArgonianFortifyHealthRate auto
MagicEffect property FoodRestoreHealthDuration auto
 
float playersHealthPercent
float playersHealthFraction
float playersHealth
 
Event OnInit()
RegisterForSleep()
EndEvent
 
Event OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime)
playersHealthPercent = Game.GetPlayer().GetActorValuePercentage("Health")
playersHealthFraction = Game.GetPlayer().GetBaseActorValue("health") * 0.2
playersHealth = Game.GetPlayer().GetBaseActorValue("health") * playersHealthPercent
EndEvent
 
Event OnSleepStop(bool abInterrupted)
if (Game.GetPlayer().HasMagicEffect(AlchFortifyHealRate)) ||  (Game.GetPlayer().HasMagicEffect(DA11AbFortifyHealRate)) ||  (Game.GetPlayer().HasMagicEffect(EnchFortifyHealRateConstantSelf)) ||  (Game.GetPlayer().HasMagicEffect(RaceArgonianFortifyHealthRate)) ||  (Game.GetPlayer().HasMagicEffect(FoodRestoreHealthDuration))
Game.GetPlayer().ForceActorValue("health", Game.GetPlayer().GetBaseActorValue("health"))
elseif playersHealthPercent < 0.2
Game.GetPlayer().ForceActorValue("health", playersHealthFraction)
else
Game.GetPlayer().ForceActorValue("health", playersHealth)
endif
 
 
EndEvent
 
 
 
 
-Any thoughts?
 
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...