Scriptname SuH_MCM extends SKI_ConfigBase

;ent/ Variables / Objects
Actor Property PlayerAlias auto
Actor Property PlayerRef Auto

GlobalVariable Property SuH_SETallowdrainkill auto
GlobalVariable Property SuH_PCScaphealth auto
GlobalVariable Property SuH_PCScapmagicka auto
GlobalVariable Property SuH_PCScapstamina auto
GlobalVariable Property SuH_PCSdesire auto
GlobalVariable Property SuH_PCSxp auto
GlobalVariable Property SuH_PCSxpgain auto
GlobalVariable Property SuH_PCSabsorbhealth auto
GlobalVariable Property SuH_PCSabsorbmagicka auto
GlobalVariable Property SuH_PCSabsorbstamina auto
GlobalVariable Property SuH_PCSspermhealth auto
GlobalVariable Property SuH_PCSspermmagicka auto
GlobalVariable Property SuH_PCSspermstamina auto
GlobalVariable Property SuH_PCSmilkhealth auto
GlobalVariable Property SuH_PCSmilkmagicka auto
GlobalVariable Property SuH_PCSmilkstamina auto
GlobalVariable Property SuH_PCSstackmaxsex auto
GlobalVariable Property SuH_PCSstackmaxsperm auto
GlobalVariable Property SuH_PCSstackmaxmilk auto
GlobalVariable Property SuH_PCSstacksex auto
GlobalVariable Property SuH_PCSstacksperm auto
GlobalVariable Property SuH_PCSstackmilk auto
GlobalVariable Property SuH_PCSsp auto
GlobalVariable Property SuH_PCSspearned auto
GlobalVariable Property SuH_PCSforce auto
GlobalVariable Property SuH_SETcombatseduction auto

;status
int status_health
int status_magicka
int status_stamina
int status_desire
int status_xp
int status_xpgain
int status_stacksex
int status_stacksperm
int status_stackmilk
int status_SETdrainkill
int status_SETcombatseduction

;skill
int skill_sp
int skill_spnext
int skill_xp
int skill_convert
int skill_alchemy
int skill_alteration
int skill_block
int skill_conjuration
int skill_destruction
int skill_enchanting
int skill_heavyarmor
int skill_illusion
int skill_lightarmor
int skill_lockpicking
int skill_marksman
int skill_onehanded
int skill_pickpocket
int skill_restoration
int skill_smithing
int skill_sneak
int skill_speechcraft
int skill_twohanded

;heart
int heart_caphealth
int heart_capmagicka
int heart_capstamina
int heart_absorbhealth
int heart_absorbmagicka
int heart_absorbstamina
int heart_spermhealth
int heart_spermmagicka
int heart_spermstamina
int heart_milkhealth
int heart_milkmagicka
int heart_milkstamina
int heart_stacksex
int heart_stacksperm
int heart_stackmilk
int heart_xp

;apell

;pet

;item

;help

;end/

;ent/ Init
Event OnConfigInit()
	ModName = "Succubus Heart"
	Pages = new string[7]
		Pages[0] = "Status / Settings"
		Pages[2] = "Skill Levels"
		Pages[1] = "Heart Levels"
		Pages[3] = "Spells / Passives"
		Pages[5] = "Pets / Summons"
		Pages[4] = "Items / Sacrifice"
		Pages[6] = "Help"
endEvent
;end/

