Scriptname SuH_Fun extends Quest  

SexLabFramework property SexLab auto
DialogueFollowerScript Property DialogueFollower Auto
Quest Property pDialogueFollower  Auto

ObjectReference Property SuH_sdr_spawnpoint Auto ;Note, will be used in a future update
ObjectReference Property SuH_sevaspawn Auto ;Overwrites portal point
ObjectReference Property SuH_sdr_portalpoint Auto 
ObjectReference Property SuH_sd_returnpoint Auto 
ObjectReference Property SuH_sdr_lostchest Auto 
ObjectReference Property SuH_sd_goldchest Auto 
ObjectReference Property SuH_realm_petreturn Auto 

;ent/ Variables
GlobalVariable property SuH_craft_points auto
GlobalVariable property SuH_CHKsdinact auto
GlobalVariable property SuH_CHKdied auto
GlobalVariable property SuH_PCSabsorbhealth auto
GlobalVariable property SuH_PCSabsorbmagicka auto
GlobalVariable property SuH_PCSabsorbstamina auto
GlobalVariable property SuH_PCScaphealth auto
GlobalVariable property SuH_PCScapmagicka auto
GlobalVariable property SuH_PCScapstamina auto
GlobalVariable property SuH_PCScaphealthitem auto
GlobalVariable property SuH_PCScapmagickaitem auto
GlobalVariable property SuH_PCScapstaminaitem 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_PCSxp auto
GlobalVariable property SuH_PCSxpearn auto
GlobalVariable property SuH_PCSxpgain auto
GlobalVariable property SuH_PCSxpgainitem auto
GlobalVariable property SuH_PCSforce auto
GlobalVariable property SuH_PCSdesire auto
GlobalVariable property SuH_PCSeffectmulti auto
GlobalVariable property SuH_PCSbpoint auto
GlobalVariable property SuH_PCSdpoint auto
GlobalVariable property SuH_PCSspoint auto
GlobalVariable property SuH_PCSmpoint auto
GlobalVariable property SuH_PCSbdsm auto
GlobalVariable property SuH_PCSbdsmspecial auto
GlobalVariable property SuH_SETallowmalehomo auto
GlobalVariable property SuH_SETallowfemalehomo auto
GlobalVariable property SuH_SETdrainally auto
GlobalVariable property SuH_SETrestrictact auto
GlobalVariable property SuH_SETsdloseitems auto
GlobalVariable property SuH_SETsdlosegold auto
GlobalVariable property SuH_SETsdloseequip auto
GlobalVariable property SuH_ORcaphealth auto
GlobalVariable property SuH_ORcapmagicka auto
GlobalVariable property SuH_ORcapstamina auto
GlobalVariable property SuH_ORabsorbhealth auto
GlobalVariable property SuH_ORabsorbmagicka auto
GlobalVariable property SuH_ORabsorbstamina auto
GlobalVariable property SuH_PETsummonlevel auto
GlobalVariable property SuH_PETsummonxp auto
GlobalVariable property SuH_PETactivedog auto
GlobalVariable property SuH_PETdogxp auto
GlobalVariable property SuH_PETdoglevel auto
GlobalVariable property SuH_PETdogeffect auto
GlobalVariable property SuH_PETactivewolf auto
GlobalVariable property SuH_PETwolfxp auto
GlobalVariable property SuH_PETwolflevel auto
GlobalVariable property SuH_PETwolfeffect auto
GlobalVariable property SuH_PETactivehorse auto
GlobalVariable property SuH_PEThorsexp auto
GlobalVariable property SuH_PEThorselevel auto
GlobalVariable property SuH_PEThorseeffect auto
GlobalVariable property SuH_PETactiveskeever auto
GlobalVariable property SuH_PETskeeverxp auto
GlobalVariable property SuH_PETskeeverlevel auto
GlobalVariable property SuH_PETskeevereffect auto
GlobalVariable property SuH_PETactivefamiliar auto
GlobalVariable property SuH_PETfamiliarxp auto
GlobalVariable property SuH_PETfamiliarlevel auto
GlobalVariable property SuH_PETfamiliareffect auto
GlobalVariable property SuH_PETactivebear auto
GlobalVariable property SuH_PETbearxp auto
GlobalVariable property SuH_PETbearlevel auto
GlobalVariable property SuH_PETbeareffect auto
GlobalVariable property SuH_PETactivesabrecat auto
GlobalVariable property SuH_PETsabrecatxp auto
GlobalVariable property SuH_PETsabrecatlevel auto
GlobalVariable property SuH_PETsabrecateffect auto
GlobalVariable property SuH_PETactivedraugr auto
GlobalVariable property SuH_PETdraugrxp auto
GlobalVariable property SuH_PETdraugrlevel auto
GlobalVariable property SuH_PETdraugreffect auto
GlobalVariable property SuH_PETactivetroll auto
GlobalVariable property SuH_PETtrollxp auto
GlobalVariable property SuH_PETtrolllevel auto
GlobalVariable property SuH_PETtrolleffect auto
GlobalVariable property SuH_PETactivespriggan auto
GlobalVariable property SuH_PETsprigganxp auto
GlobalVariable property SuH_PETsprigganlevel auto
GlobalVariable property SuH_PETsprigganeffect auto
GlobalVariable property SuH_PETactivehorker auto
GlobalVariable property SuH_PEThorkerxp auto
GlobalVariable property SuH_PEThorkerlevel auto
GlobalVariable property SuH_PEThorkereffect auto
GlobalVariable property SuH_PETactivefalmer auto
GlobalVariable property SuH_PETfalmerxp auto
GlobalVariable property SuH_PETfalmerlevel auto
GlobalVariable property SuH_PETfalmereffect auto
GlobalVariable property SuH_PETdogunlock auto
GlobalVariable property SuH_PETwolfunlock auto
GlobalVariable property SuH_PEThorseunlock auto
GlobalVariable property SuH_PETskeeverunlock auto
GlobalVariable property SuH_PETfamiliarunlock auto
GlobalVariable property SuH_PETbearunlock auto
GlobalVariable property SuH_PETsabrecatunlock auto
GlobalVariable property SuH_PETdraugrunlock auto
GlobalVariable property SuH_PETtrollunlock auto
GlobalVariable property SuH_PETsprigganunlock auto
GlobalVariable property SuH_PEThorkerunlock auto
GlobalVariable property SuH_PETfalmerunlock auto
GlobalVariable property SuH_rank_seducer auto
GlobalVariable property SuH_SETinvactmale auto
GlobalVariable property SuH_SETinvactfemale auto
GlobalVariable property SuH_SETinvactmalecreature auto
GlobalVariable property SuH_SETinvactfemalecreature auto
GlobalVariable property SuH_PETeffect auto
GlobalVariable property SuH_PETeffectstrength auto
GlobalVariable property SuH_PETactivehusky auto
GlobalVariable property SuH_PEThuskyxp auto
GlobalVariable property SuH_PEThuskylevel auto
GlobalVariable property SuH_PEThuskyeffect auto
GlobalVariable property SuH_PEThuskyunlock auto
GlobalVariable property SuH_PETactivebristle auto
GlobalVariable property SuH_PETbristlexp auto
GlobalVariable property SuH_PETbristlelevel auto
GlobalVariable property SuH_PETbristleeffect auto
GlobalVariable property SuH_PETbristleunlock auto
GlobalVariable property SuH_PETactiveseeker auto
GlobalVariable property SuH_PETseekerxp auto
GlobalVariable property SuH_PETseekerlevel auto
GlobalVariable property SuH_PETseekereffect auto
GlobalVariable property SuH_PETseekerunlock auto
GlobalVariable property SuH_PETactivegargoyle auto
GlobalVariable property SuH_PETgargoylexp auto
GlobalVariable property SuH_PETgargoylelevel auto
GlobalVariable property SuH_PETgargoyleeffect auto
GlobalVariable property SuH_PETgargoyleunlock auto
GlobalVariable property SuH_PETactivenetch auto
GlobalVariable property SuH_PETnetchxp auto
GlobalVariable property SuH_PETnetchlevel auto
GlobalVariable property SuH_PETnetcheffect auto
GlobalVariable property SuH_PETnetchunlock auto
GlobalVariable property SuH_PETactiveriekling auto
GlobalVariable property SuH_PETrieklingxp auto
GlobalVariable property SuH_PETrieklinglevel auto
GlobalVariable property SuH_PETrieklingeffect auto
GlobalVariable property SuH_PETrieklingunlock auto
GlobalVariable property SuH_perk_orgasm auto
GlobalVariable property SuH_perk_orgasml auto
GlobalVariable property SuH_perk_allyorgasm auto
GlobalVariable property SuH_perk_allyorgasml auto
GlobalVariable property SuH_perk_npcorgasm auto
GlobalVariable property SuH_perk_npcorgasml auto
GlobalVariable property SuH_perk_absorb auto
GlobalVariable property SuH_perk_absorbl auto
GlobalVariable property SuH_perk_sperm auto
GlobalVariable property SuH_perk_sperml auto
GlobalVariable property SuH_perk_milk auto
GlobalVariable property SuH_perk_milkl auto
GlobalVariable property SuH_SETnpcabsorb auto
GlobalVariable property SuH_craft_level auto
GlobalVariable property SuH_craft_xp auto
GlobalVariable property SuH_PETspiderlevel auto
GlobalVariable property SuH_PETspiderxp auto
GlobalVariable property SuH_PETspiderunlock auto
GlobalVariable property SuH_PETspidereffect auto
GlobalVariable property SuH_PETactivespider auto
;end/
;ent/ Spell
Spell property SuH_sex_inact auto
Spell property SuH_sex_petspell auto
Spell property SuH_CHAinvact auto
;end/
;ent/ Actors
Actor property PlayerRef auto
Actor property SuH_actor_dog auto
Actor Property SuH_actor_wolf auto
Actor Property SuH_actor_horse auto
Actor Property SuH_actor_skeever auto
Actor Property SuH_actor_familiar auto
Actor Property SuH_actor_bear auto
Actor Property SuH_actor_sabrecat auto
Actor Property SuH_actor_draugr auto
Actor Property SuH_actor_troll auto
Actor Property SuH_actor_spriggan auto
Actor Property SuH_actor_horker auto
Actor Property SuH_actor_falmer auto
Actor Property SuH_actor_husky auto
Actor Property SuH_actor_bristle auto
Actor Property SuH_actor_seeker auto
Actor Property SuH_actor_gargoyle auto
Actor Property SuH_actor_netch auto
Actor Property SuH_actor_riekling auto
Actor Property SuH_actor_spider auto
;end/
;ent/ Faction
Faction property SuH_petfaction auto
Faction property CurrentFollowerFaction auto
;end/
;ent/ Items
MiscObject property Gold001 auto
MiscObject property Lockpick auto

Weapon property IronDagger auto
Weapon property IronSword auto
Weapon property IronGreatsword auto
Weapon property SteelDagger auto
Weapon property SteelSword auto
Weapon property SteelGreatsword auto
Weapon property dwarvendagger auto
Weapon property DwarvenSword auto
Weapon property DwarvenGreatsword auto
Weapon property ElvenDagger auto
Weapon property ElvenSword auto
Weapon property ElvenGreatsword auto
Weapon property GlassDagger auto
Weapon property GlassSword auto
Weapon property GlassGreatsword auto
Weapon property EbonyDagger auto
Weapon property EbonySword auto
Weapon property EbonyGreatsword auto

Armor property ArmorHideCuirass auto
Armor property ArmorHideBoots auto
Armor property ArmorHideGauntlets auto
Armor property ArmorHideHelmet auto
Armor property ArmorHideShield auto
Armor property ArmorLeatherCuirass auto
Armor property ArmorLeatherBoots auto
Armor property ArmorLeatherGauntlets auto
Armor property ArmorLeatherHelmet auto
Armor property ArmorElvenCuirass auto
Armor property ArmorElvenBoots auto
Armor property ArmorElvenGauntlets auto
Armor property ArmorElvenHelmet auto
Armor property ArmorElvenShield auto
Armor property ArmorGlassCuirass auto
Armor property ArmorGlassBoots auto
Armor property ArmorGlassGauntlets auto
Armor property ArmorGlassHelmet auto
Armor property ArmorGlassShield auto
Armor property ArmorDragonscaleCuirass auto
Armor property ArmorDragonscaleBoots auto
Armor property ArmorDragonscaleGauntlets auto
Armor property ArmorDragonscaleHelmet auto
Armor property ArmorDragonscaleShield auto

