;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 14
Scriptname QF_aHH0Manor_020026F2 Extends Quest Hidden

;BEGIN FRAGMENT Fragment_5
Function Fragment_5()
;BEGIN CODE
SetFacelessHostile()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_10
Function Fragment_10()
;BEGIN CODE
;Place NPC
aHH0JeanneREF.enable()
aHH0AelaREF.enable()
aHH0SariREF.enable()
aHH0JeanneREF.moveto(aHH0TempleElizabethSpot)
aHH0AelaREF.moveto(aHH0TempleAelaSpot)
aHH0SariREF.moveto(aHH0TempleSariSpot)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_2
Function Fragment_2()
;BEGIN CODE
Debug.MessageBox("Second night in the Manor")
aHH0AelaREF.disable()
EnableFaceless()
aHH0ChaurusKeeperREF.disable()
aHH0SecretPassageWallREF.disable()
aHH0BedSpikeREF.enable()
aHH0FloorTrapREF.disable()
aHH0LibraryDoorREF.disable()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_12
Function Fragment_12()
;BEGIN CODE
aHHManorREF.disable()
aHHExitDoorREF.disable()
aHHEntryDoorREF.disable()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_9
Function Fragment_9()
;BEGIN CODE
;Place NPC
aHH0JeanneREF.enable()
aHH0AelaREF.enable()
aHH0SariREF.enable()
aHH0JeanneREF.moveto(aHH0TempleElizabethSpot)
aHH0AelaREF.moveto(aHH0TempleAelaSpot)
aHH0SariREF.moveto(aHH0TempleSariSpot)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_11
Function Fragment_11()
;BEGIN CODE
aHH0CaveHiddenDoorREF.enable()
aHH0TemplePassageWallREF.disable()
aHH0LabyrinthWall1REF.disable()
SariRape()
AelaRape()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_13
Function Fragment_13()
;BEGIN CODE
SetElizabethCompanion()
debug.notification("Elizabeth is improved")
completequest()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_4
Function Fragment_4()
;BEGIN CODE
aHH0ElizabethFacelessTriggerREF.disable()
DisableFaceless()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_1
Function Fragment_1()
;BEGIN CODE
aHH0WallKitchenKeyREF.disable()
aHH0WallKitchenKeyWindowREF.disable()
aHH0KitchenKeyREF.enable()
aHH0FlowerPotREF.disable()
aHH0FlowerPotVineREF.disable()
aHH0ChaurusKeeperREF.enable()
aHH0ChaurusTriggerREF.enable()
aHH0ReserveDoorREF.disable()
aHHReserveSkeletonREF.enable()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_0
Function Fragment_0()
;BEGIN CODE
Debug.MessageBox("First night in the Manor")
aHH0ManorFalseEntryREF.enable()
aHHManorFalseEntryDoorREF.enable()
aHH0ChestMove1REF.enable()
aHHSariNoteREF.enable()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_3
Function Fragment_3()
;BEGIN CODE
aHH0DrumWallWindowREF.disable()
aHH0DrumWallREF.disable()
aHH0FlutWallREF.disable()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_8
Function Fragment_8()
;BEGIN CODE
Debug.MessageBox("Fourth night in the Manor")
aHH0SarcophagusREF.enable()
aHHBedRoomFalseWallPillarREF.disable()
aHHBedRoomFalseWall2REF.disable()
aHHBedRoomFalseWall1REF.disable()
aHHBedRoomFalseWall2WindowREF.disable()
aHHBedRoomFalseWall1WindowREF.disable()
aHH0LabyrinthWall1REF.enable()
aHH0LabyrinthWall2REF.enable()
aHH0SarcophagusTriggerREF.enable()
aHH0CaveDoorREF.disable()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_7
Function Fragment_7()
;BEGIN CODE
Debug.MessageBox("Third night in the Manor")
aHH0BedRoom2LabDoorBlockerREF.enable()
aHH0LabyrinthWall2REF.enable()
aHH0LabyrinthWall1REF.enable()
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

