Scriptname BaboFollowerConfigScript extends Quest Conditional
{Quest}

SexLabFramework Property SexLab Auto Hidden Conditional
;OSexIntegrationMain Property OStim Auto Hidden Conditional

Bool Property bSexlab Auto Hidden Conditional
;Bool Property bOsex Auto Hidden Conditional

Bool Property bSexlabSwitch Auto Hidden Conditional
;Bool Property bOsexSwitch Auto Hidden Conditional

BaboFollowerConfingMCM Property BFCM Auto
BaboFollowerResetScript Property BFRS Auto

Actor Property Player Auto

Faction Property BaboSlaveFaction Auto
Faction Property BaboReleasedFaction Auto

Faction Property CreatureFaction Auto 
Faction Property DraugrFaction Auto 
Faction Property weplayerenemy Auto
Faction Property BanditFaction Auto
Faction Property FalmerFaction Auto
Faction Property SpiderFaction Auto
Faction Property SkeletonFaction Auto
Faction Property SkeeverFaction Auto
Faction Property NecromancerFaction Auto
Faction Property ChaurusFaction Auto
Faction Property ForswornFaction Auto
Faction Property GiantFaction Auto
Faction Property MammothFaction Auto
Faction Property DunPlayerAllyFaction Auto
Faction Property DLC2RieklingFaction Auto
Faction Property DLC2MoragTongFaction Auto
Faction Property HagravenFaction Auto
Faction Property dunBlackreachFalmerServantFaction Auto
Faction Property VampireFaction Auto
Faction Property VampireThrallFaction Auto
Faction Property WarlockFaction Auto
Faction Property TrollFaction Auto

Quest Property BaboFollowerCLQ00After01  Auto
Quest Property BaboFollowerCLQ01  Auto  
Quest Property BaboFollowerCLQ02  Auto  
Quest Property BaboFollowerCLQ03  Auto  
Quest Property BaboFollowerCLQ04  Auto  
Quest Property BaboFollowerCLQ05  Auto  
Quest Property BaboFollowerCLQQuestObjective  Auto  
Quest Property BaboFollowerReijaQuest  Auto

Quest Property BaboFollowerReset  Auto  
Quest Property BaboFollowerConfig  Auto  

ReferenceAlias Property BaboReija Auto
ReferenceAlias Property BaboFollowerAfterRef00 Auto

GlobalVariable Property BFollowerCLQ00Switch Auto

GlobalVariable Property BFollower00After Auto

Event OnInit()
	FactionSet()
	Debug.Notification("Babo Follower initiating..")
EndEvent


Function RegisterUpdate(Int TimeLimit)
	RegisterForSingleUpdateGameTime(TimeLimit); this is Customizable
EndFunction

Function MaintenanceSystem()
	;MaintenanceQuests()
	SexlabCheck()
	;OstimCheck()
EndFunction

Function MaintenanceQuests()
If BFollowerCLQ00Switch.getvalue() == 1
;	BaboFollowerAfterRef00.forcerefto(BaboReija.getactorreference())
;	BaboFollowerCLQ00After01.start()
;	BaboFollowerCLQ00After01.setstage(1)
;	BaboFollowerReijaQuest.setstage(300);Notready
Endif 
EndFunction

Event OnUpdateGameTime()

EndEvent

int Function SexlabCheck()
    if (Game.GetModByName("SexLab.esm") != 255)
		 sexlab = SexLabUtil.GetAPI() 
		 return 1
	else
		return 0
	endif

EndFunction