Armor property ArmorIronCuirass auto
Armor property ArmorIronBoots auto
Armor property ArmorIronGauntlets auto
Armor property ArmorIronHelmet auto
Armor property ArmorIronShield auto
Armor property ArmorSteelCuirassA auto
Armor property ArmorSteelBootsA auto
Armor property ArmorSteelGauntletsA auto
Armor property ArmorSteelHelmetA auto
Armor property ArmorSteelShield auto
Armor property ArmorDwarvenCuirass auto
Armor property ArmorDwarvenBoots auto
Armor property ArmorDwarvenGauntlets auto
Armor property ArmorDwarvenHelmet auto
Armor property ArmorDwarvenShield auto
Armor property ArmorEbonyCuirass auto
Armor property ArmorEbonyBoots auto
Armor property ArmorEbonyGauntlets auto
Armor property ArmorEbonyHelmet auto
Armor property ArmorEbonyShield auto
Armor property ArmorDragonplateCuirass auto
Armor property ArmorDragonplateBoots auto
Armor property ArmorDragonplateGauntlets auto
Armor property ArmorDragonplateHelmet auto
Armor property ArmorDragonplateShield auto
;end/
;ent/ Script Variables
int trackConfirm
int trackValue
int proccraft
string trackString
actor seducedNPC
string seducedType
int craftpoints
;end/

;ent/ Tracking
Function trackSet(int trackCost, string trackName)
	trackValue = trackCost
	trackString = trackName
	trackConfirm = 1
endFunction
;end/
;ent/ Perk
		;Perk List
			;orgasm = Have Orgasm +12 BDSM
			;absorb = Absorb status in a sex act +1% XP Gain
			;sperm/milk = Consume sperm/milk +5 Health Cap
			;x Saving Essence = Trigger Saving Essence +5 Health/Stamina Cap
Function perkcalc(string perkName, int value=0)
	if perkName == "orgasm"
		int x = Math.Floor(SuH_perk_orgasm.GetValue() + 1)
		SuH_perk_orgasm.SetValue(x)
		int y = Math.Floor((((SuH_perk_orgasml.GetValue() * 0.3) * 200) * 0.2) + 5)
		if x > y
			int z = Math.Floor(SuH_PCSbdsm.GetValue() + 12)
			int k = Math.Floor(SuH_perk_orgasml.GetValue() + 1)
			SuH_PCSbdsm.SetValue(z)
			SuH_perk_orgasml.SetValue(k)
			debug.Notification("Succubus Heart : 'Have Orgasm' Perk Level-up! +12 BDSM")
		endIf
	elseif perkName == "absorb"
		int x = Math.Floor(SuH_perk_absorb.GetValue() + 1)
		SuH_perk_absorb.SetValue(x)
		int y = Math.Floor((((SuH_perk_absorbl.GetValue() * 0.3) * 800) * 0.2) + 20)
		if x > y
			int z = Math.Floor(SuH_PCSbdsm.GetValue() + 2)
			int k = Math.Floor(SuH_perk_absorbl.GetValue() + 1)
			SuH_PCSbdsm.SetValue(z)
			SuH_perk_absorbl.SetValue(k)
			debug.Notification("Succubus Heart : 'Absorb Status' Perk Level-up! +2 BDSM")
		endIf
	elseif perkName == "sperm"
		int x = Math.Floor(SuH_perk_sperm.GetValue() + 1)
		SuH_perk_sperm.SetValue(x)
		int y = Math.Floor((((SuH_perk_sperml.GetValue() * 0.3) * 400) * 0.2) + 10)
		if x > y
			int z = Math.Floor(SuH_PCSxp.GetValue() + 500)
			int k = Math.Floor(SuH_perk_sperml.GetValue() + 1)
			SuH_PCSxp.SetValue(z)
			SuH_perk_sperml.SetValue(k)
			debug.Notification("Succubus Heart : 'Consume Sperm' Perk Level-up! +500 HeartXP")
		endIf
	elseif perkName == "milk"
		int x = Math.Floor(SuH_perk_milk.GetValue() + 1)
		SuH_perk_milk.SetValue(x)
		int y = Math.Floor((((SuH_perk_milkl.GetValue() * 0.3) * 400) * 0.2) + 10)
		if x > y
			int z = Math.Floor(SuH_PCSxp.GetValue() + 500)
			int k = Math.Floor(SuH_perk_milkl.GetValue() + 1)
			SuH_PCSxp.SetValue(z)
			SuH_perk_milkl.SetValue(k)
			debug.Notification("Succubus Heart : 'Consume Milk' Perk Level-up! +500 HeartXP")
		endIf
	elseif perkName == "allyorgasm"
		int x = Math.Floor(SuH_perk_allyorgasm.GetValue() + 1)
		SuH_perk_allyorgasm.SetValue(x)
		int y = Math.Floor((((SuH_perk_allyorgasml.GetValue() * 0.3) * 140) * 0.2) + 5)
		if x > y
			int z = Math.Floor(SuH_PCSxp.GetValue() + 1000)
			int k = Math.Floor(SuH_perk_allyorgasml.GetValue() + 1)
			SuH_perk_allyorgasml.SetValue(k)
			SuH_PCSxp.SetValue(z)
			debug.Notification("Succubus Heart : 'Bring Ally To Orgasm' Perk Level-up! +1000 HeartXP")
		endIf
	endIf
endFunction
;end/
;ent/ Pet Sex Effects
		; Spell Effects
			; 0 = no effect
			; 1 = damage target stamina ( petLVL+sumLVL * 2 )
			; 2 = heal target health ( petLVL+sumLVL * 1 )
			; 3 = damage target magicka ( petLVL+sumLVL * 2 )
			; 4 = Gain HeartXP ( petLVL+sumLVL * 1 )
			; 5 = Damage Health ( petLVL+sumLVL * 1 )
Function spellPET(string petID, Actor petTarget)
	int petL = 0 ; Pet Level
	int petE = 0 ; Spell Effect
	int sumL = SuH_PETsummonlevel.GetValue() as int
	if petID == "dog"
		petL = SuH_PETdoglevel.GetValue() as int
		petE = SuH_PETdogeffect.GetValue() as int
	elseif petID == "wolf"
		petL = SuH_PETwolflevel.GetValue() as int
		petE = SuH_PETwolfeffect.GetValue() as int
	elseif petID == "horse"
		petL = SuH_PEThorselevel.GetValue() as int
		petE = SuH_PEThorseeffect.GetValue() as int
	elseif petID == "skeever"
		petL = SuH_PETskeeverlevel.GetValue() as int
		petE = SuH_PETskeevereffect.GetValue() as int
	elseif petID == "familiar"
		petL = SuH_PETfamiliarlevel.GetValue() as int
		petE = SuH_PETfamiliareffect.GetValue() as int
	elseif petID == "bear"
		petL = SuH_PETbearlevel.GetValue() as int
		petE = SuH_PETbeareffect.GetValue() as int
	elseif petID == "sabrecat"
		petL = SuH_PETsabrecatlevel.GetValue() as int
		petE = SuH_PETsabrecateffect.GetValue() as int
	elseif petID == "draugr"
		petL = SuH_PETdraugrlevel.GetValue() as int
		petE = SuH_PETdraugreffect.GetValue() as int
	elseif petID == "troll"
		petL = SuH_PETtrolllevel.GetValue() as int
		petE = SuH_PETtrolleffect.GetValue() as int
	elseif petID == "spriggan"
		petL = SuH_PETsprigganlevel.GetValue() as int
		petE = SuH_PETsprigganeffect.GetValue() as int
	elseif petID == "horker"
		petL = SuH_PEThorkerlevel.GetValue() as int
		petE = SuH_PEThorkereffect.GetValue() as int
	elseif petID == "falmer"
		petL = SuH_PETfalmerlevel.GetValue() as int
		petE = SuH_PETfalmereffect.GetValue() as int
	elseif petID == "husky"
		petL = SuH_PEThuskylevel.GetValue() as int
		petE = SuH_PEThuskyeffect.GetValue() as int
	elseif petID == "bristle"
		petL = SuH_PETbristlelevel.GetValue() as int
		petE = SuH_PETbristleeffect.GetValue() as int
	elseif petID == "seeker"
		petL = SuH_PETseekerlevel.GetValue() as int
		petE = SuH_PETseekereffect.GetValue() as int
	elseif petID == "gargoyle"
		petL = SuH_PETgargoylelevel.GetValue() as int
		petE = SuH_PETgargoyleeffect.GetValue() as int
	elseif petID == "netch"
		petL = SuH_PETnetchlevel.GetValue() as int
		petE = SuH_PETnetcheffect.GetValue() as int
	elseif petID == "riekling"
		petL = SuH_PETrieklinglevel.GetValue() as int
		petE = SuH_PETrieklingeffect.GetValue() as int
	elseif petID == "spider"
		petL = SuH_PETrieklinglevel.GetValue() as int
		petE = SuH_PETrieklingeffect.GetValue() as int
	endIf
	if petE == 1 ; damage target stamina
		if petTarget.IsInFaction(SuH_petfaction)
		else
			SuH_PETeffect.SetValue(1)
			float x = (petL+sumL) * 2
			SuH_PETeffectstrength.SetValue(x)
			petTarget.AddSpell(SuH_sex_petspell)
		endIf
	elseif petE == 2 ; heal target health
		if petTarget.IsInFaction(SuH_petfaction)
		else
			SuH_PETeffect.SetValue(2)
			float x = (petL+sumL) * 1
			SuH_PETeffectstrength.SetValue(x)
			petTarget.AddSpell(SuH_sex_petspell)
		endIf
	elseif petE == 3 ; damage target magicka
		if petTarget.IsInFaction(SuH_petfaction)
		else
			SuH_PETeffect.SetValue(3)
			float x = (petL+sumL) * 2
			SuH_PETeffectstrength.SetValue(x)
			petTarget.AddSpell(SuH_sex_petspell)
		endIf
	elseif petE == 4 ; gain heartxp
		if petTarget.IsInFaction(SuH_petfaction)
		SuH_PETeffect.SetValue(4)
		float x = (petL+sumL) * 1
		SuH_PETeffectstrength.SetValue(x)
		petTarget.AddSpell(SuH_sex_petspell)
		endIf
	elseif petE == 5 ; damage target health
		if petTarget.IsInFaction(SuH_petfaction)
		else
			SuH_PETeffect.SetValue(5)
			float x = (petL+sumL) * 1
			SuH_PETeffectstrength.SetValue(x)
			petTarget.AddSpell(SuH_sex_petspell)
		endIf
	endIf
endFunction
;end/
;ent/ Make Essential
Function INVact(actor char)
	int charG = SexLab.GetGender(char)
	if char.GetActorBase().IsEssential()
		;do nothing
	elseif charG == 0
		if SuH_SETinvactmale.GetValue()
			char.AddSpell(SuH_CHAinvact)
			char.GetActorBase().SetEssential(true)
		endIf
	elseif charG == 1
		if SuH_SETinvactfemale.GetValue()
			char.AddSpell(SuH_CHAinvact)
			char.GetActorBase().SetEssential(true)
		endIf
	elseif charG == 2
		if SuH_SETinvactmalecreature.GetValue()
			char.AddSpell(SuH_CHAinvact)
			char.GetActorBase().SetEssential(true)
		endIf
	elseif charG == 3
		if SuH_SETinvactfemalecreature.GetValue()
			char.AddSpell(SuH_CHAinvact)
			char.GetActorBase().SetEssential(true)
		endIf
	endIf
endFunction
;end/
;ent/ Set Seduced / apply seduction cost
		;charNPC : Set the reference/target actor
		;actType : Set aggressive or consent
		; setNPC : 0=proc effect 1=setting npc for future use
