@ -1,7 +1,7 @@
Scriptname _00E_PlayerSetUpScript extends ObjectReference
{Initializes all the necessary Quests, maintains the player, contains various OnPlayerLoadGame() failsafes. This script is important for proper updating, do not overwrite it.}
Float Property CURRENT_PATCH_VERSION = 2.11 AutoReadOnly
Float Property CURRENT_PATCH_VERSION = 2.12 AutoReadOnly
;=====================================================================================
@ -35,12 +35,16 @@ Event OnInit()
; starts all quests that are in the formlist
Int iIndex = QuestsToStart.GetSize()
While iIndex
While iIndex > 0
iIndex -= 1
Quest kQuest = QuestsToStart.GetAt(iIndex) as Quest
kQuest.Start()
endwhile
; Added in 2.0.12
AddPlayerPerks()
EndEvent
Event OnPlayerLoadGame()
@ -148,6 +152,33 @@ Function Update_210()
EndFunction
;=====================================================================================
; 2.0.12
;=====================================================================================
Function Update_212()
;
EndFunction
Function AddPlayerPerks()
if PlayerPerks == None
PlayerPerks = Game.GetForm(0x000493B8) as FormList
endif
Perk kPerk
int iIndex = PlayerPerks.GetSize()
While iIndex > 0
iIndex -= 1
kPerk = PlayerPerks.GetAt(iIndex) as Perk
if ! PlayerREF.HasPerk(kPerk)
PlayerREF.AddPerk(kPerk)
endif
endwhile
EndFunction
;=====================================================================================
; ALL UPDATES
;=====================================================================================
@ -177,7 +208,7 @@ Function FailsafeMQ05PrologueAliases()
; failsafe for issue 1536, fills empty aliases
If MQ05PrologueFunctions == None
MQ05PrologueFunctions = Game.GetFormFromFile (0x00033A5B, "Skyrim.esm" ) as _00E_MQ05Prologue_Functions
MQ05PrologueFunctions = Game.GetForm(0x00033A5B) as _00E_MQ05Prologue_Functions
EndIf
MQ05PrologueFunctions.FillEmptyAliasesFailsafe()
@ -331,6 +362,9 @@ Function Maintenance()
If fPatchVersion < 2.10
Update_210()
EndIf
If fPatchVersion < 2.12
Update_212()
EndIf
fPatchVersion = CURRENT_PATCH_VERSION
endif
@ -338,22 +372,24 @@ Function Maintenance()
; every time a save gets loaded the healrate needs to be set to 0, otherwise it will go back again to default at 0.7
; this is called before active magic effects of potions or spells are applied to the player which could also alter the value
PlayerREF.SetActorValue("Healrate", 0)
; Workaround for broken physics on loading saves, made on a mount
If PlayerREF.IsOnMount()
PlayerREF.Dismount()
EndIf
EnableDisableKillmove()
ResetArmorWeightPerks()
AddPlayerPerks()
SetAutoSaveInterval()
FailsafeMQ05PrologueAliases()
RefreshMountNamesOnLoad()
; Workaround for broken physics on loading saves, made on a mount
If PlayerREF.IsOnMount()
PlayerREF.Dismount()
EndIf
; fixes properties that were accidentally set to NONE by the "More Affinities" mod
If Game.GetModByName("Enderal_FS_More_Affinities.esp") != 255
FixMoreAffinitiesMod()
@ -372,6 +408,7 @@ _00E_MQ05Prologue_Functions Property MQ05PrologueFunctions Auto
Actor Property PlayerREF Auto
FormList Property QuestsToStart Auto
FormList Property PlayerPerks Auto
GlobalVariable Property KillMove Auto