; Perks modifying armor weights need some push on each game load to work.
; The push is needed only if the player is over-encumbered on game load.
; If the player is not over-encumbered, the push is not needed because checking the inventory, picking up items, sheathing/drawing a weapon will reset the perks anyway.
{Fixes "More Affinites" mod missing properties in the Levelsystem scripts}
_00E_QuestFunctions QuestFunctionsScript = (Game.GetFormFromFile(0x00010AA2, "Skyrim.esm") as Quest) as _00E_QuestFunctions
If QuestFunctionsScript._00E_RemoveAllItems_TrashContainer == NONE
Debug.Messagebox("Found broken scripts caused by mod >>More Affinities<<. Press OK to fix scripts.")
_00E_ConfigMenu ConfigMenuScript = (Game.GetFormFromFile(0x00010AA2, "Skyrim.esm") as Quest) as _00E_ConfigMenu
ConfigMenuScript.controlQuest = (Game.GetFormFromFile(0x0101EC71, "Enderal - Forgotten Stories.esm") as Quest) as _FS_Phasmalist_ControlQuest
ConfigMenuScript._00E_ConfigMenu_DisableCraftingTutorials = Game.GetFormFromFile(0x00046D8E, "Skyrim.esm") as Message
ConfigMenuScript._00E_ConfigMenu_DisableMenuTutorials = Game.GetFormFromFile(0x00046D8A, "Skyrim.esm") as Message
ConfigMenuScript._00E_ConfigMenu_DisableOtherTutorials = Game.GetFormFromFile(0x00046D8F, "Skyrim.esm") as Message
ConfigMenuScript._00E_ConfigMenu_DisableQuestTutorials = Game.GetFormFromFile(0x00046D8C, "Skyrim.esm") as Message
ConfigMenuScript._00E_ConfigMenu_DisableReadAloudBooks = Game.GetFormFromFile(0x0102E982, "Enderal - Forgotten Stories.esm") as Message
ConfigMenuScript._00E_ConfigMenu_DisableSkillTutorials = Game.GetFormFromFile(0x00046D8D, "Skyrim.esm") as Message
ConfigMenuScript._00E_ConfigMenu_GameplayOptions = Game.GetFormFromFile(0x0102F1BC, "Enderal - Forgotten Stories.esm") as Message
ConfigMenuScript._00E_ConfigMenu_Meditate = Game.GetFormFromFile(0x00046D98, "Skyrim.esm") as Message
ConfigMenuScript._00E_ConfigMenu_OtherOptions = Game.GetFormFromFile(0x00046D89, "Skyrim.esm") as Message
ConfigMenuScript._00E_ConfigMenu_VideoSkip = Game.GetFormFromFile(0x0102E983, "Enderal - Forgotten Stories.esm") as Message
ConfigMenuScript._00E_DisableCraftingTutorials = Game.GetFormFromFile(0x00046D90, "Skyrim.esm") as GlobalVariable
ConfigMenuScript._00E_DisableMenuTutorials = Game.GetFormFromFile(0x00046D8B, "Skyrim.esm") as GlobalVariable
ConfigMenuScript._00E_DisableOtherTutorials = Game.GetFormFromFile(0x00046D93, "Skyrim.esm") as GlobalVariable
ConfigMenuScript._00E_DisableQuestTutorials = Game.GetFormFromFile(0x00046D92, "Skyrim.esm") as GlobalVariable
ConfigMenuScript._00E_DisableReadAloudBooks = Game.GetFormFromFile(0x0102E984, "Enderal - Forgotten Stories.esm") as GlobalVariable
ConfigMenuScript._00E_DisableSkillTutorials = Game.GetFormFromFile(0x00046D91, "Skyrim.esm") as GlobalVariable
ConfigMenuScript._00E_FS_ConfigMenu_Mount_Teleport = Game.GetFormFromFile(0x0102F1B9, "Enderal - Forgotten Stories.esm") as Message
ConfigMenuScript._00E_FS_ConfigMenu_Phasmalist_Teleport = Game.GetFormFromFile(0x0101F2B6, "Enderal - Forgotten Stories.esm") as Message
ConfigMenuScript._00E_FS_IsForgottenStoriesActivated = Game.GetFormFromFile(0x0004320E, "Skyrim.esm") as GlobalVariable
ConfigMenuScript._00E_HorseFlute_New = ((Game.GetFormFromFile(0x000725BA, "Skyrim.esm") as Quest).GetAliasByName("HorseFlute")) as _00E_Horseflute_SC
ConfigMenuScript._00E_VideoSkip = Game.GetFormFromFile(0x0102E985, "Enderal - Forgotten Stories.esm") as GlobalVariable
QuestFunctionsScript.BastionPerks = Game.GetFormFromFile(0x0006686B, "Skyrim.esm") as Formlist
QuestFunctionsScript.DerwishPerks = Game.GetFormFromFile(0x0006686D, "Skyrim.esm") as Formlist
QuestFunctionsScript.ElementalismPerks = Game.GetFormFromFile(0x00066875, "Skyrim.esm") as Formlist
QuestFunctionsScript.EspionagePerks = Game.GetFormFromFile(0x00066889, "Skyrim.esm") as Formlist
QuestFunctionsScript.GameHour = Game.GetFormFromFile(0x00000038, "Skyrim.esm") as GlobalVariable
QuestFunctionsScript.Gold001 = Game.GetFormFromFile(0x0000000f, "Skyrim.esm") as MiscObject
QuestFunctionsScript.LifeAndDeathPerks = Game.GetFormFromFile(0x00066873, "Skyrim.esm") as Formlist
QuestFunctionsScript.MAGIllusionCharm = Game.GetFormFromFile(0x00075805, "Skyrim.esm") as Sound
QuestFunctionsScript.ManipulationPerks = Game.GetFormFromFile(0x0006686A, "Skyrim.esm") as Formlist
QuestFunctionsScript.PlayerSkillMenu = ((Game.GetFormFromFile(0x00010AA2, "Skyrim.esm") as Quest).GetAliasByName("Player") as Alias) as _00E_Game_SkillmenuSC
QuestFunctionsScript.RagePerks = Game.GetFormFromFile(0x00066887, "Skyrim.esm") as Formlist
QuestFunctionsScript.SympathyEsme = Game.GetFormFromFile(0x0102A498, "Enderal - Forgotten Stories.esm") as GlobalVariable
QuestFunctionsScript.TrickeryPerks = Game.GetFormFromFile(0x0006687F, "Skyrim.esm") as Formlist
QuestFunctionsScript.VagabondPerks = Game.GetFormFromFile(0x00066877, "Skyrim.esm") as Formlist
QuestFunctionsScript._00E_AchievementsEnabled = Game.GetFormFromFile(0x00046F83, "Skyrim.esm") as GlobalVariable
QuestFunctionsScript._00E_AllAmmos = Game.GetFormFromFile(0x000456C0, "Skyrim.esm") as Formlist
QuestFunctionsScript._00E_ArmorSetScript_sSetBonusRemoved = Game.GetFormFromFile(0x00036F96, "Skyrim.esm") as Message
QuestFunctionsScript._00E_DisableQuestTutorials = Game.GetFormFromFile(0x00046D92, "Skyrim.esm") as GlobalVariable
QuestFunctionsScript._00E_DisableSkillTutorials = Game.GetFormFromFile(0x00046D91, "Skyrim.esm") as GlobalVariable
QuestFunctionsScript._00E_FS_A3_AlreadyKnowThisLevel = Game.GetFormFromFile(0x0102F533, "Enderal - Forgotten Stories.esm") as Message
QuestFunctionsScript._00E_FS_A3_NeedToLearnOtherLevels = Game.GetFormFromFile(0x0101EC7D, "Enderal - Forgotten Stories.esm") as Message
QuestFunctionsScript._00E_FS_A3_sIn = Game.GetFormFromFile(0x00043BE0, "Skyrim.esm") as Message
QuestFunctionsScript._00E_FS_A3_sMageClassName = Game.GetFormFromFile(0x00043BE4, "Skyrim.esm") as Message
QuestFunctionsScript._00E_FS_A3_sRogueClassName = Game.GetFormFromFile(0x00043BE3, "Skyrim.esm") as Message
QuestFunctionsScript._00E_FS_A3_sToUnlockThisClass = Game.GetFormFromFile(0x00043BE1, "Skyrim.esm") as Message
QuestFunctionsScript._00E_FS_A3_sWarriorClassName = Game.GetFormFromFile(0x00043BE2, "Skyrim.esm") as Message
QuestFunctionsScript._00E_FS_A3_sYouNeedSkillpoints = Game.GetFormFromFile(0x00043BDF, "Skyrim.esm") as Message
QuestFunctionsScript._00E_FS_NQ02_Esme = Game.GetFormFromFile(0x0101F0D0, "Enderal - Forgotten Stories.esm") as ActorBase
QuestFunctionsScript._00E_FS_NQR05_SlowMotionSP = Game.GetFormFromFile(0x0102E2BD, "Enderal - Forgotten Stories.esm") as Spell
QuestFunctionsScript._00E_FS_NQR05_SlowMotion_IntroM = Game.GetFormFromFile(0x0102E2BF, "Enderal - Forgotten Stories.esm") as Sound
QuestFunctionsScript._00E_FS_NQR05_SlowMotion_OutroM = Game.GetFormFromFile(0x0102E2C1, "Enderal - Forgotten Stories.esm") as Sound
QuestFunctionsScript._00E_Levelsystem_sAbilityStanceQyrai = Game.GetFormFromFile(0x00046D9B, "Skyrim.esm") as Message
QuestFunctionsScript._00E_Levelsystem_sAbilityStanceSkaragg = Game.GetFormFromFile(0x00046D9C, "Skyrim.esm") as Message
QuestFunctionsScript._00E_PleaseRemoveMoney = Game.GetFormFromFile(0x000480DA, "Skyrim.esm") as Message
QuestFunctionsScript._00E_RemoveAllItems_TrashContainer = Game.GetFormFromFile(0x000469E7, "Skyrim.esm") as ObjectReference
QuestFunctionsScript._00E_SkillbookWarning = Game.GetFormFromFile(0x00031ACF, "Skyrim.esm") as Message
_00E_Game_SkillmenuSC SkillMenuScript = ((Game.GetFormFromFile(0x00010AA2, "Skyrim.esm") as Quest).GetAliasByName("Player") as Alias) as _00E_Game_SkillmenuSC
SkillMenuScript._00E_FS_Game_Affinity_Spectralist = Game.GetFormFromFile(0x01029A35, "Skyrim.esm") as Message
_00E_PlayerHousing_CellNameSC CellNameScript = ((Game.GetFormFromFile(0x00010AA2, "Skyrim.esm") as Quest).GetAliasByName("Player") as Alias) as _00E_PlayerHousing_CellNameSC
CellNameScript.FS_NQR03 = Game.GetFormFromFile(0x0014CEA2, "Skyrim.esm") as Quest
CellNameScript.FS_NQR03_RhalataTemple = Game.GetFormFromFile(0x0010D1C2, "Skyrim.esm") as Cell
CellNameScript._00E_sPlayerHouseMarketQuarterName = Game.GetFormFromFile(0x00047CA5, "Skyrim.esm") as Message
CellNameScript._00E_sPlayerHouseNobleQuarterName = Game.GetFormFromFile(0x00047CA6, "Skyrim.esm") as Message
CellNameScript._00E_sRhalataTempleName = Game.GetFormFromFile(0x00047C29, "Skyrim.esm") as Message
_00E_WeatherControlScriptSC WeatherControlScript = ((Game.GetFormFromFile(0x00010AA2, "Skyrim.esm") as Quest).GetAliasByName("Player") as Alias) as _00E_WeatherControlScriptSC
WeatherControlScript.CapitalCityCastleWorld = Game.GetFormFromFile(0x00070729, "Skyrim.esm") as WorldSpace
WeatherControlScript.CapitalCityLocation = Game.GetFormFromFile(0x000A1A12, "Skyrim.esm") as Location
WeatherControlScript.MQ09 = Game.GetFormFromFile(0x0007FA91, "Skyrim.esm") as Quest
WeatherControlScript.MQ12b = Game.GetFormFromFile(0x0002EBAD, "Skyrim.esm") as Quest
WeatherControlScript.MQ17 = Game.GetFormFromFile(0x0007FA93, "Skyrim.esm") as Quest
WeatherControlScript.SkyrimOvercastRain = Game.GetFormFromFile(0x000C821F, "Skyrim.esm") as Weather
WeatherControlScript.Vyn = Game.GetFormFromFile(0x00001D3C, "Skyrim.esm") as WorldSpace
WeatherControlScript._00E_EnderalOvercast = Game.GetFormFromFile(0x00072785, "Skyrim.esm") as Weather
WeatherControlScript._00E_MQ11c_SilberhainDeadWeather = Game.GetFormFromFile(0x00096807, "Skyrim.esm") as GlobalVariable
WeatherControlScript._00E_SuntempleLocations = Game.GetFormFromFile(0x0003BB5B, "Skyrim.esm") as FormList
Utility.Wait(1)
Debug.Messagebox("Scripts fixed. Make sure to save the game. Restart the client and reload the save that you just created.\n If you have set items equipped, unequip them all and re-equip them for potential set bonuses to apply.")
Debug.MessageBox("A savegame was loaded which was made before the release of Enderal SE. In this save, several new features won't be available and there is a chance that you'll encounter grave bugs. Please, start a new game.")