Function seducedNPCSet(actor charNPC, string actType, int setNPC)
	if setNPC == 1
		seducedNPC = charNPC
		seducedType = actType
	elseif setNPC == 0
		if seducedNPC == charNPC && seducedNPC != PlayerRef
			if seducedType == actType
				int seducerrank = SuH_rank_seducer.GetValue() as int
				int seducecost = Math.Floor(90 - (seducerrank*5))
				int phealth = playerRef.GetBaseActorValue("Health") as int
				int pmagicka = playerRef.GetBaseActorValue("Magicka") as int
				int pstamina = playerRef.GetBaseActorValue("Stamina") as int
				int nphealth = Math.Floor(phealth - (phealth * (seducecost * 0.01)))
				int npmagicka = Math.Floor(pmagicka - (pmagicka * (seducecost * 0.01)))
				int npstamina = Math.Floor(pstamina - (pstamina * (seducecost * 0.01)))
				playerRef.SetActorValue("health", nphealth)
				playerRef.SetActorValue("magicka", npmagicka)
				playerRef.SetActorValue("stamina", npstamina)
			else
				seducedNPC = playerRef
			endIf
		else
			seducedNPC = playerRef
		endIf
	endIf
endFunction
;end/
;ent/ XPcalc : Calculate XP gained
		; *aPreset : Defines defaults for common actions
		; *aMOD : Active Modifier that adds to XPgain percentage
		; *XPearn : Set XP earned (aPreset overwrites this value) 0=use default
		; *lvlS : Level Scaling, Bonus XP earned per-level [lvlS * playerLevel]
Function XPcalc(string aPreset="none", float aMOD=0.0, int XPearn=0, float lvlS=0.0) 
	If aPreset != "none"
		if aPreset == "PCmastery" ; Mastery Sex Act (Player as aggressor)
			int desireCost = Math.Floor(SuH_PCSdesire.GetValue() * 0.05)
			int desireV = Math.Floor(SuH_PCSdesire.GetValue() - desireCost)
			SuH_PCSdesire.SetValue(desireV)
			XPearn = Math.Floor(XPearn + desireCost + SuH_PCSxpearn.GetValue())
			aMOD = 0.2
			lvlS = 5.0
		elseIf aPreset == "PCtraining" ; Consent Sex Act (Player with consent)
			int desireCost = Math.Floor(SuH_PCSdesire.GetValue() * 0.05)
			int desireV = Math.Floor(SuH_PCSdesire.GetValue() - desireCost)
			SuH_PCSdesire.SetValue(desireV)
			XPearn = Math.Floor(XPearn + desireCost + SuH_PCSxpearn.GetValue())
			aMOD = 0.0
			lvlS = 5.0
		elseIf aPreset == "PCsubmit" ; Submit Sex Act (Player as victim)
			int desireCost = Math.Floor(SuH_PCSdesire.GetValue() * 0.05)
			int desireV = Math.Floor(SuH_PCSdesire.GetValue() - desireCost)
			SuH_PCSdesire.SetValue(desireV)
			XPearn = Math.Floor(XPearn + desireCost + SuH_PCSxpearn.GetValue())
			aMOD = -0.2
			lvlS = 5.0
		elseIf aPreset == "PCsperm" ; Consume Sperm
			aMOD = 0.0
			XPearn = Math.Floor(XPearn + SuH_PCSxpearn.GetValue())
			lvlS = 5.0
		elseIf aPreset == "PCmilk" ; Consume Milk
			aMOD = 0.0
			XPearn = Math.Floor(XPearn + SuH_PCSxpearn.GetValue())
			lvlS = 5.0
		elseIf aPreset == "PCorgasm"
			aMOD = 0.0
			lvlS = 0.0
			int desireCost = Math.Floor(SuH_PCSdesire.GetValue() * 0.8)
			int desireV = Math.Floor(SuH_PCSdesire.GetValue() - desireCost)
			SuH_PCSdesire.SetValue(desireV)
			XPearn = Math.Floor(XPearn + desireCost + SuH_PCSxpearn.GetValue())
		else
			debug.trace("SuH ERROR : XPcalc aPreset was invalid", 2)
		endIf
	endIf
		if XPearn == 0
			XPearn = SuH_PCSxpearn.GetValue() as int
		endIf
		float eMOD = aMOD + (SuH_PCSxpgain.GetValue()*0.01)
		float effectMulti = SuH_PCSeffectmulti.GetValue()
		int PClevel = PlayerRef.GetLevel() as int
		int x = Math.Floor(((XPearn+(PClevel*lvlS))*(eMOD*effectMulti)))
		int y = SuH_PCSxp.GetValue() as int
		int z = x+y
		If z < 2000000000 || z > -1
			SuH_PCSxp.SetValue(z)
		endIf
		if trackConfirm == 1
			if z > trackValue
				debug.Notification(trackString+" can now be increased!")
				trackConfirm = 0
			endIf
		endIf
