ScriptName SuH_Main extends Quest

;ent/ #Include
SexLabFramework property SexLab auto
;end/
;ent/ Globals
GlobalVariable Property SuH_NPChdry auto
GlobalVariable Property SuH_NPCmdry auto
GlobalVariable Property SuH_NPCsdry auto
GlobalVariable Property SuH_MODversion auto
GlobalVariable Property SuH_NPCgenders auto
GlobalVariable Property SuH_PCSheartXP auto
GlobalVariable Property SuH_SETsexdrops auto
GlobalVariable Property SuH_SETinvact auto
GlobalVariable Property SuH_Lsuccubusprowl auto
GlobalVariable Property SuH_Lspermlover auto
GlobalVariable Property SuH_Lmilklover auto
GlobalVariable Property SuH_Lperfectorgasm auto
GlobalVariable Property SuH_Lspeciallover auto
GlobalVariable Property SuH_Lcaringlover auto
GlobalVariable Property SuH_Lmagicallover auto
GlobalVariable Property SuH_Llastinglover auto
GlobalVariable Property SuH_Lhumandesires auto
GlobalVariable Property SuH_Lanimaldesires auto
GlobalVariable Property SuH_Lmasochist auto
GlobalVariable Property SuH_Lmilkdrinker auto
GlobalVariable Property SuH_SETdrainconsent auto
GlobalVariable Property SuH_PCSmaxactstacks auto
GlobalVariable Property SuH_PCSmaxspermstacks auto
GlobalVariable Property SuH_PCSmaxmilkstacks auto
GlobalVariable Property SuH_PCSactstacks auto
GlobalVariable Property SuH_PCSspermstacks auto
GlobalVariable Property SuH_PCSmilkstacks auto
GlobalVariable Property SuH_PCSdesire auto
GlobalVariable Property SuH_PCSdesireOrg auto
;end/	
;ent/ Spells
Spell Property SuH_PCSsubmit auto
Spell Property SuH_PCStraining auto
Spell Property SuH_PCSmastery auto
Spell Property SuH_NPCsvictim auto
Spell Property SuH_NPCsattacker auto
Spell Property SuH_NPCsconsent auto
Spell Property SuH_ss_focusshot auto
Spell Property SuH_ss_sexualenrage auto
Spell Property SuH_ss_silentkiss auto
Spell Property SuH_sp_succubusprowl auto
Spell Property SuH_sp_HealthyDelights auto
Spell Property SuH_sp_ShiningDelights auto
Spell Property SuH_sp_SugaryDelights auto
Spell Property SuH_sp_HealthyMilk auto
Spell Property SuH_sp_ShiningMilk auto
Spell Property SuH_sp_SugaryMilk auto
Spell Property SuH_NPCsmastery auto
Spell Property SuH_NPCssubmit auto
Spell Property SuH_NPCstraining auto
Spell Property SuH_NPCsnconsent auto
Spell Property SuH_NPCsnattacker auto
Spell Property SuH_NPCsnvictim auto
Spell Property SuH_CHAinact auto
Spell Property SuH_csGrace auto
Spell Property SuH_essential auto
Spell Property SuH_sp_spermlover auto
Spell Property SuH_sp_HealthyDelights2 auto
Spell Property SuH_sp_ShiningDelights2 auto
Spell Property SuH_sp_SugaryDelights2 auto
Spell Property SuH_sp_seductivedelights auto
Spell Property SuH_sp_milklover auto
Spell Property SuH_sp_HealthyMilk2 auto
Spell Property SuH_sp_ShiningMilk2 auto
Spell Property SuH_sp_SugaryMilk2 auto
Spell Property SuH_sp_seductivemilk auto
Spell Property SuH_sp_perfectorgasm auto
Spell Property SuH_sp_speciallover auto
Spell Property SuH_sp_caringlover auto
Spell Property SuH_sp_magicallover auto
Spell Property SuH_sp_lastinglover auto
Spell Property SuH_sp_humandesires auto
Spell Property SuH_sp_animaldesires auto
Spell Property SuH_sp_masochist auto
Spell Property SuH_sp_milkdrinker auto
Spell Property SuH_ss_statchecker auto
Spell Property SuH_ss_creatureclaim auto
;end/
;ent/ Magic Effects
MagicEffect Property SuH_sp_perfectorgasmeffect auto
MagicEffect Property SuH_sp_HealthyDelights2effect auto
MagicEffect Property SuH_sp_ShiningDelights2effect auto
MagicEffect Property SuH_sp_SugaryDelights2effect auto
MagicEffect Property SuH_sp_HealthyMilk2effect auto
MagicEffect Property SuH_sp_ShiningMilk2effect auto
MagicEffect Property SuH_sp_SugaryMilk2effect auto
MagicEffect Property SuH_NPCsuccubuseffect auto
;end/
;ent/ Items
Ingredient Property SuH_SpermSticky auto
Ingredient Property SuH_SpermSweet auto
Ingredient Property SuH_SpermThick auto
Ingredient Property SuH_SpermWarm auto
Ingredient Property SuH_SpermPerfect auto
Ingredient Property SuH_MilkWarm auto
Ingredient Property SuH_MilkSweet auto
Ingredient Property SuH_MilkSmooth auto
Ingredient Property SuH_MilkCreamy auto
Ingredient Property SuH_ii_Sperm auto
Ingredient Property SuH_ii_BreastMilk auto
Ingredient Property SuH_ii_SpermCreature auto
Ingredient Property SuH_ii_BreastMilkCreature auto
;end/
;ent/ Factions
Faction Property SuH_tracker auto
Faction Property SuH_friends auto
;end/
;ent/ Actors
Actor Property PlayerRef Auto
;end/
;ent/ Variables
;end/