;ent/ OnPageReser
Event OnPageReset(string page)
	;ent/ Initial Page
	if (page == "");
		return
	else
	endIf
	;end/
	;ent/ Status / Settings
	if (page == "Status / Settings")
		SetCursorFillMode(TOP_TO_BOTTOM)
		
		;ent/ Menu Layout
		; [ Status ]           [ Status ]
		; Player Health             Desire
		; Player Magicka            XP
		; Player Stamina            XP Gain
		; 
		; [ General Settings]       [ General Settings ]
		; Allow Drain to Kill
		;
		;
		;
		;
		;
		;end/
		
		;ent/ Variables
		int playerHealth = PlayerRef.GetBaseActorValue("health") as int
		int playerMagicka = PlayerRef.GetBaseActorValue("magicka") as int
		int playerStamina = PlayerRef.GetBaseActorValue("stamina") as int
		int healthCap = SuH_PCScaphealth.GetValue() as int
		int magickaCap = SuH_PCScapmagicka.GetValue() as int
		int staminaCap = SuH_PCScapstamina.GetValue() as int
		int desireV = SuH_PCSdesire.GetValue() as int
		int XP = SuH_PCSxp.GetValue() as int
		int XPgain = SuH_PCSxpgain.GetValue() as int
		int XPgainV = XPgain*100
		int stacksex = SuH_PCSstacksex.GetValue() as int
		int stacksperm = SuH_PCSstacksperm.GetValue() as int
		int stackmilk = SuH_PCSstackmilk.GetValue() as int
		int stackmaxsex = SuH_PCSstackmaxsex.GetValue() as int
		int stackmaxsperm = SuH_PCSstackmaxsperm.GetValue() as int
		int stackmaxmilk = SuH_PCSstackmaxmilk.GetValue() as int
		bool SETdrainkill = SuH_SETallowdrainkill.GetValue() as bool
		bool SETcombatseduction = SuH_SETcombatseduction.GetValue() as bool
		;end/
		
		;ent/ Left Side
		SetCursorPosition(0)
		AddHeaderOption("Status ")
		status_health = AddTextOption("Health ", playerHealth+"/"+healthCap)
		status_magicka = AddTextOption("Magicka ", playerMagicka+"/"+magickaCap)
		status_stamina = AddTextOption("Stamina ", playerStamina+"/"+staminaCap)
		status_stacksex = AddTextOption("Sex Stacks", stacksex+"/"+stackmaxsex)
		status_stacksperm = AddTextOption("Sperm Stacks", stacksperm+"/"+stackmaxsperm)
		status_stackmilk = AddTextOption("Milk Stacks", stackmilk+"/"+stackmaxmilk)
		AddEmptyOption()
		AddHeaderOption("General Options")
		status_SETdrainkill = AddToggleOption("Allow Drain to Kill", SETdrainkill)
		;end/
		
		;ent/ Right Side
		SetCursorPosition(1)
		AddHeaderOption("Status ")
		status_desire = AddTextOption("Desire ", desireV)
		status_xp = AddTextOption("XP ", XP)
		status_xpgain = AddTextOption("XP Gain ", XPgainV+"%")
		AddEmptyOption()
		AddEmptyOption()
		AddEmptyOption()
		AddEmptyOption()
		AddHeaderOption("General Options ")
		status_SETcombatseduction = AddToggleOption("Combat Seduction", SETcombatseduction)
		;end/
	;end/
	;ent/ Skill Levels
	elseIf (page == "Skill Levels")
		;ent/ Variables
			int alchemylvl = playerRef.GetActorValue("alchemy") as int
			int alchemycost = Math.Ceiling(alchemylvl*0.1)
			int alterationlvl = playerRef.GetActorValue("alteration") as int
			int alterationcost = Math.Ceiling(alterationlvl*0.1)
			int blocklvl = playerRef.GetActorValue("block") as int
			int blockcost = Math.Ceiling(blocklvl*0.1)
			int conjurationlvl = playerRef.GetActorValue("conjuration") as int
			int conjurationcost = Math.Ceiling(conjurationlvl*0.1)
			int destructionlvl = playerRef.GetActorValue("destruction") as int
			int destructioncost = Math.Ceiling(destructionlvl*0.1)
			int enchantinglvl = playerRef.GetActorValue("enchanting") as int
			int enchantingcost = Math.Ceiling(enchantinglvl*0.1)
			int heavyarmorlvl = playerRef.GetActorValue("heavyarmor") as int
			int heavyarmorcost = Math.Ceiling(heavyarmorlvl*0.1)
			int illusionlvl = playerRef.GetActorValue("illusion") as int
			int illusioncost = Math.Ceiling(illusionlvl*0.1)
			int lightarmorlvl = playerRef.GetActorValue("lightarmor") as int
			int lightarmorcost = Math.Ceiling(lightarmorlvl*0.1)
			int lockpickinglvl = playerRef.GetActorValue("lockpicking") as int
			int lockpickingcost = Math.Ceiling(lockpickinglvl*0.1)
			int marksmanlvl = playerRef.GetActorValue("marksman") as int
			int marksmancost = Math.Ceiling(marksmanlvl*0.1)
			int onehandedlvl = playerRef.GetActorValue("onehanded") as int
			int onehandedcost = Math.Ceiling(onehandedlvl*0.1)
			int pickpocketlvl = playerRef.GetActorValue("pickpocket") as int
			int pickpocketcost = Math.Ceiling(pickpocketlvl*0.1)
			int restorationlvl = playerRef.GetActorValue("restoration") as int
			int restorationcost = Math.Ceiling(restorationlvl*0.1)
			int smithinglvl = playerRef.GetActorValue("smithing") as int
			int smithingcost = Math.Ceiling(smithinglvl*0.1)
			int sneaklvl = playerRef.GetActorValue("sneak") as int
			int sneakcost = Math.Ceiling(sneaklvl*0.1)
			int speechcraftlvl = playerRef.GetActorValue("speechcraft") as int
			int speechcraftcost = Math.Ceiling(speechcraftlvl*0.1)
			int twohandedlvl = playerRef.GetActorValue("twohanded") as int
			int twohandedcost = Math.Ceiling(twohandedlvl*0.1)
		;end/
		;ent/ SP calculation
			int xp = SuH_PCSxp.GetValue() as int
			int force = SuH_PCSforce.GetValue() as int
			int sp = SuH_PCSsp.GetValue() as int
			int spearned = SuH_PCSspearned.GetValue() as int
			int spcost = Math.Floor(spearned*0.2*120+20)
			if force >= spcost
				int x = 0
				int y = 0
				int z = 0
				int forceSpent = 0
				int spgained = 0
				int newcost = 0
				int i = 0
				while i != 1
					x = force - forceSpent
					y = spearned + spgained
					newcost = Math.Floor(y*0.2*120)
					if x >= newcost
						forceSpent += newcost
						spgained += 1
					else
						z = sp + spgained
						SuH_PCSforce.SetValue(x)
						SuH_PCSspearned.SetValue(y)
						SuH_PCSsp.SetValue(z)
						debug.MessageBox(spgained+" SP was earned")
						i = 1
					endIf
				endWhile
				xp = SuH_PCSxp.GetValue() as int
				force = SuH_PCSforce.GetValue() as int
				sp = SuH_PCSsp.GetValue() as int
				spearned = SuH_PCSspearned.GetValue() as int
				spcost = Math.Floor(spearned*0.2*120+20)
			endIf
		;end/
		SetCursorFillMode(TOP_TO_BOTTOM)
		
		;ent/ Menu Layout
		;
		;
		;
		;
		;
		;
		;
		;
		;
		;
		;end/
		
		;ent/ Left Side
		SetCursorPosition(0)
		skill_sp = AddTextOption("Skill Points", sp)
		skill_spnext = AddTextOption("Till Next Skill Point", spcost+" Force")
		AddHeaderOption("Level Skills")
		skill_alchemy = AddTextOption("Alchemy ", alchemylvl+" ["+alchemycost+" SP]")
		skill_block = AddTextOption("Block ", blocklvl+" ["+blockcost+" SP]")
		skill_destruction = AddTextOption("Destruction ", destructionlvl+" ["+destructioncost+" SP]")
		skill_heavyarmor = AddTextOption("Heavy Armor ", heavyarmorlvl+" ["+heavyarmorcost+" SP]")
		skill_lightarmor = AddTextOption("Light Armor ", lightarmorlvl+" ["+lightarmorcost+" SP]")
		skill_marksman = AddTextOption("Marksman ", marksmanlvl+" ["+marksmancost+" SP]")
		skill_pickpocket = AddTextOption("Pickpocket ", pickpocketlvl+" ["+pickpocketcost+" SP]")
		skill_smithing = AddTextOption("Smithing ", smithinglvl+" ["+smithingcost+" SP]")
		skill_speechcraft = AddTextOption("Speechcraft ", speechcraftlvl+" ["+speechcraftcost+" SP]")
		;end/
		;ent/ Right Side
		SetCursorPosition(1)
		skill_xp = AddTextOption("XP available", xp)
		skill_convert = AddTextOption("Convert XP currently disabled", " ")
		AddHeaderOption("Level Skills")
		skill_alteration = AddTextOption("Alteration ", alterationlvl+" ["+alterationcost+" SP]")
		skill_conjuration = AddTextOption("Conjuration ", conjurationlvl+" ["+conjurationcost+" SP]")
		skill_enchanting = AddTextOption("Enchanting ", enchantinglvl+" ["+enchantingcost+" SP]")
		skill_illusion = AddTextOption("Illusion ", illusionlvl+" ["+illusioncost+" SP]")
		skill_lockpicking = AddTextOption("Lockpicking ", lockpickinglvl+" ["+lockpickingcost+" SP]")
		skill_onehanded = AddTextOption("One-Handed ", onehandedlvl+" ["+onehandedcost+" SP]")
		skill_restoration = AddTextOption("Restoration ", restorationlvl+" ["+restorationcost+" SP]")
		skill_sneak = AddTextOption("Sneak ", sneaklvl+" ["+sneakcost+" SP]")
		skill_twohanded = AddTextOption("Two-Handed ", twohandedlvl+" ["+twohandedcost+" SP]")
		;end/
	;end/
	;ent/ Heart Levels
	elseIf (page == "Heart Levels")
		
		;ent/ Menu Layout
		;
		;[ Heart Levels ]        [ Heart Levels ]
		;
		;
		;
		;
		;
		;
		;
		;
		;end/
		
		;ent/ Variables
		int caphealth = SuH_PCScaphealth.GetValue() as int
		int caphealthcost = Math.Floor((caphealth - 99)*1.8*80)
		int capmagicka = SuH_PCScapmagicka.GetValue() as int
		int capmagickacost = Math.Floor((capmagicka - 99)*1.8*80)
		int capstamina = SuH_PCScapstamina.GetValue() as int
		int capstaminacost = Math.Floor((capstamina - 99)*1.8*80)
		int absorbhealth = SuH_PCSabsorbhealth.GetValue() as int
		int absorbhealthcost = Math.Floor(absorbhealth*1.2*200)
		int absorbmagicka = SuH_PCSabsorbmagicka.GetValue() as int
		int absorbmagickacost = Math.Floor(absorbmagicka*1.2*200)
		int absorbstamina = SuH_PCSabsorbstamina.GetValue() as int
		int absorbstaminacost = Math.Floor(absorbstamina*1.2*200)
		int stacksex = SuH_PCSstackmaxsex.GetValue() as int
		int stacksexcost = Math.Floor(stacksex*2.2*240)
		int stacksperm = SuH_PCSstackmaxsperm.GetValue() as int
		int stackspermcost = Math.Floor(stacksperm*2.2*240)
		int stackmilk = SuH_PCSstackmaxmilk.GetValue() as int
		int stackmilkcost = Math.Floor(stackmilk*2.2*240)
		int spermhealth = SuH_PCSspermhealth.GetValue() as int
		int spermhealthcost = Math.Floor(spermhealth*1.4*200)
		int spermmagicka = SuH_PCSspermmagicka.GetValue() as int
		int spermmagickacost = Math.Floor(spermmagicka*1.4*200)
		int spermstamina = SuH_PCSspermstamina.GetValue() as int
		int spermstaminacost = Math.Floor(spermstamina*1.4*200)
		int milkhealth = SuH_PCSmilkhealth.GetValue() as int
		int milkhealthcost = Math.Floor(milkhealth*1.4*200)
		int milkmagicka = SuH_PCSmilkmagicka.GetValue() as int
		int milkmagickacost = Math.Floor(milkmagicka*1.4*200)
		int milkstamina = SuH_PCSmilkstamina.GetValue() as int
		int milkstaminacost = Math.Floor(milkstamina*1.4*200)
		int xp = SuH_PCSxp.GetValue() as int
		;end/
	
		SetCursorFillMode(TOP_TO_BOTTOM)
		;ent/ Left Side
		SetCursorPosition(0)
		heart_xp = AddTextOption("XP available", xp)
		AddHeaderOption("Heart Levels")
		heart_caphealth = AddTextOption("Health Cap", caphealth+" ["+caphealthcost+" XP]")
		heart_capmagicka = AddTextOption("Magicka Cap", capmagicka+" ["+capmagickacost+" XP]")
		heart_capstamina = AddTextOption("Stamina Cap", capstamina+" ["+capstaminacost+" XP]")
		AddEmptyOption()
		heart_stacksex = AddTextOption("Max Sex Stacks", stacksex+" ["+stacksexcost+" XP]")
		heart_stacksperm = AddTextOption("Max Sperm Stacks", stacksperm+" ["+stackspermcost+" XP]")
		heart_stackmilk = AddTextOption("Max Milk Stacks", stackmilk+" ["+stackmilkcost+" XP]")
		AddEmptyOption()
		AddEmptyOption()
		AddEmptyOption()
		AddEmptyOption()
		;end/
		;ent/ Right Side
		SetCursorPosition(1)
		AddEmptyOption()
		AddHeaderOption("Heart Levels")
		heart_absorbhealth = AddTextOption("Health Absorption", absorbhealth+" ["+absorbhealthcost+" XP]")
		heart_absorbmagicka = AddTextOption("Magicka Absorption", absorbmagicka+" ["+absorbmagickacost+" XP]")
		heart_absorbstamina = AddTextOption("Stamina Absorption", absorbstamina+" ["+absorbstaminacost+" XP]")
		AddEmptyOption()
		heart_spermhealth = AddTextOption("Sperm Health Bonus", spermhealth+" ["+spermhealthcost+" XP]")
		heart_spermmagicka = AddTextOption("Sperm Magicka Bonus", spermmagicka+" ["+spermmagickacost+" XP]")
		heart_spermstamina = AddTextOption("Sperm Stamina Bonus", spermstamina+" ["+spermstaminacost+" XP]")
		AddEmptyOption()
		heart_milkhealth = AddTextOption("Milk Health Bonus", milkhealth+" ["+milkhealthcost+" XP]")
		heart_milkmagicka = AddTextOption("Milk Magicka Bonus", milkmagicka+" ["+milkmagickacost+" XP]")
		heart_milkstamina = AddTextOption("Milk Stamina Bonus", milkstamina+" ["+milkstaminacost+" XP]")
		;
		;end/
	;end/
	;ent/ Spells / Passives
	elseIf (page == "Spells / Passives")
	;end/
	;ent/ Pets / Summons
	elseIf (page == "Pets / Summons")
	;end/
	;ent/ Items / Sacrifice
	elseIf (page == "Items / Sacrifice")
	;end/
	;ent/ Help
	elseIf (page == "Help")
	;end/
	endIf