endFunction
;end/
;ent/ STATcalc : Calculate Absorption
	; eChar : effected Character
	; *aPreset : defaults for common values [PCmastery PCtraining PCsubmit PCsperm PCmilk]
	; *Stat : Stat to effect "All"=health/magicka/stamina "Health" "Magicka" "Stamina"
	; *aMOD : Active Modifier, Percentage added to the effect
	; *aEffect : Override default absorption values [set to anything that isn't 0.0 to ignore Absorption Stats]
Function STATcalc(Actor eChar, string aPreset="none",string stat="All", float aMOD=0.0,float aEffect=0.0)
		If aPreset != "none"
			if aPreset == "PCmastery" ; Mastery Sex Act
				aMOD = 0.2
				aEffect = 0.0
				perkcalc("absorb")
			elseif aPreset == "PCtraining" ; Consent Sex Act
				aMOD = 0.0
				aEffect = 0.0
				perkcalc("absorb")
			elseif aPreset == "PCsubmit" ; Submit Sex Act
				aMOD = -0.2
				aEffect = 0
				perkcalc("absorb")
			elseif aPreset == "PCsperm" ; Consume Sperm
				aMOD = 0.0
				aEffect = 0.0
				perkcalc("sperm")
			elseif aPreset == "PCmilk" ; Consume Milk
				aMOD = 0.0
				aEffect = 0.0
				perkcalc("milk")
			else
				debug.trace("SuH ERROR : STATcalc aPreset was invalid", 2)
			endIf
		endIf
		if eChar == PlayerRef ; if character is the player
				if Stat == "All" || Stat == "Health" ; Earn Health 
						float effectMulti = SuH_PCSeffectmulti.GetValue()
						float eMOD = (1.0+aMOD)*effectMulti ; Set Multiplier
						float cS = eChar.GetBaseActorValue("health") ; Get Base Stat
						float cScap = 0
						if SuH_ORcaphealth.GetValue() > 0
							cScap = SuH_ORcaphealth.GetValue()
						else
							int plvl = PlayerRef.GetLevel() as int
							cScap = Math.Floor(SuH_PCScaphealth.GetValue()+(plvl*4)) ; Get Stat Cap
						endIf
						float k = 0.0 ; Set-up Absorption Variable
						if aEffect == 0 ; if aEffect is set to default
							if aPreset == "PCsperm" ; Check if preset is PCsperm
								k = SuH_PCSspermhealth.GetValue() as int ; set to default
							elseIf aPreset == "PCmilk" ; Check if preset is PCmilk
								k = SuH_PCSmilkhealth.GetValue() as int ; set to default
							else ; Set to general absorption stat
								if SuH_ORabsorbhealth.GetValue() > 0
									k = SuH_ORabsorbhealth.GetValue() as int
								else
									k = SuH_PCSabsorbhealth.GetValue() as int
								endIf
							endIf
						else ; If aEffect isn't default
							k = aEffect ; Set absorption calculation to k
						endIf
					if cS >= cScap ; Check if Stat is capped
						int x = Math.Floor(k*eMOD) ; Find total absorption
						int y = SuH_PCSforce.GetValue() as int ; Get Force value
						SuH_PCSforce.SetValue(x+y) ; Set Force
					else ; If stat wasn't capped
						int x = Math.Floor(k*eMOD) ; Find total absorption
						int y = Math.Floor(x+cS) ; Find result stat
						craftpoints += Math.Floor(x * 3)
						if y <= cScap ; If result is below cap
							eChar.SetActorValue("health", y) ; Set Stat
						else ; If result was above cap
							eChar.SetActorValue("health", cScap) ; Set Stat to cap
							int j = Math.Floor(x-cScap) ; Find absorbed value
							int z = Math.Floor(y+SuH_PCSforce.GetValue()) ; Get Force and add
							SuH_PCSforce.SetValue(z) ; Set Force
						endIf
						craftpoints += Math.Floor(x * 3)
					endIf
				endIf
				if Stat == "All" || Stat == "Magicka" ; Earn Magicka
						float effectMulti = SuH_PCSeffectmulti.GetValue()
						float eMOD = (1.0+aMOD)*effectMulti
						float cS = eChar.GetBaseActorValue("magicka")
						float cScap = 0
						if SuH_ORcapmagicka.GetValue() > 0
							cScap = SuH_ORcapmagicka.GetValue()
						else
							int plvl = PlayerRef.GetLevel() as int
							cScap = Math.Floor(SuH_PCScapmagicka.GetValue()+(plvl*3)) ; Get Stat Cap
						endIf
						float k = 0.0
						if aEffect == 0
							if aPreset == "PCsperm"
								k = SuH_PCSspermmagicka.GetValue() as int
							elseIf aPreset == "PCmilk"
								k = SuH_PCSmilkmagicka.GetValue() as int
							else
								if SuH_ORabsorbmagicka.GetValue() > 0
									k = SuH_ORabsorbmagicka.GetValue() as int
								else
									k = SuH_PCSabsorbmagicka.GetValue() as int
								endIf
							endIf
						else
							k = aEffect
						endIf
					if cS >= cScap
						int x = Math.Floor(k*eMOD)
						int y = SuH_PCSforce.GetValue() as int
						SuH_PCSforce.SetValue(x+y)
						craftpoints += Math.Floor(x * 3)
					else
						int x = Math.Floor(k*eMOD)
						int y = Math.Floor(x+cS)
						if y <= cScap
							eChar.SetActorValue("magicka", y)
						else
							eChar.SetActorValue("magicka", cScap)
							int j = Math.Floor(x-cScap)
							int z = Math.Floor(y+SuH_PCSforce.GetValue())
							SuH_PCSforce.SetValue(z)
						endIf
						craftpoints += Math.Floor(x * 3)
					endIf
				endIf
				if Stat == "All" || Stat == "Stamina" ; Earn Stamina
						float effectMulti = SuH_PCSeffectmulti.GetValue()
						float eMOD = (1.0+aMOD)*effectMulti
						float cS = eChar.GetBaseActorValue("Stamina")
						float cScap = 0
						if SuH_ORcapstamina.GetValue() > 0
							cScap = SuH_ORcapstamina.GetValue()
						else
							int plvl = PlayerRef.GetLevel() as int
							cScap = Math.Floor(SuH_PCScapstamina.GetValue()+(plvl*3)) ; Get Stat Cap
						endIf
						float k = 0
						if aEffect == 0
							if aPreset == "PCsperm"
								k = SuH_PCSspermstamina.GetValue() as int
							elseIf aPreset == "PCmilk"
								k = SuH_PCSmilkstamina.GetValue() as int
							else
								if SuH_ORabsorbstamina.GetValue() > 0
									k = SuH_ORabsorbstamina.GetValue() as int
								else
									k = SuH_PCSabsorbstamina.GetValue() as int
								endIf
							endIf
						else
							k = aEffect
						endIf
					if cS >= cScap
						int x = Math.Floor(k*eMOD)
						int y = SuH_PCSforce.GetValue() as int
						SuH_PCSforce.SetValue(x+y)
						craftpoints += Math.Floor(x * 3)
					else
						int x = Math.Floor(k*eMOD)
						int y = Math.Floor(x+cS)
						if y <= cScap
							eChar.SetActorValue("stamina", y)
						else
							eChar.SetActorValue("stamina", cScap)
							int j = Math.Floor(x-cScap)
							int z = Math.Floor(y+SuH_PCSforce.GetValue())
							SuH_PCSforce.SetValue(z)
						endIf
						craftpoints += Math.Floor(x * 3)
					endIf
				endIf
		elseif SuH_SETnpcabsorb.GetValue() ; if character isn't the player
			int confirmdrain = 0
			if eChar.GetFactionRank(CurrentFollowerFaction) >= 0
				if SuH_SETdrainally.GetValue()
					confirmdrain = 1
				else
					confirmdrain = 0
				endIf
			else
				confirmdrain = 1
			endIf				
			if confirmdrain == 1
				if Stat == "All" || Stat == "Health"
					if aEffect == 0
						if SuH_ORabsorbhealth.GetValue() > 0
							aEffect = SuH_ORabsorbhealth.GetValue() as int
						else
							aEffect = SuH_PCSabsorbhealth.GetValue() as int
						endIf
					endIf
					float effectMulti = SuH_PCSeffectmulti.GetValue()
					float eMOD = (1.0+aMOD)*effectMulti
					float cS = eChar.GetBaseActorValue("health")
					int x = Math.Floor(aEffect*eMOD)
					if x >= cS
						eChar.SetActorValue("health",0)
					else
						int y = Math.Floor(cS-x)
						eChar.SetActorValue("health",y)
					endIf
				endIf
				if Stat == "All" || Stat == "Magicka"
					if aEffect == 0
						if SuH_ORabsorbmagicka.GetValue() > 0
							aEffect = SuH_ORabsorbmagicka.GetValue() as int
						else
							aEffect = SuH_PCSabsorbmagicka.GetValue() as int
						endIf
					endIf
					float effectMulti = SuH_PCSeffectmulti.GetValue()
					float eMOD = (1.0+aMOD)*effectMulti
					float cS = eChar.GetBaseActorValue("magicka")
					int x = Math.Floor(aEffect*eMOD)
					if x >= cS
						eChar.SetActorValue("magicka",0)
					else
						int y = Math.Floor(cS-x)
						eChar.SetActorValue("magicka",y)
					endIf
				endIf
				if Stat == "All" || Stat == "Stamina"
					if aEffect == 0
						if SuH_ORabsorbstamina.GetValue() > 0
							aEffect = SuH_ORabsorbstamina.GetValue() as int
						else
							aEffect = SuH_PCSabsorbstamina.GetValue() as int
						endIf
					endIf
					float effectMulti = SuH_PCSeffectmulti.GetValue()
					float eMOD = (1.0+aMOD)*effectMulti
					float cS = eChar.GetBaseActorValue("stamina")
					int x = Math.Floor(aEffect*eMOD)
					if x >= cS
						eChar.SetActorValue("stamina",0)
					else
						int y = Math.Floor(cS-x)
						eChar.SetActorValue("stamina",y)
					endIf
				endIf
			endIf
		endIf
endFunction
;end/
;ent/ BDSMcalc : Add BDSM Rating... easily
	; BDSMtype : Which value to increase [b d s m]
	; value : Value to add
Function BDSMcalc(string BDSMtype, int value)
	int b = SuH_PCSbpoint.GetValue() as int
	int d = SuH_PCSdpoint.GetValue() as int
	int s = SuH_PCSspoint.GetValue() as int
	int m = SuH_PCSmpoint.GetValue() as int
	int bdsm = SuH_PCSbdsm.GetValue() as int
	int bdsmspecial = SuH_PCSbdsmspecial.GetValue() as int
	
	if BDSMtype == "b"
		b += value
		bdsm += value
		SuH_PCSbpoint.SetValue(b)
		SuH_PCSbdsm.SetValue(bdsm)
		if d >= b && d >= s && d >= m
			SuH_PCSbdsmspecial.SetValue(2)
		elseif b >= s && b >= m
			SuH_PCSbdsmspecial.SetValue(1)
		elseif s >= m
			SuH_PCSbdsmspecial.SetValue(3)
		else
			SuH_PCSbdsmspecial.SetValue(4)
		endIf
	elseif BDSMtype == "d"
		d += value
		bdsm += value
		SuH_PCSdpoint.SetValue(d)
		SuH_PCSbdsm.SetValue(bdsm)
		if d >= b && d >= s && d >= m
			SuH_PCSbdsmspecial.SetValue(2)
		elseif b >= s && b >= m
			SuH_PCSbdsmspecial.SetValue(1)
		elseif s >= m
			SuH_PCSbdsmspecial.SetValue(3)
		else
			SuH_PCSbdsmspecial.SetValue(4)
		endIf
	elseif BDSMtype == "s"
		s += value
		bdsm += value
		SuH_PCSspoint.SetValue(s)
		SuH_PCSbdsm.SetValue(bdsm)
		if d >= b && d >= s && d >= m
			SuH_PCSbdsmspecial.SetValue(2)
		elseif b >= s && b >= m
			SuH_PCSbdsmspecial.SetValue(1)
		elseif s >= m
			SuH_PCSbdsmspecial.SetValue(3)
		else
			SuH_PCSbdsmspecial.SetValue(4)
		endIf
	elseif BDSMtype == "m"
		m += value
		bdsm += value
		SuH_PCSmpoint.SetValue(m)
		SuH_PCSbdsm.SetValue(bdsm)
		if d >= b && d >= s && d >= m
			SuH_PCSbdsmspecial.SetValue(2)
		elseif b >= s && b >= m
			SuH_PCSbdsmspecial.SetValue(1)
		elseif s >= m
			SuH_PCSbdsmspecial.SetValue(3)
		else
			SuH_PCSbdsmspecial.SetValue(4)
		endIf
	endIf			
endFunction
;end/
;ent/ ANIMcalc : Calculate animations to start using Succubus Heart's variables
	; sentActor : Actors to animate [only supports an array of 1-2 actors]
	; *victimActor : Set victim Actor, and flags act as aggressive [defaults to no victim]
Function ANIMcalc(actor[] sentActor, actor victimActor=none)
	if sentActor.Length == 2
		actor a0 = sentActor[0]
		actor a1 = sentActor[1]
		int a0g = SexLab.GetGender(a0)
		int a1g = SexLab.GetGender(a1)
		if a0g == 1 ; 0 female
			if a1g == 0 ; 1 male
				bool a0v = True
				bool a1v = True
				if a0.HasSpell(SuH_sex_inact)
					a0v = false
				else
					a0v = SexLab.IsValidActor(a0)
				endIf
				if a1.HasSpell(SuH_sex_inact)
					a1v = false
				else
					a1v = SexLab.IsValidActor(a1)
				endIf
				if a0v == TRUE && a1v == TRUE ; if valid
					actor[] animActor = new actor[2]
					animActor[0] = a0
					animActor[1] = a1
					if victimActor != none ; if aggressive
						if victimActor == a0 ; if female victim
							sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
							SexLab.StartSex(animActor, animSET, victim=victimActor)
						else ; if male victim
							if SuH_SETrestrictact.GetValue()
								sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"Cowgirl", "Lesbian", requireAll=true)
								SexLab.StartSex(animActor, animSET, victim=victimActor)
							else
								sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
								SexLab.StartSex(animActor, animSET, victim=victimActor)
							endIf
						endIf
					else ; if non-aggressive
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
						SexLab.StartSex(animActor, animSET)
					endIf
				endIf
			elseIf a1g == 2 ; 1 male creature
				bool a0v = True
				bool a1v = True
				if a0.HasSpell(SuH_sex_inact)
					a0v = false
				else
					a0v = SexLab.IsValidActor(a0)
				endIf
				if a1.HasSpell(SuH_sex_inact)
					a1v = false
				else
					a1v = SexLab.IsValidActor(a1)
				endIf
				if a0v == TRUE && a1v == TRUE ; if valid
					actor[] animActor = new actor[2]
					animActor[0] = a0
					animActor[1] = a1
					if victimActor != none ; if aggressive
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=victimActor)
					else ; if non-aggressive
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET)
					endIf
				endIf
			elseif SuH_SETallowfemalehomo.GetValue()
				if a1g == 1 ; 1 female
					bool a0v = True
					bool a1v = True
					if a0.HasSpell(SuH_sex_inact)
						a0v = false
					else
						a0v = SexLab.IsValidActor(a0)
					endIf
					if a1.HasSpell(SuH_sex_inact)
						a1v = false
					else
						a1v = SexLab.IsValidActor(a1)
					endIf
					if a0v == TRUE && a1v == TRUE ; if valid
						actor[] animActor = new actor[2]
						animActor[0] = a0
						animActor[1] = a1
						if victimActor != none ; if aggressive
							sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"Lesbian", "", requireAll=true)
							SexLab.StartSex(animActor, animSET, victim=victimActor)
						else ; if non-aggressive
							sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
							SexLab.StartSex(animActor, animSET)
						endIf
					endIf
				elseIf a1g == 3 ; 1 female creature
					bool a0v = True
					bool a1v = True
					if a0.HasSpell(SuH_sex_inact)
						a0v = false
					else
						a0v = SexLab.IsValidActor(a0)
					endIf
					if a1.HasSpell(SuH_sex_inact)
						a1v = false
					else
						a1v = SexLab.IsValidActor(a1)
					endIf
					if a0v == TRUE && a1v == TRUE ; if valid
						actor[] animActor = new actor[2]
						animActor[0] = a0
						animActor[1] = a1
						if victimActor != none ; if aggressive
							if SuH_SETrestrictact.GetValue()
								sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"Cowgirl", "Lesbian", requireAll=true)
								SexLab.StartSex(animActor, animSET, victim=victimActor)
							else
								sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
								SexLab.StartSex(animActor, animSET, victim=victimActor)
							endIf
						else ; if non-aggressive
							sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
							SexLab.StartSex(animActor, animSET)
						endIf
					endIf
				endIf
			endIf
		elseIf a0g == 0 ; 0 male
			if a1g == 1 ; 1 female
					bool a0v = True
					bool a1v = True
					if a0.HasSpell(SuH_sex_inact)
						a0v = false
					else
						a0v = SexLab.IsValidActor(a0)
					endIf
					if a1.HasSpell(SuH_sex_inact)
						a1v = false
					else
						a1v = SexLab.IsValidActor(a1)
					endIf
				if a0v == TRUE && a1v == TRUE ; if valid
					actor[] animActor = new actor[2]
					animActor[0] = a1
					animActor[1] = a0
					if victimActor != none ; if aggressive
							if victimActor == a1 ; if female victim
							sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
							SexLab.StartSex(animActor, animSET, victim=victimActor)
						else ; if male attacker
							if SuH_SETrestrictact.GetValue()
								sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"Cowgirl", "Lesbian", requireAll=true)
								SexLab.StartSex(animActor, animSET, victim=victimActor)
							else
								sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
								SexLab.StartSex(animActor, animSET, victim=victimActor)
							endIf
						endIf
					else ; if non-aggressive
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
						SexLab.StartSex(animActor, animSET)
					endIf
				endIf
			elseif a1g == 3 ; 1 female creature
					bool a0v = True
					bool a1v = True
					if a0.HasSpell(SuH_sex_inact)
						a0v = false
					else
						a0v = SexLab.IsValidActor(a0)
					endIf
					if a1.HasSpell(SuH_sex_inact)
						a1v = false
					else
						a1v = SexLab.IsValidActor(a1)
					endIf
				if a0v == TRUE && a1v == TRUE ; if valid
					actor[] animActor = new actor[2]
					animActor[0] = a1
					animActor[1] = a0
					if victimActor != none ; if aggressive
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=victimActor)
					else ; if non-aggressive
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
						SexLab.StartSex(animActor, animSET)
					endIf
				endIf
			elseIf SuH_SETallowmalehomo.GetValue()
				if a1g == 0 ; 1 male
					bool a0v = True
					bool a1v = True
					if a0.HasSpell(SuH_sex_inact)
						a0v = false
					else
						a0v = SexLab.IsValidActor(a0)
					endIf
					if a1.HasSpell(SuH_sex_inact)
						a1v = false
					else
						a1v = SexLab.IsValidActor(a1)
					endIf
					if a0v == TRUE && a1v == TRUE ; if valid
						actor[] animActor = new actor[2]
						animActor[0] = a1
						animActor[1] = a0
						if victimActor != none ; if aggressive
							sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
							SexLab.StartSex(animActor, animSET, victim=victimActor)
						else ; if non-aggressive
							sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
							SexLab.StartSex(animActor, animSET)
						endIf
					endIf
				elseif a1g == 2 ; male creature
					bool a0v = True
					bool a1v = True
					if a0.HasSpell(SuH_sex_inact)
						a0v = false
					else
						a0v = SexLab.IsValidActor(a0)
					endIf
					if a1.HasSpell(SuH_sex_inact)
						a1v = false
					else
						a1v = SexLab.IsValidActor(a1)
					endIf
					if a0v == TRUE && a1v == TRUE ; if valid
						actor[] animActor = new actor[2]
						animActor[0] = a1
						animActor[1] = a0
						if victimActor != none ; if aggressive
							if SuH_SETrestrictact.GetValue()
								sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"Cowgirl", "Lesbian", requireAll=true)
								SexLab.StartSex(animActor, animSET, victim=victimActor)
							else
								sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
								SexLab.StartSex(animActor, animSET, victim=victimActor)
							endIf
						else ; if non-aggressive
							sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
							SexLab.StartSex(animActor, animSET)
						endIf
					endIf
				endIf
			endIf
		elseIf a0g == 2 ; 0 male creature
			if a1g == 1 ; 1 female
					bool a0v = True
					bool a1v = True
					if a0.HasSpell(SuH_sex_inact)
						a0v = false
					else
						a0v = SexLab.IsValidActor(a0)
					endIf
					if a1.HasSpell(SuH_sex_inact)
						a1v = false
					else
						a1v = SexLab.IsValidActor(a1)
					endIf
				if a0v == TRUE && a1v == TRUE ; if valid
					actor[] animActor = new actor[2]
					animActor[0] = a1
					animActor[1] = a0
					if victimActor != none ; if aggressive
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=victimActor)
					else ; if non-aggressive
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
						SexLab.StartSex(animActor, animSET)
					endIf
				endIf
			elseIf SuH_SETallowmalehomo.GetValue()
				if a1g == 0 ; 1 male
					bool a0v = True
					bool a1v = True
					if a0.HasSpell(SuH_sex_inact)
						a0v = false
					else
						a0v = SexLab.IsValidActor(a0)
					endIf
					if a1.HasSpell(SuH_sex_inact)
						a1v = false
					else
						a1v = SexLab.IsValidActor(a1)
					endIf
					if a0v == TRUE && a1v == TRUE ; if valid
						actor[] animActor = new actor[2]
						animActor[0] = a1
						animActor[1] = a0
						if victimActor != none ; if aggressive
							sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
							SexLab.StartSex(animActor, animSET, victim=victimActor)
						else ; if non-aggressive
							sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
							SexLab.StartSex(animActor, animSET)
						endIf
					endIf
				endIf
			endIf
		elseIf a0g == 3 ; 0 female creature
			if a1g == 0 ; 1 male
					bool a0v = True
					bool a1v = True
					if a0.HasSpell(SuH_sex_inact)
						a0v = false
					else
						a0v = SexLab.IsValidActor(a0)
					endIf
					if a1.HasSpell(SuH_sex_inact)
						a1v = false
					else
						a1v = SexLab.IsValidActor(a1)
					endIf
				if a0v == TRUE && a1v == TRUE ; if valid
					actor[] animActor = new actor[2]
					animActor[0] = a0
					animActor[1] = a1
					if victimActor != none ; if aggressive
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=victimActor)
					else ; if non-aggressive
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
						SexLab.StartSex(animActor, animSET)
					endIf
				endIf
			elseIf SuH_SETallowfemalehomo.GetValue()
				if a1g == 1 ; 1 female
					bool a0v = True
					bool a1v = True
					if a0.HasSpell(SuH_sex_inact)
						a0v = false
					else
						a0v = SexLab.IsValidActor(a0)
					endIf
					if a1.HasSpell(SuH_sex_inact)
						a1v = false
					else
						a1v = SexLab.IsValidActor(a1)
					endIf
					if a0v == TRUE && a1v == TRUE ; if valid
						actor[] animActor = new actor[2]
						animActor[0] = a0
						animActor[1] = a1
						if victimActor != none ; if aggressive
							sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
							SexLab.StartSex(animActor, animSET, victim=victimActor)
						else ; if non-aggressive
							sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
							SexLab.StartSex(animActor, animSET)
						endIf
					endIf
				endIf
			endIf
		endIf
	elseif sentActor.Length == 1
		bool c0valid = SexLab.IsValidActor(sentActor[0])
		if c0valid == TRUE ; If actor is valid
			int c0g = SexLab.GetGender(sentActor[0])
			if c0g == 1 ;female
				sslBaseAnimation[] animSET = SexLab.GetAnimationsByType(1, 0, 1)
				SexLab.StartSex(sentActor, animSET)
			elseif c0g == 0 ;male
				sslBaseAnimation[] animSET = SexLab.GetAnimationsByType(1, 1, 0)
				SexLab.StartSex(sentActor, animSET)
			endIf
		endIf
	endIf