;ent/ MOD Update
function MODupdate()
	float MODversion = SuH_MODversion.GetValue()
	;ent/ Previous Patches
	If MODversion == 0
		debug.Notification("Succubus Heart : Installing Patches")
	endIf
	If MODversion < 2.1
		if MODversion != 0
			debug.Notification("Succubus Heart : Applying Patch 2.1")
		endIf
		playerRef.AddSpell(SuH_ss_focusshot)
		; playerRef.AddSpell(SuH_ss_sexualenrage)
		; playerRef.AddSpell(SuH_ss_silentkiss)
		; if playerRef.HasSpell(SuH_sp_succubusprowl)
			; SuH_Lsuccubusprowl.SetValue(1)
		; endIf
		SuH_MODversion.SetValue(2.1)
	endIf
	If MODversion < 2.4
		If MODversion != 0
			debug.Notification("Succubus Heart : Applying Patch 2.4")
		endIf
		int x = SuH_PCSheartXP.GetValue() as int
		x += 500
		SuH_PCSheartXP.SetValue(x)
		SuH_MODversion.SetValue(2.4)
	endIf
	If MODversion < 2.61 && MODversion != 0
		debug.Notification("Succubus Heart : Applying Patch 2.61")
		if playerRef.HasSpell(SuH_sp_HealthyDelights2) || playerRef.HasSpell(SuH_sp_ShiningDelights2) || playerRef.HasSpell(SuH_sp_SugaryDelights2) || playerRef.HasSpell(SuH_sp_seductivedelights) || playerRef.HasSpell(SuH_sp_HealthyDelights) || playerRef.HasSpell(SuH_sp_ShiningDelights) || playerRef.HasSpell(SuH_sp_SugaryDelights)
			playerRef.AddSpell(SuH_sp_spermlover)
			playerRef.RemoveSpell(SuH_sp_HealthyDelights)
			playerRef.RemoveSpell(SuH_sp_HealthyDelights2)
			playerRef.RemoveSpell(SuH_sp_ShiningDelights)
			playerRef.RemoveSpell(SuH_sp_ShiningDelights2)
			playerRef.RemoveSpell(SuH_sp_SugaryDelights)
			playerRef.RemoveSpell(SuH_sp_SugaryDelights2)
			playerRef.RemoveSpell(SuH_sp_seductivedelights)
		endIf
		if playerRef.HasSpell(SuH_sp_HealthyMilk2) || playerRef.HasSpell(SuH_sp_ShiningMilk2) || playerRef.HasSpell(SuH_sp_SugaryMilk2) || playerRef.HasSpell(SuH_sp_seductivemilk) || playerRef.HasSpell(SuH_sp_HealthyMilk) || playerRef.HasSpell(SuH_sp_ShiningMilk) || playerRef.HasSpell(SuH_sp_SugaryMilk)
			playerRef.AddSpell(SuH_sp_milklover)
			playerRef.RemoveSpell(SuH_sp_HealthyMilk)
			playerRef.RemoveSpell(SuH_sp_HealthyMilk2)
			playerRef.RemoveSpell(SuH_sp_ShiningMilk)
			playerRef.RemoveSpell(SuH_sp_ShiningMilk2)
			playerRef.RemoveSpell(SuH_sp_SugaryMilk)
			playerRef.RemoveSpell(SuH_sp_SugaryMilk2)
			playerRef.RemoveSpell(SuH_sp_seductivemilk)
		endIf
	endIf
	If MODversion < 2.7
		if MODversion != 0 && MODversion < 2.612
			Debug.Notification("Succubus Heart : Installing Patch 2.7")
			;if playerRef.HasSpell(SuH_sp_succubusprowl)
			;	SuH_Lsuccubusprowl.SetValue(1)
			;endIf
			if playerRef.HasSpell(SuH_sp_spermlover)
				SuH_Lspermlover.SetValue(1)
			endIf
			if playerRef.HasSpell(SuH_sp_milklover)
				SuH_Lmilklover.SetValue(1)
			endIf
			if playerRef.HasSpell(SuH_sp_perfectorgasm)
				SuH_Lperfectorgasm.SetValue(1)
			endIf
			if playerRef.HasSpell(SuH_sp_speciallover)
				SuH_Lspeciallover.SetValue(1)
			endIf
			if playerRef.HasSpell(SuH_sp_caringlover)
				SuH_Lcaringlover.SetValue(1)
			endIf
			if playerRef.HasSpell(SuH_sp_magicallover)
				SuH_Lmagicallover.SetValue(1)
			endIf
			if playerRef.HasSpell(SuH_sp_lastinglover)
				SuH_Llastinglover.SetValue(1)
			endIf
			if playerRef.HasSpell(SuH_sp_humandesires)
				SuH_Lhumandesires.SetValue(1)
			endIf
			if playerRef.HasSpell(SuH_sp_animaldesires)
				SuH_Lanimaldesires.SetValue(1)
			endIf
			if playerRef.HasSpell(SuH_sp_masochist)
				SuH_Lmasochist.SetValue(1)
			endIf
			if playerRef.HasSpell(SuH_sp_milkdrinker)
				SuH_Lmilkdrinker.SetValue(1)
			endIf
			SuH_SETdrainconsent.SetValue(0.5)
		endIf
		SuH_MODversion.SetValue(2.7)
	endIf
	If MODversion < 2.703
		If MODversion != 0
			debug.Notification("Succubus Heart : Installing Patch 2.71")
			SuH_PCSmaxactstacks.SetValue(1)
			SuH_PCSmaxspermstacks.SetValue(1)
			SuH_PCSmaxmilkstacks.SetValue(1)
			SuH_PCSactstacks.SetValue(0)
			SuH_PCSactstacks.SetValue(0)
			SuH_PCSactstacks.SetValue(0)
			debug.MessageBox("Succubus Heart : Do to a bug in the last official version stack values have been reset, sorry!")
		endIf
		playerRef.AddSpell(SuH_ss_statchecker)
		SuH_MODversion.SetValue(2.71)
	endIf
	;end/
	;ent/ Current Patch (DEVpatch)
	; NULL
	If MODversion < 2.721 && MODversion != 0
		debug.Notification("Succubus Heart : Installing Patch 2.721")
		SuH_Lsuccubusprowl.SetValue(1)
		if playerRef.HasSpell(SuH_ss_creatureclaim)
			playerRef.RemoveSpell(SuH_ss_creatureclaim)
			int x = SuH_PCSheartXP.GetValue() as int
			x += 8000
			SuH_PCSheartXP.SetValue(x)
		endIf
		playerRef.RemoveSpell(SuH_sp_succubusprowl)
		playerRef.RemoveSpell(SuH_ss_silentkiss)
		playerRef.RemoveSpell(SuH_ss_sexualenrage)
		SuH_MODversion.SetValue(2.721)
	endIf
	If MODversion < 2.722
		debug.Notification("Succubus Heart : Installing Patch 2.722")
		if MODversion != 0
			unRegisterForModEvent("AnimationStart")
			unRegisterForModEvent("DanisManage")
			unRegisterForModEvent("AnimationEnd")
			unRegisterForModEvent("DanieManage")
			unRegisterForModEvent("OrgasmStart")
			unRegisterForModEvent("DorgsManage")
			unRegisterForModEvent("OrgasmEnd")
			unRegisterForModEvent("DorgeManage")
		endIf
		;SexLab.TrackFaction(SuH_tracker,"NPCtracker")
		SexLab.TrackFaction(SuH_tracker,"NPCtracker")
		RegisterForModEvent("NPCtracker_Added","anim_PC_Added")
		RegisterForModEvent("NPCtracker_Start","anim_PC_Start")
		RegisterForModEvent("NPCtracker_Orgasm","anim_PC_Orgasm")
		RegisterForModEvent("NPCtracker_End","anim_PC_End")
		RegisterForModEvent("PlayerTrack_Added","anim_PC_Added")
		RegisterForModEvent("PlayerTrack_Start","anim_PC_Start")
		RegisterForModEvent("PlayerTrack_Orgasm","anim_PC_Orgasm")
		RegisterForModEvent("PlayerTrack_End","anim_PC_End")
		SuH_MODversion.SetValue(2.7231)
	endIf
	If MODversion == 2.722
		debug.MessageBox("Succubus Heart has detected a broken version was installed, please load a save from before installing DevBuild 2.722")
	endIf
	debug.Notification("Succubus Heart : Running DevBuild -2.724-")
	;end/