Function EnableFaceless()
	aHHFaceless1REF.enable()
	aHHFaceless2REF.enable()
	aHHFaceless3REF.enable()
	aHHFaceless4REF.enable()
	aHHFaceless5REF.enable()
	aHHFaceless6REF.enable()
	aHHFaceless7REF.enable()
	aHHFaceless8REF.enable()
	aHHFaceless9REF.enable()
	aHHFaceless10REF.enable()
	aHHFaceless11REF.enable()
	aHHFaceless12REF.enable()
EndFunction

Function DisableFaceless()
	aHHFaceless1REF.disable()
	aHHFaceless2REF.disable()
	aHHFaceless3REF.disable()
	aHHFaceless4REF.disable()
	aHHFaceless5REF.disable()
	aHHFaceless6REF.disable()
	aHHFaceless7REF.disable()
	aHHFaceless8REF.disable()
	aHHFaceless9REF.disable()
	aHHFaceless10REF.disable()
	aHHFaceless11REF.disable()
	aHHFaceless12REF.disable()
EndFunction

Function SetFacelessHostile()
	aHHFaceless1REF.startcombat(playerref)
	aHHFaceless2REF.startcombat(playerref)
	aHHFaceless3REF.startcombat(playerref)
	aHHFaceless4REF.startcombat(playerref)
	aHHFaceless5REF.startcombat(playerref)
	aHHFaceless6REF.startcombat(playerref)
	aHHFaceless7REF.startcombat(playerref)
	aHHFaceless8REF.startcombat(playerref)
	aHHFaceless9REF.startcombat(playerref)
	aHHFaceless10REF.startcombat(playerref)
	aHHFaceless11REF.startcombat(playerref)
	aHHFaceless12REF.startcombat(playerref)
Endfunction

Function SariRape()
		actor[] sexActors = new actor[1]   ;its an 2 actor anim
		sexActors[0] = aHH0SariREF   ;actor in female role. Its an alias thats why  that .GetActorRef() is needed. If it would be property it would be just Vess (or whatever else that property would be named)
		sslBaseAnimation[] anims = SL.GetAnimationsByTags(1, "double")   ;here you choose animation to be played. This one is by tags. It means it will pick random animation made for 2 actors which has both of those tags. You can also add tags to suppress for example SL.GetAnimationsByTags(2, "Aggressive,vaginal", "missionary") would still play random animation of vaginal aggressive sex but rough missionary animation would not be allowed.
		RegisterForModEvent("AnimationEnd_aHH", "aHH")   ;this is for hooks.
		SL.StartSex(sexActors, anims, victim = aHH0SariREF, allowbed=false, hook="aHH") 
EndFunction

Function AelaRape()
		actor[] sexActors = new actor[1]   ;its an 2 actor anim
		sexActors[0] = aHH0AelaREF   ;actor in female role. Its an alias thats why  that .GetActorRef() is needed. If it would be property it would be just Vess (or whatever else that property would be named)
		sslBaseAnimation[] anims = SL.GetAnimationsByTags(1, "double")   ;here you choose animation to be played. This one is by tags. It means it will pick random animation made for 2 actors which has both of those tags. You can also add tags to suppress for example SL.GetAnimationsByTags(2, "Aggressive,vaginal", "missionary") would still play random animation of vaginal aggressive sex but rough missionary animation would not be allowed.
		RegisterForModEvent("AnimationEnd_aHH", "aHH")   ;this is for hooks.
		SL.StartSex(sexActors, anims, victim = aHH0AelaREF, allowbed=false, hook="aHH") 
EndFunction

Function SetElizabethCompanion()
	aHH0JeanneREF.setactorvalue("disposition", 80.0)
	aHH0JeanneREF.setrelationshiprank(game.getplayer(), 3)
	debug.notification("Elizabeth is now a follower!")
	aHH0JeanneREF.addtofaction(potentialfollowerfaction)
	aHH0JeanneREF.addtofaction(currentfollowerfaction)
	aHH0JeanneREF.addtofaction(potentialmarriagefaction)
	aHH0JeanneREF.setFactionRank(potentialfollowerfaction, 0)
	aHH0JeanneREF.setFactionRank(currentfollowerfaction, -1)
	aHH0JeanneREF.addspell(aHH0HealOther)