endFunction
;end/
;ent/ Death Alternative
Function SDrespawn()
	bool notinact = SexLab.IsValidActor(playerRef)
	if notinact == True	
		if playerRef.HasSpell(SuH_sex_inact)
		else
			SuH_CHKsdinact.SetValue(0)
			PlayerRef.SetNoBleedoutRecovery(false)
			PlayerRef.RestoreAV("Health", 100)
			SuH_CHKdied.SetValue(1)
			SuH_sd_returnpoint.MoveTo(PlayerRef)
			Utility.Wait(0.5)
			notinact = SexLab.IsValidActor(playerRef)
			if notinact == True
				PlayerRef.MoveTo(SuH_sevaspawn)
				SuH_sdr_lostchest.RemoveItem(Gold001, 999999)
				if SuH_SETsdloseequip.GetValue()
					;Destroy Equipped
					Form leftHand = PlayerRef.GetEquippedObject(0)
					Form rightHand = PlayerRef.GetEquippedObject(1)
					
					if (leftHand)
						PlayerRef.RemoveItem(leftHand, 1, true, SuH_sd_goldchest)
					endIf
					if (rightHand)
						PlayerRef.RemoveItem(rightHand, 1, true, SuH_sd_goldchest)
					endIf
					
					int slotsChecked
					slotsChecked += 0x00100000
					slotsChecked += 0x00200000 ;ignore reserved slots
					slotsChecked += 0x80000000
					
					int thisSlot = 0x01
					while (thisSlot < 0x80000000)
						if(Math.LogicalAnd(slotsChecked, thisSlot) != thisSlot) ;Only check un-checked slots
							Armor thisArmor = PlayerRef.GetWornForm(thisSlot) as Armor
							if (thisArmor)
								slotsChecked += thisArmor.GetSlotMask() ;add slots to slotsChecked
								PlayerRef.RemoveItem(thisArmor, 1, true, SuH_sd_goldchest)
							else ; No armor found
								slotsChecked += thisSlot
							endIf
						endIf
						thisSlot *= 2;double number and move to the next slot
					endWhile
				endIf
				if SuH_SETsdloseitems.GetValue()
					if SuH_SETsdlosegold.GetValue()
						PlayerRef.RemoveItem(Gold001, 999999, true)
						PlayerRef.RemoveAllItems(SuH_sdr_lostchest, true)
					else
						PlayerRef.RemoveItem(Gold001, 999999, true, SuH_sd_goldchest)
						PlayerRef.RemoveAllItems(SuH_sdr_lostchest, true)
						SuH_sd_goldchest.RemoveItem(Gold001, 999999, true, PlayerRef)
					endIf
				elseif SuH_SETsdlosegold.GetValue()
					PlayerRef.RemoveItem(Gold001, 999999, true)
				endIf
			else
				SuH_CHKsdinact.SetValue(1)
			endIf
		endIf
	endIf
endFunction
;end/
;ent/ Pet Stat
; [petID - Which actor is being modified]
	; dog = SuH_actor_dog
	; so on....
; Level calculation Guide
	; When summoning actors give them their bonus effects
	; Pets gain bonuses every 3 levels
