Scriptname SuH_ss_sexualenrageScript extends ActiveMagicEffect  

;#Include
SexLabFramework property SexLab auto

GlobalVariable Property SuH_PCSseductionpoints auto

MagicEffect Property SuH_PCSsubmiteffect auto
MagicEffect Property SuH_PCStrainingeffect auto
MagicEffect Property SuH_PCSmasteryeffect auto
MagicEffect Property SuH_CHAinacteffect auto

GlobalVariable Property SuH_SETalwaysgive auto
GlobalVariable Property SuH_SETallowseduce auto
GlobalVariable Property SuH_SETcsFemaleHomo auto
GlobalVariable Property SuH_SETcsMaleHomo auto
GlobalVariable Property SuH_SETcsCreatureWfemale auto
GlobalVariable Property SuH_SETcsCreatureWmale auto

Actor Property playerRef Auto

Event OnEffectStart(Actor cTarget,Actor cCaster)
	int tG = SexLab.GetGender(cTarget)
	int cG = SexLab.GetGender(cCaster)
	int SETallowseduce = SuH_SETallowseduce.GetValue() as int
	
	if cCaster == playerRef && cTarget != none
		If cG == 1 ;;; Female Caster ,,,
			;;; Female Target ,,,
			if tG == 1 && SETallowseduce != 1 && SuH_SETcsFemaleHomo.GetValue()
				bool tV = SexLab.IsValidActor(cTarget)
				bool cV = SexLab.IsValidActor(cCaster)
				if tV == true && cV == true
					Actor[] aniActors = new actor[2]
					aniActors[0] = cCaster
					aniActors[1] = cTarget
					sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"Lesbian", "", requireAll=true)
					SexLab.StartSex(aniActors, animSET, victim=cCaster, allowbed=false)
				else
					Debug.Notification("Seduction Failed : Target Not Valid")
				endIf
			;;; Male Target ,,,
			elseIf tG == 0 && SETallowseduce != 2
				bool tV = SexLab.IsValidActor(cTarget)
				bool cV = SexLab.IsValidActor(cCaster)
				if tV == true && cV == true
					Actor[] aniActors = new actor[2]
					aniActors[0] = cCaster
					aniActors[1] = cTarget
					sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"Aggressive", "Lesbian", requireAll=true)
					SexLab.StartSex(aniActors, animSET, victim=cCaster, allowbed=false)
				else
					Debug.Notification("Seduction Failed : Target Not Valid")
				endIf
			;;; Creature Target ,,,
			elseIf tG >= 2 && SuH_SETcsCreatureWfemale.GetValue()
				bool tV = SexLab.IsValidActor(cTarget)
				bool cV = SexLab.IsValidActor(cCaster)
				if tV == true && cV == true
					Actor[] aniActors = new actor[2]
					aniActors[0] = cCaster
					aniActors[1] = cTarget
					sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
					SexLab.StartSex(aniActors, animSET, victim=cCaster, allowbed=false)
				else
					Debug.Notification("Seduction Failed : Target Not Valid")
				endIf
			else
				Debug.Notification("Seduction Failed : Target Not Valid")
			endIf
		elseIf cG == 0 ;;; Male Caster ,,,
			;;; Female Target ,,,
			if tG == 1 && SETallowseduce != 1
				bool tV = SexLab.IsValidActor(cTarget)
				bool cV = SexLab.IsValidActor(cCaster)
				if tV == true && cV == true
					Actor[] aniActors = new actor[2]
					aniActors[0] = cTarget
					aniActors[1] = cCaster
					sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
					SexLab.StartSex(aniActors, animSET, victim=cCaster, allowbed=false)
				else
					Debug.Notification("Seduction Failed : Target Not Valid")
				endIf
			;;; Male Target ,,,
			elseIf tG == 0 && SETallowseduce != 2 && SuH_SETcsMaleHomo.GetValue()
				bool tV = SexLab.IsValidActor(cTarget)
				bool cV = SexLab.IsValidActor(cCaster)
				if tV == true && cV == true
					Actor[] aniActors = new actor[2]
					aniActors[0] = cCaster
					aniActors[1] = cTarget
					sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"Aggressive", "Lesbian", requireAll=true)
					SexLab.StartSex(aniActors, animSET, victim=cCaster, allowbed=false)
				else
					Debug.Notification("Seduction Failed : Target Not Valid")
				endIf
			;;; Creature Target ,,,
			elseIf tG >= 2 && SuH_SETcsCreatureWmale.GetValue()
				bool tV = SexLab.IsValidActor(cTarget)
				bool cV = SexLab.IsValidActor(cCaster)
				if tV == true && cV == true
					Actor[] aniActors = new actor[2]
					aniActors[0] = cCaster
					aniActors[1] = cTarget
					sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
					SexLab.StartSex(aniActors, animSET, victim=cCaster, allowbed=false)
				else
					Debug.Notification("Seduction Failed : Target Not Valid")
				endIf
			else
				Debug.Notification("Seduction Failed : Target Not Valid")
			endIf
		endIf
	elseIf cTarget != none
		if cG == 1 ;;; Female Caster ,,,
			;;; Female Target ,,,
			if tG == 1 && SuH_SETcsFemaleHomo.GetValue()
				bool tV = SexLab.IsValidActor(cTarget)
				bool cV = SexLab.IsValidActor(cCaster)
				if tV == true && cV == true
					Actor[] aniActors = new actor[2]
					aniActors[0] = cCaster
					aniActors[1] = cTarget
					sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"Lesbian", "", requireAll=true)
					SexLab.StartSex(aniActors, animSET, victim=cCaster, allowbed=false)
				EndIf
			;;; Male Target ,,,
			elseIf tG == 0
				bool tV = SexLab.IsValidActor(cTarget)
				bool cV = SexLab.IsValidActor(cCaster)
				if tV == true && cV == true
					Actor[] aniActors = new actor[2]
					aniActors[0] = cCaster
					aniActors[1] = cTarget
					sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
					SexLab.StartSex(aniActors, animSET, victim=cCaster, allowbed=false)
				EndIf
			;;; Creature Target ,,,
			elseIf tG >= 2 && SuH_SETcsCreatureWfemale.GetValue()
				bool tV = SexLab.IsValidActor(cTarget)
				bool cV = SexLab.IsValidActor(cCaster)
				if tV == true && cV == true
					Actor[] aniActors = new actor[2]
					aniActors[0] = cCaster
					aniActors[1] = cTarget
					sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
					SexLab.StartSex(aniActors, animSET, victim=cCaster, allowbed=false)
				EndIf
			endIf
		elseIf cG == 0 ;;; Male Caster ,,,
			;;; Female Target ,,,
			if tG == 1
				bool tV = SexLab.IsValidActor(cTarget)
				bool cV = SexLab.IsValidActor(cCaster)
				if tV == true && cV == true
					Actor[] aniActors = new actor[2]
					aniActors[0] = cCaster
					aniActors[1] = cTarget
					sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
					SexLab.StartSex(aniActors, animSET, victim=cCaster, allowbed=false)
				EndIf
			;;; Male Target ,,,
			elseIf tG == 0 && SuH_SETcsMaleHomo.GetValue()
				bool tV = SexLab.IsValidActor(cTarget)
				bool cV = SexLab.IsValidActor(cCaster)
				if tV == true && cV == true
					Actor[] aniActors = new actor[2]
					aniActors[0] = cCaster
					aniActors[1] = cTarget
					sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
					SexLab.StartSex(aniActors, animSET, victim=cCaster, allowbed=false)
				EndIf
			;;; Creature Target ,,,
			elseIf tG >= 2 && SuH_SETcsCreatureWmale.GetValue()
				bool tV = SexLab.IsValidActor(cTarget)
				bool cV = SexLab.IsValidActor(cCaster)
				if tV == true && cV == true
					Actor[] aniActors = new actor[2]
					aniActors[0] = cCaster
					aniActors[1] = cTarget
					sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
					SexLab.StartSex(aniActors, animSET, victim=cCaster, allowbed=false)
				EndIf
			endIf
		elseIf cG >= 2 ;;; Creature Caster ,,,
			if tG == 1 && SuH_SETcsCreatureWfemale.GetValue()
				bool tV = SexLab.IsValidActor(cTarget)
				bool cV = SexLab.IsValidActor(cCaster)
				if tV == true && cV == true
					Actor[] aniActors = new actor[2]
					aniActors[0] = cTarget
					aniActors[1] = cCaster
					sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
					SexLab.StartSex(aniActors, animSET, victim=cCaster, allowbed=false)
				EndIf
			elseIf tG == 0 && SuH_SETcsCreatureWmale.GetValue()
				bool tV = SexLab.IsValidActor(cTarget)
				bool cV = SexLab.IsValidActor(cCaster)
				if tV == true && cV == true
					Actor[] aniActors = new actor[2]
					aniActors[0] = cTarget
					aniActors[1] = cCaster
					sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
					SexLab.StartSex(aniActors, animSET, victim=cCaster, allowbed=false)
				EndIf
			endIf
		endIf
	endIf
endEvent