EndFunction

ObjectReference Property aHH0ManorFalseEntryREF  Auto  

ObjectReference Property aHHManorFalseEntryDoorREF  Auto  

ObjectReference Property aHH0ChestMove1REF  Auto  

ObjectReference Property aHHSariNoteREF  Auto  

ObjectReference Property aHH0WallKitchenKeyREF  Auto  

ObjectReference Property aHH0FlowerPotVineREF  Auto  

ObjectReference Property aHH0FlowerPotREF  Auto  

Actor Property aHH0ChaurusKeeperREF  Auto  

ObjectReference Property aHH0ChaurusTriggerREF  Auto  

ObjectReference Property aHH0ReserveDoorREF  Auto  

Actor Property aHHReserveSkeletonREF  Auto  

Actor Property aHH0AelaREF  Auto  

ObjectReference Property aHH0SecretPassageWallREF  Auto  

ObjectReference Property aHH0BedSpikeREF  Auto  

ObjectReference Property aHH0FloorTrapREF  Auto  

ObjectReference Property aHH0LibraryDoorREF  Auto  

ObjectReference Property aHH0WallKitchenKeyWindowREF  Auto  

ObjectReference Property aHH0KitchenKeyREF  Auto  

ObjectReference Property aHH0DrumWallREF  Auto  

ObjectReference Property aHH0DrumWallWindowREF  Auto  

ObjectReference Property aHH0FlutWallREF  Auto  

ObjectReference Property aHH0ElizabethFacelessTriggerREF  Auto  

Actor Property aHHFaceless1REF  Auto  
Actor Property aHHFaceless2REF  Auto  
Actor Property aHHFaceless3REF  Auto  
Actor Property aHHFaceless4REF  Auto  
Actor Property aHHFaceless5REF  Auto  
Actor Property aHHFaceless6REF  Auto  
Actor Property aHHFaceless7REF  Auto  
Actor Property aHHFaceless8REF  Auto  
Actor Property aHHFaceless9REF  Auto  
Actor Property aHHFaceless10REF  Auto  
Actor Property aHHFaceless11REF  Auto  
Actor Property aHHFaceless12REF  Auto  

Actor property Playerref auto

ObjectReference Property aHH0BedRoom2LabDoorBlockerREF  Auto  

ObjectReference Property aHH0LabyrinthWall2REF  Auto  

ObjectReference Property aHH0LabyrinthWall1REF  Auto  

ObjectReference Property aHH0SarcophagusREF  Auto  

Objectreference property aHHBedRoomFalseWallPillarREF auto
Objectreference property aHHBedRoomFalseWall2REF auto
Objectreference property aHHBedRoomFalseWall1REF auto
Objectreference property aHHBedRoomFalseWall2WindowREF auto
Objectreference property aHHBedRoomFalseWall1WindowREF auto

ObjectReference Property aHH0CaveDoorREF  Auto  

ObjectReference Property aHH0SarcophagusTriggerREF  Auto  

Actor property aHH0JeanneREF auto
Objectreference property aHH0TempleElizabethSpot auto
Objectreference property aHH0TempleAelaSpot auto
Actor property aHH0SariREF auto
Objectreference property aHH0TempleSariSpot auto

Objectreference property aHH0CaveHiddenDoorREF auto
Objectreference property aHH0TemplePassageWallREF auto

Objectreference property aHHManorREF auto
Objectreference property aHHExitDoorREF auto
Objectreference property aHHEntryDoorREF auto
Sexlabframework property SL auto

faction property potentialfollowerfaction auto
faction property currentfollowerfaction auto
faction property potentialmarriagefaction auto
spell property aHH0HealOther auto