endFunction
;end/
;ent/ Initialization
Event OnInit()
	;RegisterForModEvent("AnimationStart","DanisManage")
	;RegisterForModEvent("AnimationEnd","DanieManage")
	;RegisterForModEvent("OrgasmStart","DorgsManage")
	;RegisterForModEvent("OrgasmEnd","DorgeManage")
	
	MODupdate()
EndEvent
;end/
;ent/ Anim NPC Added
Function anim_NPC_Added(form ActorRef, int threadId)
	actor char = ActorRef as actor
EndFunction
;end/

;ent/ Anim NPC Start
Function anim_NPC_Start(form ActorRef, int threadId)
	sslThreadController Thread = SexLab.GetController(threadId)
	actor char = ActorRef as actor
	if char != playerRef
		; Add basic effect spells
		char.AddSpell(SuH_CHAinact, false)
		if SuH_SETinvact.GetValue()
			char.AddSpell(SuH_essential, false)
		endIf
		char.AddToFaction(SuH_friends)
		
		; get victim
		actor victim = SexLab.HookVictim(threadId)
		
		if Thread.HasPlayer
			; if NPC is victim
			if char == victim
				if char.HasSpell(SuH_NPCsuccubuseffect)
					char.AddSpell(SuH_NPCssubmit, false)
				else
					char.AddSpell(SuH_NPCsvictim, false)
				endIf
			; if NPC is aggressor
			elseif victim != none
				if char.HasSpell(SuH_NPCsuccubuseffect)
					char.AddSpell(SuH_NPCsmastery, false)
				else
					char.AddSpell(SuH_NPCsattacker, false)
				endIf
			; if NPC is consent
			else
				if char.HasSpell(SuH_NPCsuccubuseffect)
					char.AddSpell(SuH_NPCstraining, false)
				else
					char.AddSpell(SuH_NPCsconsent, false)
				endIf
			endIf
		elseif char.HasSpell(SuH_NPCsuccubuseffect)
			; if NPC is victim
			if char == victim
				char.AddSpell(SuH_NPCssubmit, false)
			; if NPC is aggressor
			elseif victim != none
				char.AddSpell(SuH_NPCsmastery, false)
			; if NPC is consent
			else
				char.AddSpell(SuH_NPCstraining, false)
			endIf
		endIf
	endIf