endEvent
;end/
;ent/ OnOptionSelect
Event OnOptionSelect(int option)
	;ent/ Status / Settings
	if(CurrentPage == "Status / Settings")
		if(option == status_SETdrainkill)
			if SuH_SETallowdrainkill.GetValue()
				SuH_SETallowdrainkill.SetValue(0)
				SetToggleOptionValue(status_SETdrainkill, FALSE)
			else
				SuH_SETallowdrainkill.SetValue(1)
				SetToggleOptionValue(status_SETdrainkill, TRUE)
			endIf
		endIf
		if(option == status_SETcombatseduction)
			if SuH_SETcombatseduction.GetValue()
				SuH_SETcombatseduction.SetValue(0)
				SetToggleOptionValue(status_SETcombatseduction, FALSE)
			else
				SuH_SETcombatseduction.SetValue(1)
				SetToggleOptionValue(status_SETcombatseduction, TRUE)
			endIf
		endIf
	;end/
	;ent/ Skill Levels
	elseIf(CurrentPage == "Skill Levels")
		if(option == skill_alchemy)
			int sp = SuH_PCSsp.GetValue() as int
			int alchemylvl = playerRef.GetActorValue("alchemy") as int
			int alchemycost = Math.Ceiling(alchemylvl*0.1)
			if sp >= alchemycost
				sp =- alchemycost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("Alchemy")
				alchemylvl = playerRef.GetActorValue("alchemy") as int
				alchemycost = Math.Ceiling(alchemylvl*0.1)
				SetTextOptionValue(skill_alchemy, alchemylvl+" ["+alchemycost+" SP]")
			endIf
		elseif(option == skill_alteration)
			int sp = SuH_PCSsp.GetValue() as int
			int alterationlvl = playerRef.GetActorValue("alteration") as int
			int alterationcost = Math.Ceiling(alterationlvl*0.1)
			if sp >= alterationcost
				sp =- alterationcost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("alteration")
				alterationlvl = playerRef.GetActorValue("alteration") as int
				alterationcost = Math.Ceiling(alterationlvl*0.1)
				SetTextOptionValue(skill_alteration, alterationlvl+" ["+alterationcost+" SP]")
			endIf
		elseif(option == skill_block)
			int sp = SuH_PCSsp.GetValue() as int
			int blocklvl = playerRef.GetActorValue("block") as int
			int blockcost = Math.Ceiling(blocklvl*0.1)
			if sp >= blockcost
				sp =- blockcost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("block")
				blocklvl = playerRef.GetActorValue("block") as int
				blockcost = Math.Ceiling(blocklvl*0.1)
				SetTextOptionValue(skill_block, blocklvl+" ["+blockcost+" SP]")
			endIf
		elseif(option == skill_conjuration)
			int sp = SuH_PCSsp.GetValue() as int
			int conjurationlvl = playerRef.GetActorValue("conjuration") as int
			int conjurationcost = Math.Ceiling(conjurationlvl*0.1)
			if sp >= conjurationcost
				sp =- conjurationcost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("conjuration")
				conjurationlvl = playerRef.GetActorValue("conjuration") as int
				conjurationcost = Math.Ceiling(conjurationlvl*0.1)
				SetTextOptionValue(skill_conjuration, conjurationlvl+" ["+conjurationcost+" SP]")
			endIf
		elseif(option == skill_destruction)
			int sp = SuH_PCSsp.GetValue() as int
			int destructionlvl = playerRef.GetActorValue("destruction") as int
			int destructioncost = Math.Ceiling(destructionlvl*0.1)
			if sp >= destructioncost
				sp =- destructioncost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("destruction")
				destructionlvl = playerRef.GetActorValue("destruction") as int
				destructioncost = Math.Ceiling(destructionlvl*0.1)
				SetTextOptionValue(skill_destruction, destructionlvl+" ["+destructioncost+" SP]")
			endIf
		elseif(option == skill_enchanting)
			int sp = SuH_PCSsp.GetValue() as int
			int enchantinglvl = playerRef.GetActorValue("enchanting") as int
			int enchantingcost = Math.Ceiling(enchantinglvl*0.1)
			if sp >= enchantingcost
				sp =- enchantingcost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("enchanting")
				enchantinglvl = playerRef.GetActorValue("enchanting") as int
				enchantingcost = Math.Ceiling(enchantinglvl*0.1)
				SetTextOptionValue(skill_enchanting, enchantinglvl+" ["+enchantingcost+" SP]")
			endIf
		elseif(option == skill_heavyarmor)
			int sp = SuH_PCSsp.GetValue() as int
			int heavyarmorlvl = playerRef.GetActorValue("heavyarmor") as int
			int heavyarmorcost = Math.Ceiling(heavyarmorlvl*0.1)
			if sp >= heavyarmorcost
				sp =- heavyarmorcost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("heavyarmor")
				heavyarmorlvl = playerRef.GetActorValue("heavyarmor") as int
				heavyarmorcost = Math.Ceiling(heavyarmorlvl*0.1)
				SetTextOptionValue(skill_heavyarmor, heavyarmorlvl+" ["+heavyarmorcost+" SP]")
			endIf
		elseif(option == skill_illusion)
			int sp = SuH_PCSsp.GetValue() as int
			int illusionlvl = playerRef.GetActorValue("illusion") as int
			int illusioncost = Math.Ceiling(illusionlvl*0.1)
			if sp >= illusioncost
				sp =- illusioncost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("illusion")
				illusionlvl = playerRef.GetActorValue("illusion") as int
				illusioncost = Math.Ceiling(illusionlvl*0.1)
				SetTextOptionValue(skill_illusion, illusionlvl+" ["+illusioncost+" SP]")
			endIf
		elseif(option == skill_lightarmor)
			int sp = SuH_PCSsp.GetValue() as int
			int lightarmorlvl = playerRef.GetActorValue("lightarmor") as int
			int lightarmorcost = Math.Ceiling(lightarmorlvl*0.1)
			if sp >= lightarmorcost
				sp =- lightarmorcost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("lightarmor")
				lightarmorlvl = playerRef.GetActorValue("lightarmor") as int
				lightarmorcost = Math.Ceiling(lightarmorlvl*0.1)
				SetTextOptionValue(skill_lightarmor, lightarmorlvl+" ["+lightarmorcost+" SP]")
			endIf
		elseif(option == skill_lockpicking)
			int sp = SuH_PCSsp.GetValue() as int
			int lockpickinglvl = playerRef.GetActorValue("lockpicking") as int
			int lockpickingcost = Math.Ceiling(lockpickinglvl*0.1)
			if sp >= lockpickingcost
				sp =- lockpickingcost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("lockpicking")
				lockpickinglvl = playerRef.GetActorValue("lockpicking") as int
				lockpickingcost = Math.Ceiling(lockpickinglvl*0.1)
				SetTextOptionValue(skill_lockpicking, lockpickinglvl+" ["+lockpickingcost+" SP]")
			endIf
		elseif(option == skill_marksman)
			int sp = SuH_PCSsp.GetValue() as int
			int marksmanlvl = playerRef.GetActorValue("marksman") as int
			int marksmancost = Math.Ceiling(marksmanlvl*0.1)
			if sp >= marksmancost
				sp =- marksmancost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("marksman")
				marksmanlvl = playerRef.GetActorValue("marksman") as int
				marksmancost = Math.Ceiling(marksmanlvl*0.1)
				SetTextOptionValue(skill_marksman, marksmanlvl+" ["+marksmancost+" SP]")
			endIf
		elseif(option == skill_onehanded)
			int sp = SuH_PCSsp.GetValue() as int
			int onehandedlvl = playerRef.GetActorValue("onehanded") as int
			int onehandedcost = Math.Ceiling(onehandedlvl*0.1)
			if sp >= onehandedcost
				sp =- onehandedcost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("onehanded")
				onehandedlvl = playerRef.GetActorValue("onehanded") as int
				onehandedcost = Math.Ceiling(onehandedlvl*0.1)
				SetTextOptionValue(skill_onehanded, onehandedlvl+" ["+onehandedcost+" SP]")
			endIf
		elseif(option == skill_pickpocket)
			int sp = SuH_PCSsp.GetValue() as int
			int pickpocketlvl = playerRef.GetActorValue("pickpocket") as int
			int pickpocketcost = Math.Ceiling(pickpocketlvl*0.1)
			if sp >= pickpocketcost
				sp =- pickpocketcost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("pickpocket")
				pickpocketlvl = playerRef.GetActorValue("pickpocket") as int
				pickpocketcost = Math.Ceiling(pickpocketlvl*0.1)
				SetTextOptionValue(skill_pickpocket, pickpocketlvl+" ["+pickpocketcost+" SP]")
			endIf
		elseif(option == skill_restoration)
			int sp = SuH_PCSsp.GetValue() as int
			int restorationlvl = playerRef.GetActorValue("restoration") as int
			int restorationcost = Math.Ceiling(restorationlvl*0.1)
			if sp >= restorationcost
				sp =- restorationcost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("restoration")
				restorationlvl = playerRef.GetActorValue("restoration") as int
				restorationcost = Math.Ceiling(restorationlvl*0.1)
				SetTextOptionValue(skill_restoration, restorationlvl+" ["+restorationcost+" SP]")
			endIf
		elseif(option == skill_smithing)
			int sp = SuH_PCSsp.GetValue() as int
			int smithinglvl = playerRef.GetActorValue("smithing") as int
			int smithingcost = Math.Ceiling(smithinglvl*0.1)
			if sp >= smithingcost
				sp =- smithingcost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("smithing")
				smithinglvl = playerRef.GetActorValue("smithing") as int
				smithingcost = Math.Ceiling(smithinglvl*0.1)
				SetTextOptionValue(skill_smithing, smithinglvl+" ["+smithingcost+" SP]")
			endIf
		elseif(option == skill_sneak)
			int sp = SuH_PCSsp.GetValue() as int
			int sneaklvl = playerRef.GetActorValue("sneak") as int
			int sneakcost = Math.Ceiling(sneaklvl*0.1)
			if sp >= sneakcost
				sp =- sneakcost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("sneak")
				sneaklvl = playerRef.GetActorValue("sneak") as int
				sneakcost = Math.Ceiling(sneaklvl*0.1)
				SetTextOptionValue(skill_sneak, sneaklvl+" ["+sneakcost+" SP]")
			endIf
		elseif(option == skill_speechcraft)
			int sp = SuH_PCSsp.GetValue() as int
			int speechcraftlvl = playerRef.GetActorValue("speechcraft") as int
			int speechcraftcost = Math.Ceiling(speechcraftlvl*0.1)
			if sp >= speechcraftcost
				sp =- speechcraftcost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("speechcraft")
				speechcraftlvl = playerRef.GetActorValue("speechcraft") as int
				speechcraftcost = Math.Ceiling(speechcraftlvl*0.1)
				SetTextOptionValue(skill_speechcraft, speechcraftlvl+" ["+speechcraftcost+" SP]")
			endIf
		elseif(option == skill_twohanded)
			int sp = SuH_PCSsp.GetValue() as int
			int twohandedlvl = playerRef.GetActorValue("twohanded") as int
			int twohandedcost = Math.Ceiling(twohandedlvl*0.1)
			if sp >= twohandedcost
				sp =- twohandedcost
				SuH_PCSsp.SetValue(sp)
				Game.IncrementSkill("twohanded")
				twohandedlvl = playerRef.GetActorValue("twohanded") as int
				twohandedcost = Math.Ceiling(twohandedlvl*0.1)
				SetTextOptionValue(skill_twohanded, twohandedlvl+" ["+twohandedcost+" SP]")
			endIf
		endIf
	;end/
	;ent/ Heart Levels
	elseIf(CurrentPage == "Heart Levels")
		if(option == heart_caphealth)
			int xp = SuH_PCSxp.GetValue() as int
			int caphealth = SuH_PCScaphealth.GetValue() as int
			int caphealthcost = Math.Floor((caphealth - 99)*1.8*80)
			if xp >= caphealthcost
				xp -= caphealthcost
				SuH_PCSxp.SetValue(xp)
				SuH_PCScaphealth.SetValue(caphealth+1)
				caphealth = SuH_PCScaphealth.GetValue() as int
				caphealthcost = Math.Floor((caphealth - 99)*1.8*80)
				SetTextOptionValue(heart_caphealth, caphealth+" ["+caphealthcost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		elseif(option == heart_capmagicka)
			int xp = SuH_PCSxp.GetValue() as int
			int capmagicka = SuH_PCScapmagicka.GetValue() as int
			int capmagickacost = Math.Floor((capmagicka - 99)*1.8*80)
			if xp >= capmagickacost
				xp -= capmagickacost
				SuH_PCSxp.SetValue(xp)
				SuH_PCScapmagicka.SetValue(capmagicka+1)
				capmagicka = SuH_PCScapmagicka.GetValue() as int
				capmagickacost = Math.Floor((capmagicka - 99)*1.8*80)
				SetTextOptionValue(heart_capmagicka, capmagicka+" ["+capmagickacost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		elseif(option == heart_capstamina)
			int xp = SuH_PCSxp.GetValue() as int
			int capstamina = SuH_PCScapstamina.GetValue() as int
			int capstaminacost = Math.Floor((capstamina - 99)*1.8*80)
			if xp >= capstaminacost
				xp -= capstaminacost
				SuH_PCSxp.SetValue(xp)
				SuH_PCScapstamina.SetValue(capstamina+1)
				capstamina = SuH_PCScapstamina.GetValue() as int
				capstaminacost = Math.Floor((capstamina - 99)*1.8*80)
				SetTextOptionValue(heart_capstamina, capstamina+" ["+capstaminacost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		elseif(option == heart_stacksex)
			int xp = SuH_PCSxp.GetValue() as int
			int stacksex = SuH_PCSstackmaxsex.GetValue() as int
			int stacksexcost = Math.Floor(stacksex*2.2*240)
			if xp >= stacksexcost
				xp -= stacksexcost
				SuH_PCSxp.SetValue(xp)
				SuH_PCSstackmaxsex.SetValue(stacksex+1)
				stacksex = SuH_PCSstackmaxsex.GetValue() as int
				stacksexcost = Math.Floor(stacksex*2.2*240)
				SetTextOptionValue(heart_stacksex, stacksex+" ["+stacksexcost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		elseif(option == heart_stacksperm)
			int xp = SuH_PCSxp.GetValue() as int
			int stacksperm = SuH_PCSstackmaxsperm.GetValue() as int
			int stackspermcost = Math.Floor(stacksperm*2.2*240)
			if xp >= stackspermcost
				xp -= stackspermcost
				SuH_PCSxp.SetValue(xp)
				SuH_PCSstackmaxsperm.SetValue(stacksperm+1)
				stacksperm = SuH_PCSstackmaxsperm.GetValue() as int
				stackspermcost = Math.Floor(stacksperm*2.2*240)
				SetTextOptionValue(heart_stacksperm, stacksperm+" ["+stackspermcost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		elseif(option == heart_stackmilk)
			int xp = SuH_PCSxp.GetValue() as int
			int stackmilk = SuH_PCSstackmaxmilk.GetValue() as int
			int stackmilkcost = Math.Floor(stackmilk*2.2*240)
			if xp >= stackmilkcost
				xp -= stackmilkcost
				SuH_PCSxp.SetValue(xp)
				SuH_PCSstackmaxmilk.SetValue(stackmilk+1)
				stackmilk = SuH_PCSstackmaxmilk.GetValue() as int
				stackmilkcost = Math.Floor(stackmilk*2.2*240)
				SetTextOptionValue(heart_stackmilk, stackmilk+" ["+stackmilkcost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		elseif(option == heart_absorbhealth)
			int xp = SuH_PCSxp.GetValue() as int
			int absorbhealth = SuH_PCSabsorbhealth.GetValue() as int
			int absorbhealthcost = Math.Floor(absorbhealth*1.2*200)
			if xp >= absorbhealthcost
				xp -= absorbhealthcost
				SuH_PCSxp.SetValue(xp)
				SuH_PCSabsorbhealth.SetValue(absorbhealth+1)
				absorbhealth = SuH_PCSabsorbhealth.GetValue() as int
				absorbhealthcost = Math.Floor(absorbhealth*1.2*200)
				SetTextOptionValue(heart_absorbhealth, absorbhealth+" ["+absorbhealthcost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		elseif(option == heart_absorbmagicka)
			int xp = SuH_PCSxp.GetValue() as int
			int absorbmagicka = SuH_PCSabsorbmagicka.GetValue() as int
			int absorbmagickacost = Math.Floor(absorbmagicka*1.2*200)
			if xp >= absorbmagickacost
				xp -= absorbmagickacost
				SuH_PCSxp.SetValue(xp)
				SuH_PCSabsorbmagicka.SetValue(absorbmagicka+1)
				absorbmagicka = SuH_PCSabsorbmagicka.GetValue() as int
				absorbmagickacost = Math.Floor(absorbmagicka*1.2*200)
				SetTextOptionValue(heart_absorbmagicka, absorbmagicka+" ["+absorbmagickacost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		elseif(option == heart_absorbstamina)
			int xp = SuH_PCSxp.GetValue() as int
			int absorbstamina = SuH_PCSabsorbstamina.GetValue() as int
			int absorbstaminacost = Math.Floor(absorbstamina*1.2*200)
			if xp >= absorbstaminacost
				xp -= absorbstaminacost
				SuH_PCSxp.SetValue(xp)
				SuH_PCSabsorbstamina.SetValue(absorbstamina+1)
				absorbstamina = SuH_PCSabsorbstamina.GetValue() as int
				absorbstaminacost = Math.Floor(absorbstamina*1.2*200)
				SetTextOptionValue(heart_absorbstamina, absorbstamina+" ["+absorbstaminacost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		elseif(option == heart_spermhealth)
			int xp = SuH_PCSxp.GetValue() as int
			int spermhealth = SuH_PCSspermhealth.GetValue() as int
			int spermhealthcost = Math.Floor(spermhealth*1.4*200)
			if xp >= spermhealthcost
				xp -= spermhealthcost
				SuH_PCSxp.SetValue(xp)
				SuH_PCSspermhealth.SetValue(spermhealth+1)
				spermhealth = SuH_PCSspermhealth.GetValue() as int
				spermhealthcost = Math.Floor(spermhealth*1.4*200)
				SetTextOptionValue(heart_spermhealth, spermhealth+" ["+spermhealthcost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		elseif(option == heart_spermmagicka)
			int xp = SuH_PCSxp.GetValue() as int
			int spermmagicka = SuH_PCSspermmagicka.GetValue() as int
			int spermmagickacost = Math.Floor(spermmagicka*1.4*200)
			if xp >= spermmagickacost
				xp -= spermmagickacost
				SuH_PCSxp.SetValue(xp)
				SuH_PCSspermmagicka.SetValue(spermmagicka+1)
				spermmagicka = SuH_PCSspermmagicka.GetValue() as int
				spermmagickacost = Math.Floor(spermmagicka*1.4*200)
				SetTextOptionValue(heart_spermmagicka, spermmagicka+" ["+spermmagickacost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		elseif(option == heart_spermstamina)
			int xp = SuH_PCSxp.GetValue() as int
			int spermstamina = SuH_PCSspermstamina.GetValue() as int
			int spermstaminacost = Math.Floor(spermstamina*1.4*200)
			if xp >= spermstaminacost
				xp -= spermstaminacost
				SuH_PCSxp.SetValue(xp)
				SuH_PCSspermstamina.SetValue(spermstamina+1)
				spermstamina = SuH_PCSspermstamina.GetValue() as int
				spermstaminacost = Math.Floor(spermstamina*1.4*200)
				SetTextOptionValue(heart_spermstamina, spermstamina+" ["+spermstaminacost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		elseif(option == heart_milkhealth)
			int xp = SuH_PCSxp.GetValue() as int
			int milkhealth = SuH_PCSmilkhealth.GetValue() as int
			int milkhealthcost = Math.Floor(milkhealth*1.4*200)
			if xp >= milkhealthcost
				xp -= milkhealthcost
				SuH_PCSxp.SetValue(xp)
				SuH_PCSmilkhealth.SetValue(milkhealth+1)
				milkhealth = SuH_PCSmilkhealth.GetValue() as int
				milkhealthcost = Math.Floor(milkhealth*1.4*200)
				SetTextOptionValue(heart_milkhealth, milkhealth+" ["+milkhealthcost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		elseif(option == heart_milkmagicka)
			int xp = SuH_PCSxp.GetValue() as int
			int milkmagicka = SuH_PCSmilkmagicka.GetValue() as int
			int milkmagickacost = Math.Floor(milkmagicka*1.4*200)
			if xp >= milkmagickacost
				xp -= milkmagickacost
				SuH_PCSxp.SetValue(xp)
				SuH_PCSmilkmagicka.SetValue(milkmagicka+1)
				milkmagicka = SuH_PCSmilkmagicka.GetValue() as int
				milkmagickacost = Math.Floor(milkmagicka*1.4*200)
				SetTextOptionValue(heart_milkmagicka, milkmagicka+" ["+milkmagickacost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		elseif(option == heart_milkstamina)
			int xp = SuH_PCSxp.GetValue() as int
			int milkstamina = SuH_PCSmilkstamina.GetValue() as int
			int milkstaminacost = Math.Floor(milkstamina*1.4*200)
			if xp >= milkstaminacost
				xp -= milkstaminacost
				SuH_PCSxp.SetValue(xp)
				SuH_PCSmilkstamina.SetValue(milkstamina+1)
				milkstamina = SuH_PCSmilkstamina.GetValue() as int
				milkstaminacost = Math.Floor(milkstamina*1.4*200)
				SetTextOptionValue(heart_milkstamina, milkstamina+" ["+milkstaminacost+" XP]")
				SetTextOptionValue(heart_xp, xp)
			endIf
		endIf
	endIf
	;end/
endEvent
;end/
;ent/ OnOptionSliderOpen
Event OnOptionSliderOpen(int option)

endEvent
;end/
;ent/ OnOptionSliderAccept
Event OnOptionSliderAccept(int option, float value)

endEvent
;end/
;ent/ OnOptionDefault
Event OnOptionDefault(int option)
	if(CurrentPage == "Status / Settings")
		if(option == status_SETdrainkill)
			SuH_SETallowdrainkill.SetValue(1)
			SetToggleOptionValue(status_SETdrainkill, TRUE)
		endIf
	endIf
endEvent
;end/
;ent/ OnOptionHighlight
Event OnOptionHighlight(int option)
	if(CurrentPage == "Status / Settings")
		if(option == status_health)
			SetInfoText("Current Base Health / Cap")
		elseif(option == status_magicka)
			SetInfoText("Current Base Magicka / Cap")
		elseif(option == status_stamina)
			SetInfoText("Current Base Stamina / Cap")
		elseif(option == status_desire)
			SetInfoText("Current Desire Value")
		elseif(option == status_xp)
			SetInfoText("Current XP Value")
		elseif(option == status_xpgain)
			SetInfoText("Current XP gain percentage")
		elseif(option == status_SETdrainkill)
			SetInfoText("When enabled characters can be killed by sex drain. [Default : Enabled]")
		endIf
	endIf
endEvent
;end/