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

;BEGIN ALIAS PROPERTY Location
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_Location Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY BaboFollowerRef02
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_BaboFollowerRef02 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY BaboFollowerRef05
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_BaboFollowerRef05 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY FoeRef02
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_FoeRef02 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY BaboFollowerRef03
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_BaboFollowerRef03 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY CalcelmoREF
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_CalcelmoREF Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY BaboFollowerRef04
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_BaboFollowerRef04 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY FoeRef03
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_FoeRef03 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY FoeRef01
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_FoeRef01 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY BaboFollowerRef01
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_BaboFollowerRef01 Auto
;END ALIAS PROPERTY

;BEGIN FRAGMENT Fragment_17
Function Fragment_17()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
(CLQ03LockedDoorRef as BaboDefaultLockedDoorScript).ResetTrigger()
(CLQ03SceneTriggerRef02 as BaboFollowerSceneTriggerScript).ResetTrigger()
CLQ03SceneTriggerRef02.disable()

(CLQ03SceneTriggerRef as BaboFollowerSceneTriggerScript).ResetTrigger()
CLQ03SceneTriggerRef.disable()

(BaboCLQ03FollowerSceneTrigger01 as BaboFollowerSceneTriggerScript).ResetTrigger()
BaboCLQ03FollowerSceneTrigger01.disable()

BaboDummyCompanion03.setessential(true)

kmyQuest.ResetFollowerFaction((Alias_BaboFollowerRef01.getref() as actor))
kmyQuest.ResetFollowerFaction((Alias_BaboFollowerRef02.getref() as actor))
kmyQuest.ResetFollowerFaction((Alias_BaboFollowerRef03.getref() as actor))
kmyQuest.ResetFollowerFaction((Alias_BaboFollowerRef04.getref() as actor))
kmyQuest.ResetFollowerFaction((Alias_BaboFollowerRef05.getref() as actor))

Alias_BaboFollowerRef01.Clear()
Alias_BaboFollowerRef02.Clear()
Alias_BaboFollowerRef03.Clear()
Alias_BaboFollowerRef04.Clear()
Alias_BaboFollowerRef05.Clear()

(Alias_BaboFollowerRef01.getref() as actor).disable()
(Alias_BaboFollowerRef02.getref() as actor).disable()
(Alias_BaboFollowerRef03.getref() as actor).disable()
(Alias_BaboFollowerRef04.getref() as actor).disable()
(Alias_BaboFollowerRef05.getref() as actor).disable()

Alias_FoeRef01.GetReference().DeleteWhenAble()
Alias_FoeRef02.GetReference().DeleteWhenAble()
Alias_FoeRef03.GetReference().DeleteWhenAble()
Alias_FoeRef01.Clear()
Alias_FoeRef02.Clear()
Alias_FoeRef03.Clear()
BFollowerCLQ03Switch.setvalue(0)