Function statPet(string petID)
	if petID == "dog"
		actor char = SuH_actor_dog
		int z = Math.Floor(SuH_PETdoglevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "wolf"
		actor char = SuH_actor_wolf
		int z = Math.Floor(SuH_PETwolflevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "horse"
		actor char = SuH_actor_horse
		int z = Math.Floor(SuH_PEThorselevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "skeever"
		actor char = SuH_actor_skeever
		int z = Math.Floor(SuH_PETskeeverlevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "familiar"
		actor char = SuH_actor_familiar
		int z = Math.Floor(SuH_PETfamiliarlevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "bear"
		actor char = SuH_actor_bear
		int z = Math.Floor(SuH_PETbearlevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "sabrecat"
		actor char = SuH_actor_sabrecat
		int z = Math.Floor(SuH_PETsabrecatlevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "draugr"
		actor char = SuH_actor_draugr
		int z = Math.Floor(SuH_PETdraugrlevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "troll"
		actor char = SuH_actor_troll
		int z = Math.Floor(SuH_PETtrolllevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "spriggan"
		actor char = SuH_actor_spriggan
		int z = Math.Floor(SuH_PETsprigganlevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "horker"
		actor char = SuH_actor_horker
		int z = Math.Floor(SuH_PEThorkerlevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "falmer"
		actor char = SuH_actor_falmer
		int z = Math.Floor(SuH_PETfalmerlevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "husky"
		actor char = SuH_actor_husky
		int z = Math.Floor(SuH_PEThuskylevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "bristle"
		actor char = SuH_actor_bristle
		int z = Math.Floor(SuH_PETbristlelevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "seeker"
		actor char = SuH_actor_seeker
		int z = Math.Floor(SuH_PETseekerlevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "gargoyle"
		actor char = SuH_actor_gargoyle
		int z = Math.Floor(SuH_PETgargoylelevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "netch"
		actor char = SuH_actor_netch
		int z = Math.Floor(SuH_PETnetchlevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "riekling"
		actor char = SuH_actor_riekling
		int z = Math.Floor(SuH_PETrieklinglevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	elseif petID == "spider"
		actor char = SuH_actor_spider
		int z = Math.Floor(SuH_PETspiderlevel.GetValue() * 20 + 50)
		char.SetActorValue("health", z)
		char.SetActorValue("magicka", z)
		char.SetActorValue("stamina", z)
	endIf
endFunction
;end/
;ent/ Pet XP
; [petID - Which actor is being leveled by ID name ]
	; summoner = PlayerRef
	; dog = SuH_actor_dog
	; so on....
; [sceneID - What scenario the XP was gained with]
	; c=consent a=aggressor v=victim / p=player n=npc
	; example c_p=consent with player
; [valueINT - amount of XP earned in a non-scene]
	; Default is 0 (used as an override for bonuses)
; [actionID - Action which gained XP (none expects default situation)]
	; Bonus scenario ID
Function xpPet(string petID, string sceneID="none", int valueINT=0, string actionID="none")
	if petID == "summoner"
		if valueINT != 0
			int x = Math.Floor(valueINT + SuH_PETsummonxp.GetValue())
			SuH_PETsummonxp.SetValue(x)
			levelPet("summoner")
		else
			int x = Math.Floor(5 + SuH_PETsummonxp.GetValue())
			SuH_PETsummonxp.SetValue(x)
			levelPet("summoner")
		endIf
	elseif petID == "dog" ; if actor is dog
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETdogxp.GetValue())
				SuH_PETdogxp.SetValue(x)
				levelPet("dog")
			else
				int x = Math.Floor(10 + SuH_PETdogxp.GetValue())
				SuH_PETdogxp.SetValue(x)
				levelPet("dog")
			endIf
		endIf
	elseif petID == "wolf" ; if actor is wolf
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETwolfxp.GetValue())
				SuH_PETwolfxp.SetValue(x)
				levelPet("wolf")
			else
				int x = Math.Floor(10 + SuH_PETwolfxp.GetValue())
				SuH_PETwolfxp.SetValue(x)
				levelPet("wolf")
			endIf
		endIf
	elseif petID == "horse" ; if actor is horse
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PEThorsexp.GetValue())
				SuH_PEThorsexp.SetValue(x)
				levelPet("horse")
			else
				int x = Math.Floor(10 + SuH_PEThorsexp.GetValue())
				SuH_PEThorsexp.SetValue(x)
				levelPet("horse")
			endIf
		endIf
	elseif petID == "skeever" ; if actor is skeever
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETskeeverxp.GetValue())
				SuH_PETskeeverxp.SetValue(x)
				levelPet("skeever")
			else
				int x = Math.Floor(10 + SuH_PETskeeverxp.GetValue())
				SuH_PETskeeverxp.SetValue(x)
				levelPet("skeever")
			endIf
		endIf
	elseif petID == "familiar" ; if actor is familiar
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETfamiliarxp.GetValue())
				SuH_PETfamiliarxp.SetValue(x)
				levelPet("familiar")
			else
				int x = Math.Floor(10 + SuH_PETfamiliarxp.GetValue())
				SuH_PETfamiliarxp.SetValue(x)
				levelPet("familiar")
			endIf
		endIf
	elseif petID == "bear" ; if actor is bear
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETbearxp.GetValue())
				SuH_PETbearxp.SetValue(x)
				levelPet("bear")
			else
				int x = Math.Floor(10 + SuH_PETbearxp.GetValue())
				SuH_PETbearxp.SetValue(x)
				levelPet("bear")
			endIf
		endIf
	elseif petID == "sabrecat" ; if actor is sabrecat
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETsabrecatxp.GetValue())
				SuH_PETsabrecatxp.SetValue(x)
				levelPet("sabrecat")
			else
				int x = Math.Floor(10 + SuH_PETsabrecatxp.GetValue())
				SuH_PETsabrecatxp.SetValue(x)
				levelPet("sabrecat")
			endIf
		endIf
	elseif petID == "draugr" ; if actor is draugr
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETdraugrxp.GetValue())
				SuH_PETdraugrxp.SetValue(x)
				levelPet("draugr")
			else
				int x = Math.Floor(10 + SuH_PETdraugrxp.GetValue())
				SuH_PETdraugrxp.SetValue(x)
				levelPet("draugr")
			endIf
		endIf
	elseif petID == "troll" ; if actor is troll
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETtrollxp.GetValue())
				SuH_PETtrollxp.SetValue(x)
				levelPet("troll")
			else
				int x = Math.Floor(10 + SuH_PETtrollxp.GetValue())
				SuH_PETtrollxp.SetValue(x)
				levelPet("troll")
			endIf
		endIf
	elseif petID == "spriggan" ; if actor is spriggan
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETsprigganxp.GetValue())
				SuH_PETsprigganxp.SetValue(x)
				levelPet("spriggan")
			else
				int x = Math.Floor(10 + SuH_PETsprigganxp.GetValue())
				SuH_PETsprigganxp.SetValue(x)
				levelPet("spriggan")
			endIf
		endIf
	elseif petID == "horker" ; if actor is horker
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PEThorkerxp.GetValue())
				SuH_PEThorkerxp.SetValue(x)
				levelPet("horker")
			else
				int x = Math.Floor(10 + SuH_PEThorkerxp.GetValue())
				SuH_PEThorkerxp.SetValue(x)
				levelPet("horker")
			endIf
		endIf
	elseif petID == "falmer" ; if actor is falmer
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETfalmerxp.GetValue())
				SuH_PETfalmerxp.SetValue(x)
				levelPet("falmer")
			else
				int x = Math.Floor(10 + SuH_PETfalmerxp.GetValue())
				SuH_PETfalmerxp.SetValue(x)
				levelPet("falmer")
			endIf
		endIf
	elseif petID == "husky"
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PEThuskyxp.GetValue())
				SuH_PEThuskyxp.SetValue(x)
				levelPet("husky")
			else
				int x = Math.Floor(10 + SuH_PEThuskyxp.GetValue())
				SuH_PEThuskyxp.SetValue(x)
				levelPet("husky")
			endIf
		endIf
	elseif petID == "bristle"
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETbristlexp.GetValue())
				SuH_PETbristlexp.SetValue(x)
				levelPet("bristle")
			else
				int x = Math.Floor(10 + SuH_PETbristlexp.GetValue())
				SuH_PETbristlexp.SetValue(x)
				levelPet("bristle")
			endIf
		endIf
	elseif petID == "seeker"
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETseekerxp.GetValue())
				SuH_PETseekerxp.SetValue(x)
				levelPet("seeker")
			else
				int x = Math.Floor(10 + SuH_PETseekerxp.GetValue())
				SuH_PETseekerxp.SetValue(x)
				levelPet("seeker")
			endIf
		endIf
	elseif petID == "gargoyle"
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETgargoylexp.GetValue())
				SuH_PETgargoylexp.SetValue(x)
				levelPet("gargoyle")
			else
				int x = Math.Floor(10 + SuH_PETgargoylexp.GetValue())
				SuH_PETgargoylexp.SetValue(x)
				levelPet("gargoyle")
			endIf
		endIf
	elseif petID == "netch"
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETnetchxp.GetValue())
				SuH_PETnetchxp.SetValue(x)
				levelPet("netch")
			else
				int x = Math.Floor(10 + SuH_PETnetchxp.GetValue())
				SuH_PETnetchxp.SetValue(x)
				levelPet("netch")
			endIf
		endIf
	elseif petID == "riekling"
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETrieklingxp.GetValue())
				SuH_PETrieklingxp.SetValue(x)
				levelPet("riekling")
			else
				int x = Math.Floor(10 + SuH_PETrieklingxp.GetValue())
				SuH_PETrieklingxp.SetValue(x)
				levelPet("riekling")
			endIf
		endIf
	elseif petID == "spider"
		if actionID == "hit"
			;; INSERT HEALTH RETREAT CHECK ::
		elseif sceneID != "none" ; if in a scene
			if actionID == "orgasm" ; if triggered from orgasm
				int x = Math.Floor(50 + SuH_PETrieklingxp.GetValue())
				SuH_PETrieklingxp.SetValue(x)
				levelPet("spider")
			else
				int x = Math.Floor(10 + SuH_PETrieklingxp.GetValue())
				SuH_PETrieklingxp.SetValue(x)
				levelPet("spider")
			endIf
		endIf
	endIf
endFunction
;end/
;ent/ Pet Level
	; [PetID - Which actor is being leveled by ID name]
	; SummonerXP Gain = 20 + (4 * tier)