;/ int Function OstimCheck() /;
	;/ if (Game.GetModByName("Ostim.esp") != 255) /;
		;/ OStim = OUtils.GetOStim() /;
	;/ else /;
		;/ return 0 /;
	;/ endif /;
	
	;/ if (OStim == none || OStim.GetAPIVersion() < 23) /;
		;/ debug.MessageBox("Your OStim version is out of date.") /;
		;/ return 0 /;
	;/ endif /;
	;/ if (OStim.GetAPIVersion() >= 29) ;OStim Standalone NPC and player scene Events /;
		;/ RegisterForModEvent("ostim_actor_orgasm", "OStimOrgasmThread") /;
		;/ RegisterForModEvent("ostim_thread_start", "OStimStartThread") /;
		;/ RegisterForModEvent("ostim_thread_end", "OStimEndThread") /;
		;/ return 1 /;
	;/ else /;
		;/ ;OStim and OStimNG Events, Only Player scene events /;
		;/ RegisterForModEvent("ostim_orgasm", "OStimOrgasm") /;
		;/ RegisterForModEvent("ostim_start", "OStimStart") /;
		;/ RegisterForModEvent("ostim_end", "OStimEnd") /;
	;/ endif /;
	;/ return 2 /;
;/ EndFunction /;


Function FactionSet()
Warlockfaction.setally(BaboSlaveFaction, true, true)
Warlockfaction.setenemy(BaboReleasedFaction)

; skyrim factions
banditfaction.setally(BaboSlaveFaction, true, true)
banditfaction.setenemy(BaboReleasedFaction)
;
TrollFaction.setally(BaboSlaveFaction, true, true)
TrollFaction.setenemy(BaboReleasedFaction)

;
CreatureFaction.setally(BaboSlaveFaction, true, true)
CreatureFaction.setenemy(BaboReleasedFaction)

;
DraugrFaction.setally(BaboSlaveFaction, true, true)
DraugrFaction.setenemy(BaboReleasedFaction)

;
Vampirefaction.setally(BaboSlaveFaction, true, true)
Vampirefaction.setenemy(BaboReleasedFaction)

;
FalmerFaction.setally(BaboSlaveFaction, true, true)
FalmerFaction.setenemy(BaboReleasedFaction)

;
SpiderFaction.setally(BaboSlaveFaction, true, true)
SpiderFaction.setenemy(BaboReleasedFaction)

;
SkeletonFaction.setally(BaboSlaveFaction, true, true)
SkeletonFaction.setenemy(BaboReleasedFaction)

;
VampireThrallFaction.setally(BaboSlaveFaction, true, true)
VampireThrallFaction.setenemy(BaboReleasedFaction)

;
SkeeverFaction.setally(BaboSlaveFaction, true, true)
SkeeverFaction.setenemy(BaboReleasedFaction)

;
NecromancerFaction.setally(BaboSlaveFaction, true, true)
NecromancerFaction.setenemy(BaboReleasedFaction)

;
ChaurusFaction.setally(BaboSlaveFaction, true, true)
ChaurusFaction.setenemy(BaboReleasedFaction)

;
ForswornFaction.setally(BaboSlaveFaction, true, true)
ForswornFaction.setenemy(BaboReleasedFaction)

;
GiantFaction.setally(BaboSlaveFaction, true, true)
GiantFaction.setenemy(BaboReleasedFaction)

;
MammothFaction.setally(BaboSlaveFaction, true, true)
MammothFaction.setenemy(BaboReleasedFaction)

;
DunPlayerAllyFaction.setally(BaboSlaveFaction, true, true)
DunPlayerAllyFaction.setally(BaboReleasedFaction, true, true)

;
dunBlackreachFalmerServantFaction.setally(BaboSlaveFaction, true, true)
dunBlackreachFalmerServantFaction.setenemy(BaboReleasedFaction)

;
DLC2RieklingFaction.setally(BaboSlaveFaction, true, true)
DLC2RieklingFaction.setenemy(BaboReleasedFaction)

;
DLC2MoragTongFaction.setally(BaboSlaveFaction, true, true)
DLC2MoragTongFaction.setenemy(BaboReleasedFaction)

;
HagravenFaction.setally(BaboSlaveFaction, true, true)
HagravenFaction.setenemy(BaboReleasedFaction)

endfunction