endFunction
;end/

;ent/ Anim NPC Orgasm
Function anim_NPC_Orgasm(form ActorRef, int threadId)
	sslThreadController Thread = SexLab.GetController(threadId)
	actor char = ActorRef as actor
		if char != playerRef
		
		; Get Actor List
		actor[] aniActor = SexLab.HookActors(ThreadId)
		
		; Get char Gender
		int charGender = SexLab.GetGender(char)
		; Get Sex Drop Setting [ 0=all 1=no milk 2=no sperm ]
		int SETsexdrops = SuH_SETsexdrops.GetValue() as int
		
		if charGender == 0 ; male
			if SETsexdrops != 2
			int i = 0
			while i < aniActor.Length
				if aniActor[i] != char
					aniActor[i].AddItem(SuH_ii_Sperm, 2, true)
					aniActor[i].EquipItem(SuH_ii_Sperm, false, true)
				endIf
				i += 1
			endWhile
			endIf
		elseIf charGender == 1 ; female
			if SETsexdrops != 1
			int i = 0
			while i < aniActor.Length
				if aniActor[i] != char
					aniActor[i].AddItem(SuH_ii_BreastMilk, 2, true)
					aniActor[i].EquipItem(SuH_ii_BreastMilk, false, true)
				endIf
				i += 1
			endWhile
			endIf
		elseIf charGender == 2 ; male creature
			if SETsexdrops != 2
			int i = 0
			while i < aniActor.Length
				if aniActor[i] != char
					aniActor[i].AddItem(SuH_ii_SpermCreature, 2, true)
					aniActor[i].EquipItem(SuH_ii_SpermCreature, false, true)
				endIf
			i+= 1
			endWhile
			endIf
		elseIf charGender == 3 ; female creature
			if SETsexdrops != 1
			int i = 0
			while i < aniActor.Length
				if aniActor[i] != char
					aniActor[i].AddItem(SuH_ii_BreastMilkCreature, 2, true)
					aniActor[i].EquipItem(SuH_ii_BreastMilkCreature, false, true)
				endIf
			i += 1
			endWhile
			endIf
		endIf
	endIf
