Scriptname nUpdateQST extends Quest  

bool essVal=false

GlobalVariable Property isPermanent  Auto  
GlobalVariable Property iESSEnabled  Auto  
GlobalVariable Property fCellSettings  Auto  
GlobalVariable Property fDBSettings  Auto 
GlobalVariable Property fDSSettings  Auto 

function ResetDataOnLoad()
	SetTempSettings()
	if iESSEnabled.GetValueInt() == 1
		essVal = true
	else
		essVal = false
		return
	endif
	(Game.GetForm(0x0001D4B7) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001C3AB) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013614) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001361E) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001361F) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001361D) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013621) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013655) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0003A19A) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013652) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001364D) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013650) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000133A5) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000133A2) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0009A7A8) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001338F) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0003F21E) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000133AD) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001338E) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001339A) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00055A5E) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000133B2) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000133A3) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001E765) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000D6703) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013395) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001338B) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000135E9) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000135EF) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000135ED) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013365) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013373) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001B072) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013357) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013360) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013349) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00019DEF) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001334D) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013354) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001CB78) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013351) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013371) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00019DF2) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001334C) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00029DAD) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00029DAE) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001336D) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013380) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001CD90) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001CD91) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00029DAA) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00029DAF) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001CD8F) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001334F) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000136C5) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001335F) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001337E) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000B8827) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013255) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013260) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000132AE) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001329A) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013274) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000132AA) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013299) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013273) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013275) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001328C) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013261) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001327D) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0009B7A6) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013266) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000132A7) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000132AB) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013284) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013BAA) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013BA4) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013BA3) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013BA2) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013BA1) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013B99) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013B97) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013B9E) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0002BA8C) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001328C) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013B9D) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013B9C) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001A696) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001A6D5) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001A692) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001A6D9) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001A694) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013BA5) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013BBB) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013BBA) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013BB9) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013B9F) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013669) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013BB7) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013BAB) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0002BA8E) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00014140) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00014142) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00014121) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00014135) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00014146) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001411F) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001413A) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001413F) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001412A) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001413E) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00014148) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00014141) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0009B7AB) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001C187) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001C193) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001C19C) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001C19E) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001C19A) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001C198) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001C197) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001C199) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001C23E) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001E7D5) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001C183) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00019A28) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000136BB) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013475) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013480) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001347B) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001347A) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013478) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013479) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000136B6) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000136C3) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013B79) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013B7C) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013B7A) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00019E18) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00019951) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00019953) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00019957) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001B076) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001B079) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001B1DB) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001B1D9) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001B1D6) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001B1CF) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001B1D1) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001B1D5) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000B9981) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00065657) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000350A7) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000B9982) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000B9980) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000B9983) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000B997F) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000A2C8C) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000A2C90) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000A2C91) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000A2C8F) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000A2C8E) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000A2C8C) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001A6D7) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001A6DB) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001C196) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001C195) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001C194) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0009BCAF) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00015CFA) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00015CFE) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001411D) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001325F) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013666) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00028AD0) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000135E8) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00019959) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013390) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001403E) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001990F) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00013B81) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001B1D2) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00019E1E) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001336B) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00019E22) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001403F) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0001347F) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00019E1A) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x000D95E9) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x0009A7AA) as ActorBase).SetEssential(essVal)
	(Game.GetForm(0x00109487) as ActorBase).SetEssential(essVal)
endfunction

function SetTempSettings()
	If isPermanent.GetValueInt() == 0
		return
	endif
	Game.SetGameSettingInt("iHoursToRespawnCell", fCellSettings.GetValueInt())
	Game.getForm(0x003ADA4).SetWeight(fDBSettings.Value)
	Game.getForm(0x003ADA3).SetWeight(fDSSettings.Value)
endfunction