@ -1,7 +1,7 @@
Scriptname _00E_PlayerSetUpScript extends ObjectReference
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.}
{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
; starts all quests that are in the formlist
Int iIndex = QuestsToStart.GetSize()
Int iIndex = QuestsToStart.GetSize()
While iIndex
While iIndex > 0
iIndex -= 1
iIndex -= 1
Quest kQuest = QuestsToStart.GetAt(iIndex) as Quest
Quest kQuest = QuestsToStart.GetAt(iIndex) as Quest
kQuest.Start()
kQuest.Start()
endwhile
endwhile
; Added in 2.0.12
AddPlayerPerks()
EndEvent
EndEvent
Event OnPlayerLoadGame()
Event OnPlayerLoadGame()
@ -148,6 +152,33 @@ Function Update_210()
EndFunction
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
; ALL UPDATES
;=====================================================================================
;=====================================================================================
@ -177,7 +208,7 @@ Function FailsafeMQ05PrologueAliases()
; failsafe for issue 1536, fills empty aliases
; failsafe for issue 1536, fills empty aliases
If MQ05PrologueFunctions == None
If MQ05PrologueFunctions == None
MQ05PrologueFunctions = Game.GetFormFromFile (0x00033A5B, "Skyrim.esm" ) as _00E_MQ05Prologue_Functions
MQ05PrologueFunctions = Game.GetForm(0x00033A5B) as _00E_MQ05Prologue_Functions
EndIf
EndIf
MQ05PrologueFunctions.FillEmptyAliasesFailsafe()
MQ05PrologueFunctions.FillEmptyAliasesFailsafe()
@ -331,6 +362,9 @@ Function Maintenance()
If fPatchVersion < 2.10
If fPatchVersion < 2.10
Update_210()
Update_210()
EndIf
EndIf
If fPatchVersion < 2.12
Update_212()
EndIf
fPatchVersion = CURRENT_PATCH_VERSION
fPatchVersion = CURRENT_PATCH_VERSION
endif
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
; 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
; 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)
PlayerREF.SetActorValue("Healrate", 0)
; Workaround for broken physics on loading saves, made on a mount
If PlayerREF.IsOnMount()
PlayerREF.Dismount()
EndIf
EnableDisableKillmove()
EnableDisableKillmove()
ResetArmorWeightPerks()
ResetArmorWeightPerks()
AddPlayerPerks()
SetAutoSaveInterval()
SetAutoSaveInterval()
FailsafeMQ05PrologueAliases()
FailsafeMQ05PrologueAliases()
RefreshMountNamesOnLoad()
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
; fixes properties that were accidentally set to NONE by the "More Affinities" mod
If Game.GetModByName("Enderal_FS_More_Affinities.esp") != 255
If Game.GetModByName("Enderal_FS_More_Affinities.esp") != 255
FixMoreAffinitiesMod()
FixMoreAffinitiesMod()
@ -372,6 +408,7 @@ _00E_MQ05Prologue_Functions Property MQ05PrologueFunctions Auto
Actor Property PlayerREF Auto
Actor Property PlayerREF Auto
FormList Property QuestsToStart Auto
FormList Property QuestsToStart Auto
FormList Property PlayerPerks Auto
GlobalVariable Property KillMove Auto
GlobalVariable Property KillMove Auto