Utility.wait(1.0)
Debug.notification("Babo Follower Quest 03 Reset Complete")
Stop()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_15
Function Fragment_15()
;BEGIN CODE
;Markarth Home
(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef03.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef04.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef05.getref() as actor).EvaluatePackage()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_18
Function Fragment_18()
;BEGIN CODE
Game.getplayer().additem(BaboFollowerGift03, 1)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_8
Function Fragment_8()
;BEGIN CODE
BaboFollowerCLQ03Scene02.Stop()
(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
;(Alias_BaboFollowerRef03.getref() as actor).EvaluatePackage()
;(Alias_BaboFollowerRef04.getref() as actor).EvaluatePackage()
;(Alias_BaboFollowerRef05.getref() as actor).EvaluatePackage()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_7
Function Fragment_7()
;BEGIN CODE
BaboFollowerCLQ03Scene02.Stop()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_13
Function Fragment_13()
;BEGIN CODE
;Standing by
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_14
Function Fragment_14()
;BEGIN CODE
Game.getplayer().removeitem(gold001, 4000)
Utility.wait(1.0)
Setstage(25)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_9
Function Fragment_9()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_3
Function Fragment_3()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
kmyQuest.DReleasedFaction((Alias_BaboFollowerRef01.getref() as actor))
kmyQuest.DReleasedFaction((Alias_BaboFollowerRef02.getref() as actor))
kmyQuest.DReleasedFaction((Alias_BaboFollowerRef03.getref() as actor))
kmyQuest.DReleasedFaction((Alias_BaboFollowerRef04.getref() as actor))
kmyQuest.DReleasedFaction((Alias_BaboFollowerRef05.getref() as actor))

(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef02.getref() as actor).Disable()
(Alias_BaboFollowerRef03.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef04.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef05.getref() as actor).EvaluatePackage()
Utility.wait(1.0)
BaboCLQ03FollowerSceneTrigger01.enable()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_12
Function Fragment_12()
;BEGIN CODE
;Felt sorry for their situation
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_2
Function Fragment_2()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
CLQ03DungeonDoorDummy.Disable()
DungeonDoorRef.Enable()
kmyQuest.SwitchXmarker(BaboFollowerCLQ03EMarker, BaboFollowerCLQ03DMarker)
kmyQuest.DSlaveFaction((Alias_BaboFollowerRef01.getref() as actor))
kmyQuest.DSlaveFaction((Alias_BaboFollowerRef02.getref() as actor))
kmyQuest.DSlaveFaction((Alias_BaboFollowerRef03.getref() as actor))
kmyQuest.DSlaveFaction((Alias_BaboFollowerRef04.getref() as actor))
kmyQuest.DSlaveFaction((Alias_BaboFollowerRef05.getref() as actor))
kmyQuest.MovetoSpot((Alias_BaboFollowerRef01.getref() as actor), BaboFollowerCLQ03XMarker01NchuandZel5)
kmyQuest.MovetoSpot((Alias_BaboFollowerRef02.getref() as actor), BaboFollowerCLQ03XMarker02NchuandZel5)
kmyQuest.MovetoSpot((Alias_BaboFollowerRef03.getref() as actor), BaboFollowerCLQ03XMarker03NchuandZel5)
kmyQuest.MovetoSpot((Alias_BaboFollowerRef04.getref() as actor), BaboFollowerCLQ03XMarker04NchuandZel5)
kmyQuest.MovetoSpot((Alias_BaboFollowerRef05.getref() as actor), BaboFollowerCLQ03XMarker05NchuandZel5)
(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef02.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef03.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef04.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef05.getref() as actor).EvaluatePackage()
kmyQuest.Getnaked((Alias_BaboFollowerRef01.getref() as actor), 1)
kmyQuest.Getnaked((Alias_BaboFollowerRef03.getref() as actor), 1)
kmyQuest.Getnaked((Alias_BaboFollowerRef04.getref() as actor), 1)
kmyQuest.Getnaked((Alias_BaboFollowerRef05.getref() as actor), 1)
kmyQuest.SpawnEnemies(BaboFalmer01, BaboFollowerCLQ03XMarker06NchuandZel5, 4, Alias_FoeRef01)
kmyQuest.SpawnEnemies(BaboFalmer01, BaboFollowerCLQ03XMarker07NchuandZel5, 4, Alias_FoeRef02)
Utility.wait(1.0)
BaboDummyCompanion03.setessential(false)
;(Alias_FoeRef01.getref() as actor).EvaluatePackage()
;(Alias_FoeRef02.getref() as actor).EvaluatePackage()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_6
Function Fragment_6()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
BaboFollowerCLQ03Scene03.Stop()
(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
kmyQuest.SwitchXmarker(BaboFollowerCLQ03DMarker, BaboFollowerCLQ03EMarker)
(Alias_BaboFollowerRef03.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef04.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef05.getref() as actor).EvaluatePackage()
BaboFollowerCLQ03Scene04.start()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_1
Function Fragment_1()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
BaboFollowerCLQ03Scene01.stop()
kmyQuest.GoStateFirst()
kmyQuest.RegisterUpdate(24)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_4
Function Fragment_4()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
kmyQuest.DRunawayFaction((Alias_BaboFollowerRef01.getref() as actor))
kmyQuest.DRunawayFaction((Alias_BaboFollowerRef03.getref() as actor))
kmyQuest.DRunawayFaction((Alias_BaboFollowerRef04.getref() as actor))
kmyQuest.DRunawayFaction((Alias_BaboFollowerRef05.getref() as actor))

(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef03.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef04.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef05.getref() as actor).EvaluatePackage()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_5
Function Fragment_5()
;BEGIN CODE
(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_16
Function Fragment_16()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
kmyQuest.DFollowerFaction((Alias_BaboFollowerRef01.getref() as actor))
kmyQuest.DFollowerFaction((Alias_BaboFollowerRef03.getref() as actor))
kmyQuest.DFollowerFaction((Alias_BaboFollowerRef04.getref() as actor))
kmyQuest.DFollowerFaction((Alias_BaboFollowerRef05.getref() as actor))

Alias_FoeRef01.GetReference().DeleteWhenAble()
Alias_FoeRef02.GetReference().DeleteWhenAble()
Alias_FoeRef03.GetReference().DeleteWhenAble()
Alias_FoeRef01.Clear()
Alias_FoeRef02.Clear()
Alias_FoeRef03.Clear()
SendModEvent("OnPlusRescueCount")
Utility.wait(5.0)
SendModEvent("OnPlusRescueCount")
Utility.wait(5.0)
SendModEvent("OnPlusRescueCount")
Utility.wait(5.0)
SendModEvent("OnPlusRescueCount")
BFollowerCLQ03Switch.setvalue(1)
BaboCLQ03FollowerSceneTrigger01.disable()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_0
Function Fragment_0()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
Debug.Trace("BaboFollowerCLQ01 Started")
CLQ03SceneTriggerRef.Enable()
DungeonDoorRef.Disable()
CLQ03DungeonDoorDummy.Enable()
If CalcelmoRef.isdead()
Else
Alias_CalcelmoRef.ForceRefTo(CalcelmoRef)
EndIf
kmyQuest.SpawnFolloweratPlace(BaboFollowerCLQ03Marker01, 1)
kmyQuest.SpawnFolloweratPlace(BaboFollowerCLQ03Marker02, 2)
kmyQuest.SpawnFolloweratPlace(BaboFollowerCLQ03Marker03, 3)
kmyQuest.SpawnFolloweratPlace(BaboFollowerCLQ03Marker04, 4)
kmyQuest.SpawnFolloweratPlace(BaboFollowerCLQ03Marker05, 5)
Utility.Wait(1.0)
(Alias_CalcelmoRef.getref() as actor).evaluatepackage()
(Alias_BaboFollowerRef01.getref() as actor).evaluatepackage()
(Alias_BaboFollowerRef02.getref() as actor).evaluatepackage()
(Alias_BaboFollowerRef03.getref() as actor).evaluatepackage()
(Alias_BaboFollowerRef04.getref() as actor).evaluatepackage()
(Alias_BaboFollowerRef05.getref() as actor).evaluatepackage()
;BaboFollowerCLQ01Scene01.start()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_10
Function Fragment_10()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
kmyQuest.GetBasic((Alias_BaboFollowerRef01.getref() as actor), 1)
kmyQuest.GetBasic((Alias_BaboFollowerRef03.getref() as actor), 2)
kmyQuest.GetBasic((Alias_BaboFollowerRef04.getref() as actor), 3)
kmyQuest.GetBasic((Alias_BaboFollowerRef05.getref() as actor), 4)
Utility.wait(5.0)
BaboFollowerCLQ03Scene03.Start()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_11
Function Fragment_11()
;BEGIN CODE
BaboFollowerCLQ03Scene04.stop()
(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
;END CODE
EndFunction
;END FRAGMENT

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

ObjectReference Property BaboFollowerCLQ03MarkerCalcelmo auto

ObjectReference Property BaboFollowerCLQ03Marker01 auto

ObjectReference Property BaboFollowerCLQ03Marker02 auto

ObjectReference Property BaboFollowerCLQ03Marker03 auto

ObjectReference Property BaboFollowerCLQ03Marker04 auto

ObjectReference Property BaboFollowerCLQ03Marker05 auto
ObjectReference Property DungeonDoorRef  Auto  

ObjectReference Property CLQ03DungeonDoorDummy  Auto  

ObjectReference Property CLQ03SceneTriggerRef  Auto  

Actor Property CalcelmoREF  Auto  

Scene Property BaboFollowerCLQ03Scene01  Auto  

Scene Property BaboFollowerCLQ03Scene02  Auto  

ActorBase Property BaboFalmer01  Auto  

ObjectReference Property BaboFollowerCLQ03XMarker01NchuandZel5  Auto  

ObjectReference Property BaboFollowerCLQ03XMarker02NchuandZel5  Auto  

ObjectReference Property BaboFollowerCLQ03XMarker03NchuandZel5  Auto  

ObjectReference Property BaboFollowerCLQ03XMarker04NchuandZel5  Auto  

ObjectReference Property BaboFollowerCLQ03XMarker05NchuandZel5  Auto  

ObjectReference Property BaboFollowerCLQ03XMarker06NchuandZel5  Auto  

ObjectReference Property BaboFollowerCLQ03DMarker  Auto  

ObjectReference Property BaboFollowerCLQ03EMarker  Auto  

ObjectReference Property BaboFollowerCLQ03XMarker07NchuandZel5  Auto  

ActorBase Property BaboDummyCompanion03  Auto  

ObjectReference Property BaboCLQ03FollowerSceneTrigger01  Auto  

ObjectReference Property BaboFollowerCLQ03Marker08  Auto  

Scene Property BaboFollowerCLQ03Scene03  Auto  

GlobalVariable Property BFollowerCLQ03Switch  Auto  

Scene Property BaboFollowerCLQ03Scene04  Auto  

ObjectReference Property CLQ03SceneTriggerRef02  Auto  

LeveledItem Property BaboFollowerGift03  Auto  

MiscObject Property Gold001  Auto  

ObjectReference Property CLQ03LockedDoorRef  Auto  
