Scriptname __LALLSexGuildScript extends Quest conditional
{Handles all miscellaneous events for sex club}

SexlabFramework Property SexLab Auto
zbfSexLab Property ZaZSexlab Auto
zbfSlot Property zazSlot Auto
Actor Property PlayerRef Auto
Actor Property BraithActor Auto
ReferenceAlias Property AmrenRef Auto
ObjectReference Property PilloryRef Auto

;Quests
Quest Property LostQuest Auto



;Conditionals
Int Property BraithPilloryScene Auto Conditional Hidden
Int Property BraithArousal Auto Conditional Hidden


;Tomato scene
Spell Property ThrowTomatoSpell Auto
Potion Property Tomato Auto
Perk Property TomatoPerk Auto
ObjectReference Property AmrenMarker Auto
Outfit Property NakedOutfit Auto

;RefAliases
ReferenceAlias Property Braith Auto
ReferenceAlias Property Pillory Auto

Function SexWith(actor toSex, string asTag, bool passive = true)
if passive == true
Sexlab.QuickStart(PlayerRef,toSex,none,none,none,none,none,asTag)
elseif passive == false
;Sexlab.QuickStart(toSex,PlayerRef,none,none,none,none,none,asTag)
endif
EndFunction





;======================
;Braith pillory stuff
Function SetupBraithPilloryScene()
Pillory.TryToEnable()

BraithPilloryScene = 1
Braith.GetActorRef().SetOutfit(nakedOutfit)
AmrenRef.GetActorRef().MoveTo(AmrenMarker)
;Braith's AI package should make her use the pillory
EndFunction


Function BraithPillorySex()
zbfSexLab zbfSL = zbfSexLab.GetApi()  
Actor[] actors = zbfUtil.ActorList(Braith.GetActorRef(), PlayerRef)  
zbfSexLabBaseEntry[] list = zbfSL.GetEntriesByTags(actors, "Doggystyle,Furniture", aiMinActorCount = 2)  
Int success = zbfSL.StartSex(actors, list, Victim = Braith.GetActorRef(), Hook = "MyHook") 

EndFunction

Event SexAnimEnded(string eventName, string argString, float argNum, form sender)
LostQuest.SetStage(20)
EndEvent


Function GiveTomatoSpell()
PlayerRef.AddSpell(ThrowTomatoSpell)
PlayerRef.AddItem(Tomato,100)
PlayerRef.AddPerk(TomatoPerk)
EndFunction


Function RaiseBraithArousal(int by)
BraithArousal = BraithArousal + by
if BraithArousal == 10
debug.notification("Braith seems to be getting a little hot and bothered by this...")
elseif BraithArousal == 20
debug.notification("Braith's breathing begins to get quite heavier")
elseif BraithArousal == 40
debug.notification("You see a tear well up in Braith's eye, as well as a tear well up down below...")
elseif BraithArousal == 60
debug.notification("Braith's pussy starts dripping uncontrollably as you pelt her with tomatoes.")
LostQuest.SetObjectiveCompleted(12)
LostQuest.SetObjectiveDisplayed(15)
endif
EndFunction