Function levelPet(string petID)
	if petID == "summoner"
		int xp = SuH_PETsummonxp.GetValue() as int
		int level = SuH_PETsummonlevel.GetValue() as int
		int levelcost = Math.Floor((level*1.8) * 40 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETsummonxp.SetValue(xp)
			SuH_PETsummonlevel.SetValue(level)
			; Display Message
			if level > 4
				debug.Notification("Summoner level has increased to "+level+"!")
			elseif level == 4
				SuH_PETfamiliarunlock.SetValue(1)
				SuH_PETsabrecatunlock.SetValue(1)
				SuH_PETfalmerunlock.SetValue(1)
				SuH_PETtrollunlock.SetValue(1)
				SuH_PETgargoyleunlock.SetValue(1)
				debug.Notification("Summoner level has increased to "+level+"! New Summons Unlocked!")
			elseif level == 3
				SuH_PEThorseunlock.SetValue(1)
				SuH_PEThorkerunlock.SetValue(1)
				SuH_PETsprigganunlock.SetValue(1)
				SuH_PETbearunlock.SetValue(1)
				SuH_PEThuskyunlock.SetValue(1)
				SuH_PETseekerunlock.SetValue(1)
				debug.Notification("Summoner level has increased to "+level+"! New Summons Unlocked!")
			elseif level == 2
				SuH_PETwolfunlock.SetValue(1)
				SuH_PETdraugrunlock.SetValue(1)
				SuH_PETbristleunlock.SetValue(1)
				SuH_PETnetchunlock.SetValue(1)
				SuH_PETrieklingunlock.SetValue(1)
				SuH_PETspiderunlock.SetValue(1)
				debug.Notification("Summoner level has increased to "+level+"! New Summons Unlocked!")
			elseif level == 1
				SuH_PETskeeverunlock.SetValue(1)
				debug.Notification("Summoner level has increased to "+level+"! New Summons Unlocked!")
			else
				debug.Notification("Summoner level has increased to "+level+"!")
			endIf
		endIf
	elseif petID == "dog"
		int xp = SuH_PETdogxp.GetValue() as int
		int level = SuH_PETdoglevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETdogxp.SetValue(xp)
			SuH_PETdoglevel.SetValue(level)
			statPet("dog")
			xpPET("summoner", valueINT=20)
			; Display Message
				debug.Notification("Dog [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "wolf"
		int xp = SuH_PETwolfxp.GetValue() as int
		int level = SuH_PETwolflevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETwolfxp.SetValue(xp)
			SuH_PETwolflevel.SetValue(level)
			statPet("wolf")
			xpPET("summoner", valueINT=28)
			; Display Message
				debug.Notification("Wolf [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "horse"
		int xp = SuH_PEThorsexp.GetValue() as int
		int level = SuH_PEThorselevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PEThorsexp.SetValue(xp)
			SuH_PEThorselevel.SetValue(level)
			statPet("horse")
			xpPET("summoner", valueINT=32)
			; Display Message
				debug.Notification("Horse [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "skeever"
		int xp = SuH_PETskeeverxp.GetValue() as int
		int level = SuH_PETskeeverlevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETskeeverxp.SetValue(xp)
			SuH_PETskeeverlevel.SetValue(level)
			statPet("skeever")
			xpPET("summoner", valueINT=24)
			; Display Message
				debug.Notification("Skeever [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "familiar"
		int xp = SuH_PETfamiliarxp.GetValue() as int
		int level = SuH_PETfamiliarlevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETfamiliarxp.SetValue(xp)
			SuH_PETfamiliarlevel.SetValue(level)
			statPet("familiar")
			xpPET("summoner", valueINT=36)
			; Display Message
			debug.Notification("Flame Familiar [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "bear"
		int xp = SuH_PETbearxp.GetValue() as int
		int level = SuH_PETbearlevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETbearxp.SetValue(xp)
			SuH_PETbearlevel.SetValue(level)
			statPet("bear")
			xpPET("summoner", valueINT=32)
			; Display Message
			debug.Notification("Bear [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "sabrecat"
		int xp = SuH_PETsabrecatxp.GetValue() as int
		int level = SuH_PETsabrecatlevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETsabrecatxp.SetValue(xp)
			SuH_PETsabrecatlevel.SetValue(level)
			statPet("sabrecat")
			xpPET("summoner", valueINT=36)
			; Display Message
				debug.Notification("Sabre Cat [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "draugr"
		int xp = SuH_PETdraugrxp.GetValue() as int
		int level = SuH_PETdraugrlevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETdraugrxp.SetValue(xp)
			SuH_PETdraugrlevel.SetValue(level)
			statPet("draugr")
			xpPET("summoner", valueINT=28)
			; Display Message
				debug.Notification("Draugr [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "troll"
		int xp = SuH_PETtrollxp.GetValue() as int
		int level = SuH_PETtrolllevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETtrollxp.SetValue(xp)
			SuH_PETtrolllevel.SetValue(level)
			statPet("troll")
			xpPET("summoner", valueINT=36)
			; Display Message
			debug.Notification("Troll [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "Spriggan"
		int xp = SuH_PETSprigganxp.GetValue() as int
		int level = SuH_PETSprigganlevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETSprigganxp.SetValue(xp)
			SuH_PETSprigganlevel.SetValue(level)
			statPet("spriggan")
			xpPET("summoner", valueINT=32)
			; Display Message
				debug.Notification("Spriggan [Succubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "horker"
		int xp = SuH_PEThorkerxp.GetValue() as int
		int level = SuH_PEThorkerlevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PEThorkerxp.SetValue(xp)
			SuH_PEThorkerlevel.SetValue(level)
			statPet("horker")
			xpPET("summoner", valueINT=32)
			; Display Message
			debug.Notification("Horker [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "falmer"
		int xp = SuH_PETfalmerxp.GetValue() as int
		int level = SuH_PETfalmerlevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETfalmerxp.SetValue(xp)
			SuH_PETfalmerlevel.SetValue(level)
			statPet("falmer'")
			xpPET("summoner", valueINT=36)
			; Display Message
			debug.Notification("Falmer [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "husky"
		int xp = SuH_PEThuskyxp.GetValue() as int
		int level = SuH_PEThuskylevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PEThuskyxp.SetValue(xp)
			SuH_PEThuskylevel.SetValue(level)
			statPet("husky")
			xpPET("summoner", valueINT=32)
			; Display Message
			debug.Notification("Husky [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "bristle"
		int xp = SuH_PETbristlexp.GetValue() as int
		int level = SuH_PETbristlelevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETbristlexp.SetValue(xp)
			SuH_PETbristlelevel.SetValue(level)
			statPet("bristle")
			xpPET("summoner", valueINT=32)
			; Display Message
			debug.Notification("Bristle [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "seeker"
		int xp = SuH_PETseekerxp.GetValue() as int
		int level = SuH_PETseekerlevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETseekerxp.SetValue(xp)
			SuH_PETseekerlevel.SetValue(level)
			statPet("seeker")
			xpPET("summoner", valueINT=32)
			; Display Message
			debug.Notification("Seeker [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "gargoyle"
		int xp = SuH_PETgargoylexp.GetValue() as int
		int level = SuH_PETgargoylelevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETgargoylexp.SetValue(xp)
			SuH_PETgargoylelevel.SetValue(level)
			statPet("gargoyle")
			xpPET("summoner", valueINT=32)
			; Display Message
			debug.Notification("Gargoyle [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "netch"
		int xp = SuH_PETnetchxp.GetValue() as int
		int level = SuH_PETnetchlevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETnetchxp.SetValue(xp)
			SuH_PETnetchlevel.SetValue(level)
			statPet("netch")
			xpPET("summoner", valueINT=32)
			; Display Message
			debug.Notification("Netch [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "riekling"
		int xp = SuH_PETrieklingxp.GetValue() as int
		int level = SuH_PETrieklinglevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETrieklingxp.SetValue(xp)
			SuH_PETrieklinglevel.SetValue(level)
			statPet("riekling")
			xpPET("summoner", valueINT=32)
			; Display Message
			debug.Notification("Riekling [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	elseif petID == "spider"
		int xp = SuH_PETspiderxp.GetValue() as int
		int level = SuH_PETspiderlevel.GetValue() as int
		int levelcost = Math.Floor((level*2) * 50 + 20)
		if xp >= levelcost
			xp -= levelcost
			level += 1
			SuH_PETspiderxp.SetValue(xp)
			SuH_PETspiderlevel.SetValue(level)
			statPet("spider")
			xpPET("summoner", valueINT=32)
			; Display Message
			debug.Notification("Spider [Incubus] level has increased to "+level+"! Stats have been given a boost!")
		endIf
	endIf
endFunction
;end/
;ent/ Pet Death
Function deathPet(string petID)
	if petID == "bear"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_bear
		char.MoveTo(SuH_realm_petreturn)
		SuH_PETactivebear.SetValue(0)
		char.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "dog"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_dog
		SuH_actor_dog.MoveTo(SuH_realm_petreturn)
		SuH_PETactivedog.SetValue(0)
		SuH_actor_dog.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "draugr"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_draugr
		SuH_actor_draugr.MoveTo(SuH_realm_petreturn)
		SuH_PETactivedraugr.SetValue(0)
		SuH_actor_draugr.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "falmer"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_falmer
		SuH_actor_falmer.MoveTo(SuH_realm_petreturn)
		SuH_PETactivefalmer.SetValue(0)
		SuH_actor_falmer.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "familiar"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_familiar
		SuH_actor_familiar.MoveTo(SuH_realm_petreturn)
		SuH_PETactivefamiliar.SetValue(0)
		SuH_actor_familiar.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "horker"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_horker
		SuH_actor_horker.MoveTo(SuH_realm_petreturn)
		SuH_PETactivehorker.SetValue(0)
		SuH_actor_horker.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "horse"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_horse
		SuH_actor_horse.MoveTo(SuH_realm_petreturn)
		SuH_PETactivehorse.SetValue(0)
		SuH_actor_horse.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "sabrecat"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_sabrecat
		SuH_actor_sabrecat.MoveTo(SuH_realm_petreturn)
		SuH_PETactivesabrecat.SetValue(0)
		SuH_actor_sabrecat.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "skeever"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_skeever
		SuH_actor_skeever.MoveTo(SuH_realm_petreturn)
		SuH_PETactiveskeever.SetValue(0)
		SuH_actor_skeever.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "spriggan"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_spriggan
		SuH_actor_spriggan.MoveTo(SuH_realm_petreturn)
		SuH_PETactivespriggan.SetValue(0)
		SuH_actor_spriggan.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "troll"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_troll
		SuH_actor_troll.MoveTo(SuH_realm_petreturn)
		SuH_PETactivetroll.SetValue(0)
		SuH_actor_troll.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "wolf"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_wolf
		SuH_actor_wolf.MoveTo(SuH_realm_petreturn)
		SuH_PETactivewolf.SetValue(0)
		SuH_actor_wolf.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "husky"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_husky
		SuH_actor_husky.MoveTo(SuH_realm_petreturn)
		SuH_PETactivehusky.SetValue(0)
		SuH_actor_husky.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "bristle"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_bristle
		SuH_actor_bristle.MoveTo(SuH_realm_petreturn)
		SuH_PETactivebristle.SetValue(0)
		SuH_actor_bristle.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "seeker"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_seeker
		SuH_actor_seeker.MoveTo(SuH_realm_petreturn)
		SuH_PETactiveseeker.SetValue(0)
		SuH_actor_seeker.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "gargoyle"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_gargoyle
		SuH_actor_gargoyle.MoveTo(SuH_realm_petreturn)
		SuH_PETactivegargoyle.SetValue(0)
		SuH_actor_gargoyle.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "netch"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_netch
		SuH_actor_netch.MoveTo(SuH_realm_petreturn)
		SuH_PETactivenetch.SetValue(0)
		SuH_actor_netch.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "riekling"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_riekling
		SuH_actor_riekling.MoveTo(SuH_realm_petreturn)
		SuH_PETactiveriekling.SetValue(0)
		SuH_actor_riekling.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	elseif petID == "Spider"
		(pDialogueFollower as DialogueFollowerScript).DismissAnimal()
		actor char = SuH_actor_spider
		SuH_actor_spider.MoveTo(SuH_realm_petreturn)
		SuH_PETactivespider.SetValue(0)
		SuH_actor_spider.Resurrect()
		debug.Notification("Soul Pet has fallen and returned to the Succubus Realm")
	endIf
endFunction
;end/
;ent/ Craft Points
Function CRAFTPOINTcalc()
	if craftpoints > 10
		int x = Math.Floor(craftpoints * 0.1)
		int y = Math.Floor(x +SuH_craft_points.GetValue())
		craftpoints -= (x * 10)
	endIf
endFunction
;end/
;ent/ Crafting Cost
int Function CRAFTCOSTcalc(string itemtocraft)
		;ent/ Common Var
		int craftlevel = SuH_craft_level.GetValue() as int
		int craftcost = 0
		int craftcostmin = 0
		int craftitem = 0
		;end/
		; Grab itemtocraft
			; 1 Craft Level = -5 points
			; Min = 10 + \
				; 1 Gold = 1 points
				; 1 Weight = 2 points
				; 1 Armor = 2 points
				; 1 Damage = 2 points
		;ent/ Utility
		if itemtocraft == "lockpick"
			craftcost = 36
			craftcostmin = 12
		;end/
		;ent/ Weapon
		elseif itemtocraft == "Ebony Greatsword"
			craftcost = 4614
			craftcostmin = 1538
		elseif itemtocraft == "Ebony Sword"
			craftcost = 2358
			craftcostmin = 786
		elseif itemtocraft == "Ebony Dagger"
			craftcost = 990
			craftcostmin = 330
		elseif itemtocraft == "Glass Greatsword"
			craftcost = 2748
			craftcostmin = 916
		elseif itemtocraft == "Glass Sword"
			craftcost = 1416
			craftcostmin = 472
		elseif itemtocraft == "Glass Dagger"
			craftcost = 606
			craftcostmin = 202
		elseif itemtocraft == "Elven Greatsword"
			craftcost = 2748
			craftcostmin = 916
		elseif itemtocraft == "Elven Sword"
			craftcost = 879
			craftcostmin = 293
		elseif itemtocraft == "Elven Dagger"
			craftcost = 387
			craftcostmin = 129
		elseif itemtocraft == "Dwarven Greatsword"
			craftcost = 1068
			craftcostmin = 356
		elseif itemtocraft == "Dwarven Sword"
			craftcost = 567
			craftcostmin = 189
		elseif itemtocraft == "Dwarven Dagger"
			craftcost = 258
			craftcostmin = 86
		elseif itemtocraft == "Steel Greatsword"
			craftcost = 504
			craftcostmin = 168
		elseif itemtocraft == "Steel Sword"
			craftcost = 273
			craftcostmin = 91
		elseif itemtocraft == "Steel Dagger"
			craftcost = 129
			craftcostmin = 43
		elseif itemtocraft == "Iron Greatsword"
			craftcost = 366
			craftcostmin = 122
		elseif itemtocraft == "Iron Sword"
			craftcost = 201
			craftcostmin = 67
		elseif itemtocraft == "Iron Dagger"
			craftcost = 96
			craftcostmin = 32
		;end/
		;ent/ Light Armor
		elseif itemtocraft == "Dragonscale Shield"
			craftcost = 2490
			craftcostmin = 830
		elseif itemtocraft == "Dragonscale Helm"
			craftcost = 2406
			craftcostmin = 802
		elseif itemtocraft == "Dragonscale Gaunts"
			craftcost = 1020
			craftcostmin = 340
		elseif itemtocraft == "Dragonscale Boots"
			craftcost = 1020
			craftcostmin = 340
		elseif itemtocraft == "Dragonscale Armor"
			craftcost = 4836
			craftcostmin = 1612
		elseif itemtocraft == "Glass Sheild"
			craftcost = 1578
			craftcostmin = 526
		elseif itemtocraft == "Glass Helm"
			craftcost = 1488
			craftcostmin = 496
		elseif itemtocraft == "Glass Gaunts"
			craftcost = 678
			craftcostmin = 226
		elseif itemtocraft == "Glass Boots"
			craftcost = 678
			craftcostmin = 226
		elseif itemtocraft == "Glass Armor"
			craftcost = 3000
			craftcostmin = 1000
		elseif itemtocraft == "Elven Shield"
			craftcost = 525
			craftcostmin = 175
		elseif itemtocraft == "Elven Helm"
			craftcost = 450
			craftcostmin = 150
		elseif itemtocraft == "Elven Gaunts"
			craftcost = 225
			craftcostmin = 75
		elseif itemtocraft == "Elven Boots"
			craftcost = 225
			craftcostmin = 75
		elseif itemtocraft == "Elven Armor"
			craftcost =  903
			craftcostmin = 301
		elseif itemtocraft == "Leather Helm"
			craftcost = 294
			craftcostmin = 98
		elseif itemtocraft == "Leather Gaunts"
			craftcost = 159
			craftcostmin = 53
		elseif itemtocraft == "Leather Boots"
			craftcost = 159
			craftcostmin = 53
		elseif itemtocraft == "Leather Armor"
			craftcost = 597
			craftcostmin = 199
		elseif itemtocraft == "Hide Armor"
			craftcost = 330
			craftcostmin = 110
		elseif itemtocraft == "Hide Boots"
			craftcost = 96
			craftcostmin = 32
		elseif itemtocraft == "Hide Gaunts"
			craftcost = 96
			craftcostmin = 32
		elseif itemtocraft == "Hide Helm"
			craftcost = 177
			craftcostmin = 59
		elseif itemtocraft == "Hide Shield"
			craftcost = 219
			craftcostmin = 73
		;end/
		;ent/ Heavy Armor
		elseif itemtocraft == "Dragonplate Shield"
			craftcost = 3432
			craftcostmin = 1144
		elseif itemtocraft == "Dragonplate Helm"
			craftcost = 3360
			craftcostmin = 1120
		elseif itemtocraft == "Dragonplate Gaunts"
			craftcost = 1455
			craftcostmin = 485
		elseif itemtocraft == "Dragonplate Boots"
			craftcost = 1455
			craftcostmin = 485
		elseif itemtocraft == "Dragonplate Armor"
			craftcost = 6891
			craftcostmin = 2297
		elseif itemtocraft == "Ebony Shield"
			craftcost = 2556
			craftcostmin = 852
		elseif itemtocraft == "Ebony Helm"
			craftcost = 2463
			craftcostmin = 821
		elseif itemtocraft == "Ebony Gaunts"
			craftcost = 843
			craftcostmin = 281
		elseif itemtocraft == "Ebony Boots"
			craftcost = 843
			craftcostmin = 281
		elseif itemtocraft == "Ebony Armor"
			craftcost = 5016
			craftcostmin = 1672
		elseif itemtocraft == "Dwarven Shield"
			craftcost = 933
			craftcostmin = 311
		elseif itemtocraft == "Dwarven Helm"
			craftcost = 798
			craftcostmin = 266
		elseif itemtocraft == "Dwarven Gaunts"
			craftcost = 411
			craftcostmin = 137
		elseif itemtocraft == "Dwarven Boots"
			craftcost = 411
			craftcostmin = 137
		elseif itemtocraft == "Dwarven Armor"
			craftcost = 1704
			craftcostmin = 568
		elseif itemtocraft == "Steel Sheild"
			craftcost = 696
			craftcostmin = 232
		elseif itemtocraft == "Steel Helm"
			craftcost = 537
			craftcostmin = 179
		elseif itemtocraft == "Steel Gaunts"
			craftcost = 315
			craftcostmin = 105
		elseif itemtocraft == "Steel Boots"
			craftcost = 315
			craftcostmin = 105
		elseif itemtocraft == "Steel Armor"
			craftcost = 1248
			craftcostmin = 416
		elseif itemtocraft == "Iron Armor"
			craftcost = 735
			craftcostmin = 245
		elseif itemtocraft == "Iron Boots"
			craftcost = 201
			craftcostmin = 67
		elseif itemtocraft == "Iron Gaunts"
			craftcost = 201
			craftcostmin = 67
		elseif itemtocraft == "Iron Helm"
			craftcost = 330
			craftcostmin = 110
		elseif itemtocraft == "Iron Shield"
			craftcost = 402
			craftcostmin = 134
		;end/
		endIf
		craftcost -= (craftlevel * 5)
		if craftcost < craftcostmin
			craftcost = craftcostmin
		endIf
		return craftcost
endFunction
;end/
;ent/ Crafting
Function CRAFTcalc(string itemtocraft="none")
	
	int craftcost = CRAFTCOSTcalc(itemtocraft)
	int craftlevel = SuH_craft_level.GetValue() as int
	
	int x = SuH_craft_points.GetValue() as int
	if craftcost <= x
		x -= craftcost
		SuH_craft_points.SetValue(x)
			
		int craftxp = SuH_craft_xp.GetValue() as int
		craftxp += craftcost
		int levelreq = 1000
		if craftlevel != 0
			levelreq = Math.Floor(craftlevel*2000)
		endIf
		if craftxp > levelreq
			craftlevel += 1
			SuH_craft_level.SetValue(craftlevel)
			craftxp -= levelreq
			SuH_craft_xp.SetValue(craftxp)
			Debug.MessageBox("Crafting Level Up!")
		else
			SuH_craft_xp.SetValue(craftxp)
		endIf
		
		if itemtocraft == "Lockpick"
			playerRef.AddItem(Lockpick, 1)
		elseif itemtocraft == "Ebony Greatsword"
			playerRef.AddItem(EbonyGreatsword, 1)
		elseif itemtocraft == "Ebony Sword"
			playerRef.AddItem(EbonySword, 1)
		elseif itemtocraft == "Ebony Dagger"
			playerRef.AddItem(EbonyDagger, 1)
		elseif itemtocraft == "Glass Greatsword"
			playerRef.AddItem(GlassGreatsword, 1)
		elseif itemtocraft == "Glass Sword"
			playerRef.AddItem(GlassSword, 1)
		elseif itemtocraft == "Glass Dagger"
			playerRef.AddItem(GlassDagger, 1)
		elseif itemtocraft == "Elven Greatsword"
			playerRef.AddItem(ElvenGreatsword, 1)
		elseif itemtocraft == "Elven Sword"
			playerRef.AddItem(ElvenSword, 1)
		elseif itemtocraft == "Elven Dagger"
			playerRef.AddItem(ElvenDagger, 1)
		elseif itemtocraft == "Dwarven Greatsword"
			playerRef.AddItem(DwarvenGreatsword, 1)
		elseif itemtocraft == "Dwarven Sword"
			playerRef.AddItem(DwarvenSword, 1)
		elseif itemtocraft == "Dwarven Dagger"
			playerRef.AddItem(dwarvendagger, 1)
		elseif itemtocraft == "Steel Greatsword"
			playerRef.AddItem(SteelGreatsword, 1)
		elseif itemtocraft == "Steel Sword"
			playerRef.AddItem(SteelSword, 1)
		elseif itemtocraft == "Steel Dagger"
			playerRef.AddItem(SteelDagger, 1)
		elseif itemtocraft == "Iron Dagger"
			playerRef.AddItem(IronDagger, 1)
		elseif itemtocraft == "Iron Sword"
			playerRef.AddItem(IronSword, 1)
		elseif itemtocraft == "Iron Greatsword"
			playerRef.AddItem(IronGreatsword, 1)
		elseif itemtocraft == "Dragonscale Shield"
			playerRef.AddItem(ArmorDragonscaleShield, 1)
		elseif itemtocraft == "Dragonscale Helm"
			playerRef.AddItem(ArmorDragonscaleHelmet, 1)
		elseif itemtocraft == "Dragonscale Gaunts"
			playerRef.AddItem(ArmorDragonscaleGauntlets, 1)
		elseif itemtocraft == "Dragonscale Boots"
			playerRef.AddItem(ArmorDragonscaleBoots, 1)
		elseif itemtocraft == "Dragonscale Armor"
			playerRef.AddItem(ArmorDragonscaleCuirass, 1)
		elseif itemtocraft == "Glass Shield"
			playerRef.AddItem(ArmorGlassShield, 1)
		elseif itemtocraft == "Glass Helm"
			playerRef.AddItem(ArmorGlassHelmet, 1)
		elseif itemtocraft == "Glass Gaunts"
			playerRef.AddItem(ArmorGlassGauntlets, 1)
		elseif itemtocraft == "Glass Boots"
			playerRef.AddItem(ArmorGlassBoots, 1)
		elseif itemtocraft == "Glass Armor"
			playerRef.AddItem(ArmorGlassCuirass, 1)
		elseif itemtocraft == "Elven Shield"
			playerRef.AddItem(ArmorElvenShield, 1)
		elseif itemtocraft == "Elven Helm"
			playerRef.AddItem(ArmorElvenHelmet, 1)
		elseif itemtocraft == "Elven Gaunts"
			playerRef.AddItem(ArmorElvenGauntlets, 1)
		elseif itemtocraft == "Elven Boots"
			playerRef.AddItem(ArmorElvenBoots, 1)
		elseif itemtocraft == "Elven Armor"
			playerRef.AddItem(ArmorElvenCuirass, 1)
		elseif itemtocraft == "Leather Helm"
			playerRef.AddItem(ArmorLeatherHelmet, 1)
		elseif itemtocraft == "Leather Gaunts"
			playerRef.AddItem(ArmorLeatherGauntlets, 1)
		elseif itemtocraft == "Leather Boots"
			playerRef.AddItem(ArmorLeatherBoots, 1)
		elseif itemtocraft == "Leather Armor"
			playerRef.AddItem(ArmorLeatherCuirass, 1)
		elseif itemtocraft == "Hide Armor"
			playerRef.AddItem(ArmorHideCuirass, 1)
		elseif itemtocraft == "Hide Boots"
			playerRef.AddItem(ArmorHideBoots, 1)
		elseif itemtocraft == "Hide Gaunts"
			playerRef.AddItem(ArmorHideGauntlets, 1)
		elseif itemtocraft == "Hide Helm"
			playerRef.AddItem(ArmorHideHelmet, 1)
		elseif itemtocraft == "Hide Shield"
			playerRef.AddItem(ArmorHideShield, 1)
		elseif itemtocraft == "Dragonplate Shield"
			playerRef.AddItem(ArmorDragonplateShield, 1)
		elseif itemtocraft == "Dragonplate Helm"
			playerRef.AddItem(ArmorDragonplateHelmet, 1)
		elseif itemtocraft == "Dragonplate Gaunts"
			playerRef.AddItem(ArmorDragonplateGauntlets, 1)
		elseif itemtocraft == "Dragonplate Boots"
			playerRef.AddItem(ArmorDragonplateBoots, 1)
		elseif itemtocraft == "Dragonplate Armor"
			playerRef.AddItem(ArmorDragonplateCuirass, 1)
		elseif itemtocraft == "Ebony Shield"
			playerRef.AddItem(ArmorEbonyShield, 1)
		elseif itemtocraft == "Ebony Helm"
			playerRef.AddItem(ArmorEbonyHelmet, 1)
		elseif itemtocraft == "Ebony Guants"
			playerRef.AddItem(ArmorEbonyGauntlets, 1)
		elseif itemtocraft == "Ebony Boots"
			playerRef.AddItem(ArmorEbonyBoots, 1)
		elseif itemtocraft == "Ebony Armor"
			playerRef.AddItem(ArmorEbonyCuirass, 1)
		elseif itemtocraft == "Dwarven Shield"
			playerRef.AddItem(ArmorDwarvenShield, 1)
		elseif itemtocraft == "Dwarven Helm"
			playerRef.AddItem(ArmorDwarvenHelmet, 1)
		elseif itemtocraft == "Dwarven Gaunts"
			playerRef.AddItem(ArmorDwarvenGauntlets, 1)
		elseif itemtocraft == "Dwarven Boots"
			playerRef.AddItem(ArmorDwarvenBoots, 1)
		elseif itemtocraft == "Dwarven Armor"
			playerRef.AddItem(ArmorDwarvenCuirass, 1)
		elseif itemtocraft == "Steel Shield"
			playerRef.AddItem(ArmorSteelShield, 1)
		elseif itemtocraft == "Steel Helm"
			playerRef.AddItem(ArmorSteelHelmetA, 1)
		elseif itemtocraft == "Steel Gaunts"
			playerRef.AddItem(ArmorSteelGauntletsA, 1)
		elseif itemtocraft == "Steel Boots"
			playerRef.AddItem(ArmorSteelBootsA, 1)
		elseif itemtocraft == "Steel Armor"
			playerRef.AddItem(ArmorSteelCuirassA, 1)
		elseif itemtocraft == "Iron Armor"
			playerRef.AddItem(ArmorIronCuirass, 1)
		elseif itemtocraft == "Iron Boots"
			playerRef.AddItem(ArmorIronBoots, 1)
		elseif itemtocraft == "Iron Gaunts"
			playerRef.AddItem(ArmorIronGauntlets, 1)
		elseif itemtocraft == "Iron Helm"
			playerRef.AddItem(ArmorIronHelmet, 1)
		elseif itemtocraft == "Iron Shield"
			playerRef.AddItem(ArmorIronShield, 1)
		endIf
		Debug.MessageBox(itemtocraft + " Crafted")
	else
		Debug.MessageBox("Not Enough Craft Points")
	endIf
endFunction
;end/