endFunction
;end/

;ent/ Anim NPC End
Function anim_NPC_End(form ActorRef, int threadId)
	actor char = ActorRef as actor
	if char != playerRef
	
	char.RemoveSpell(SuH_essential)
	char.RemoveSpell(SuH_NPCsattacker)
	char.RemoveSpell(SuH_NPCsconsent)
	char.RemoveSpell(SuH_NPCsvictim)
	char.RemoveSpell(SuH_NPCsnvictim)
	char.RemoveSpell(SuH_NPCsnattacker)
	char.RemoveSpell(SuH_NPCsnconsent)
	char.RemoveSpell(SuH_NPCsmastery)
	char.RemoveSpell(SuH_NPCstraining)
	char.RemoveSpell(SuH_NPCssubmit)
	char.RemoveSpell(SuH_CHAinact)
	
	char.RemoveFromFaction(SuH_friends)
	endIf
endFunction
;end/

;ent/ Anim PC Added
Function anim_PC_Added(form ActorRef, int threadId)
	actor char = ActorRef as actor
EndFunction
;end/

;ent/ Anim PC Start
Function anim_PC_Start(form ActorRef, int threadId)
	sslThreadController Thread = SexLab.GetController(threadId)
	actor char = ActorRef as actor
	if char == PlayerRef
		; Add basic effect spells
		char.AddSpell(SuH_CHAinact, false)
		if SuH_SETinvact.GetValue()
			char.AddSpell(SuH_essential, false)
		endIf
		char.AddToFaction(SuH_friends)
		
		;Get Actor List
		actor[] aniActor = SexLab.HookActors(threadId)
		
		;ent/ Check Genders
		int charGender = SexLab.GetGender(char)
		int i = 0
		int femalePres = 0
		int malePres = 0
		int mcrePres = 0
		int fcrePres = 0
		
		i = 0
		while i < aniActor.Length
			int Agender = SexLab.GetGender(aniActor[i])
			if Agender == 1
				femalePres += 1
			elseIf Agender == 0
				malePres += 1
			elseIf Agender == 2
				mcrePres += 1
			elseIf Agender == 3
				fcrePres += 1
			endIf
		i += 1
		endWhile
		; set NPC genders
		If mcrePres > 0 || fcrePres > 0
			SuH_NPCgenders.SetValue(3) ;creature
		elseIf charGender == 1 ;Female
			if malePres > 0
				SuH_NPCgenders.SetValue(2) ;male
			else
				SuH_NPCgenders.SetValue(1) ;female
			endIf	
		elseIf charGender == 0 ;Male
			if malePres > 1
				SuH_NPCgenders.SetValue(2) ;male
			else
				SuH_NPCgenders.SetValue(1) ;female
			endIf
		endIf
		;end/
		
		; get victim
		actor victim = SexLab.HookVictim(threadId)
		
		; if PC is victim
		if char == victim
			char.AddSpell(SuH_PCSsubmit, false)
		; if PC is aggressor
		elseif victim != none
			char.AddSpell(SuH_PCSmastery, false)
		; if PC is consent
		else
			char.AddSpell(SuH_PCStraining, false)
		endIf
	elseif char != playerRef
		debug.Notification("SuH: NPC Start")
		
		
		; Add basic effect spells
		char.AddSpell(SuH_CHAinact, false)
		if SuH_SETinvact.GetValue()
			char.AddSpell(SuH_essential, false)
		endIf
		char.AddToFaction(SuH_friends)
		
		; get victim
		actor victim = SexLab.HookVictim(threadId)
		
		if Thread.HasPlayer
			; if NPC is victim
			if char == victim
				if char.HasSpell(SuH_NPCsuccubuseffect)
					char.AddSpell(SuH_NPCssubmit, false)
				else
					char.AddSpell(SuH_NPCsvictim, false)
				endIf
			; if NPC is aggressor
			elseif victim != none
				if char.HasSpell(SuH_NPCsuccubuseffect)
					char.AddSpell(SuH_NPCsmastery, false)
				else
					char.AddSpell(SuH_NPCsattacker, false)
				endIf
			; if NPC is consent
			else
				if char.HasSpell(SuH_NPCsuccubuseffect)
					char.AddSpell(SuH_NPCstraining, false)
				else
					char.AddSpell(SuH_NPCsconsent, false)
				endIf
			endIf
		elseif char.HasSpell(SuH_NPCsuccubuseffect)
			; if NPC is victim
			if char == victim
				char.AddSpell(SuH_NPCssubmit, false)
			; if NPC is aggressor
			elseif victim != none
				char.AddSpell(SuH_NPCsmastery, false)
			; if NPC is consent
			else
				char.AddSpell(SuH_NPCstraining, false)
			endIf
		endIf
	endIf
endFunction
;end/

;ent/ Anim PC Orgasm
Function anim_PC_Orgasm(form ActorRef, int threadId)
	sslThreadController Thread = SexLab.GetController(threadId)
	actor char = ActorRef as actor
	if char == playerRef
	
		; Get Actor List
		actor[] aniActor = SexLab.HookActors(ThreadId)
		
		;ent/ Player Passives
			; Perfect Orgasm
			if playerRef.HasMagicEffect(SuH_sp_perfectorgasmeffect)
				float pH = playerRef.GetBaseActorValue("health")
				float pS = playerRef.GetBaseActorValue("stamina")
				float pM = playerRef.GetBaseActorValue("magicka")
				float cH = playerRef.GetActorValue("health")
				float cM = playerRef.GetActorValue("magicka")
				float cS = playerRef.GetActorValue("stamina")
				float hheal = (pH - cH)*0.75
				float mheal = (pM - cM)*0.75
				float sheal = (pS - cS)*0.75
				playerRef.RestoreActorValue("health",hheal)
				playerRef.RestoreActorValue("magicka",mheal)
				playerRef.RestoreActorValue("stamina",sheal)
			endIf
		;end/
		;ent/ Desire Effect
		int pDesire = SuH_PCSdesire.GetValue() as int
		int pDesireOrg = Math.Floor(pDesire*0.9) ;Get 90% for Orgasm bonus
		pDesire = Math.Floor(pDesire*0.1) ;Remove 90%
		SuH_PCSdesireOrg.SetValue(pDesireOrg)
		SuH_PCSdesire.SetValue(pDesire)
		;end/
		
		; Get char Gender
		int charGender = SexLab.GetGender(char)
		; Get Sex Drop Setting [ 0=all 1=no milk 2=no sperm ]
		int SETsexdrops = SuH_SETsexdrops.GetValue() as int
		
		if charGender == 0 ; male
			if SETsexdrops != 2
			int i = 0
			while i < aniActor.Length
				if aniActor[i] != char
					aniActor[i].AddItem(SuH_ii_Sperm, 2, true)
					aniActor[i].EquipItem(SuH_ii_Sperm, false, true)
				endIf
			i += 1
			endWhile
			endIf
		elseIf charGender == 1 ; female
			if SETsexdrops != 1
			int i = 0
			while i < aniActor.Length
				if aniActor[i] != char
					aniActor[i].AddItem(SuH_ii_BreastMilk, 2, true)
					aniActor[i].EquipItem(SuH_ii_BreastMilk, false, true)
				endIf
			i += 1
			endWhile
			endIf
		endIf
	elseif char != playerRef
		
		; Get Actor List
		actor[] aniActor = SexLab.HookActors(ThreadId)
		
		; Get char Gender
		int charGender = SexLab.GetGender(char)
		; Get Sex Drop Setting [ 0=all 1=no milk 2=no sperm ]
		int SETsexdrops = SuH_SETsexdrops.GetValue() as int
		
		if charGender == 0 ; male
			if SETsexdrops != 2
			int i = 0
			while i < aniActor.Length
				if aniActor[i] != char
					aniActor[i].AddItem(SuH_ii_Sperm, 2, true)
					aniActor[i].EquipItem(SuH_ii_Sperm, false, true)
				endIf
				i += 1
			endWhile
			endIf
		elseIf charGender == 1 ; female
			if SETsexdrops != 1
			int i = 0
			while i < aniActor.Length
				if aniActor[i] != char
					aniActor[i].AddItem(SuH_ii_BreastMilk, 2, true)
					aniActor[i].EquipItem(SuH_ii_BreastMilk, false, true)
				endIf
				i += 1
			endWhile
			endIf
		elseIf charGender == 2 ; male creature
			if SETsexdrops != 2
			int i = 0
			while i < aniActor.Length
				if aniActor[i] != char
					aniActor[i].AddItem(SuH_ii_SpermCreature, 2, true)
					aniActor[i].EquipItem(SuH_ii_SpermCreature, false, true)
				endIf
			i+= 1
			endWhile
			endIf
		elseIf charGender == 3 ; female creature
			if SETsexdrops != 1
			int i = 0
			while i < aniActor.Length
				if aniActor[i] != char
					aniActor[i].AddItem(SuH_ii_BreastMilkCreature, 2, true)
					aniActor[i].EquipItem(SuH_ii_BreastMilkCreature, false, true)
				endIf
			i += 1
			endWhile
			endIf
		endIf
	endIf
endFunction
;end/

;ent/ Anim PC End
Function anim_PC_End(form ActorRef, int threadId)
	actor char = ActorRef as actor
	if char == playerRef
	
	char.RemoveSpell(SuH_essential)
	char.RemoveSpell(SuH_PCSmastery)
	char.RemoveSpell(SuH_PCSsubmit)
	char.RemoveSpell(SuH_PCStraining)
	char.RemoveSpell(SuH_CHAinact)
	
	char.RemoveFromFaction(SuH_friends)
	elseif char != playerRef
	
	char.RemoveSpell(SuH_essential)
	char.RemoveSpell(SuH_NPCsattacker)
	char.RemoveSpell(SuH_NPCsconsent)
	char.RemoveSpell(SuH_NPCsvictim)
	char.RemoveSpell(SuH_NPCsnvictim)
	char.RemoveSpell(SuH_NPCsnattacker)
	char.RemoveSpell(SuH_NPCsnconsent)
	char.RemoveSpell(SuH_NPCsmastery)
	char.RemoveSpell(SuH_NPCstraining)
	char.RemoveSpell(SuH_NPCssubmit)
	char.RemoveSpell(SuH_CHAinact)
	
	char.RemoveFromFaction(SuH_friends)
	endIf
endFunction
;end/