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

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

;BEGIN ALIAS PROPERTY FoeRef09
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_FoeRef09 Auto
;END ALIAS PROPERTY

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

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

;BEGIN ALIAS PROPERTY FoeRef10
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_FoeRef10 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY PlayerRef
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_PlayerRef Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY FoeRef06
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_FoeRef06 Auto
;END ALIAS PROPERTY

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

;BEGIN ALIAS PROPERTY FoeRef05
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_FoeRef05 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY FoeRef04
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_FoeRef04 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY FoeRef08
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_FoeRef08 Auto
;END ALIAS PROPERTY

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

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

;BEGIN ALIAS PROPERTY FoeRef07
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_FoeRef07 Auto
;END ALIAS PROPERTY

;BEGIN FRAGMENT Fragment_12
Function Fragment_12()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
;Second Round Start!
BaboLoanSharkBossHighelf.setessential(false)
kmyQuest.NPCChallengeStart(Alias_BaboFollowerRef01, Alias_FoeRef01, None, BaboLoanSharkFaction, None, BaboLoanSharkBossFaction)
kmyQuest.NPCChallengeStart(Alias_BaboFollowerRef01, Alias_FoeRef08, None, BaboLoanSharkFaction, None, BaboLoanSharkTempFaction)
kmyQuest.NPCChallengeStart(Alias_BaboFollowerRef01, Alias_FoeRef09, None, BaboLoanSharkFaction, None, BaboLoanSharkTempFaction)
kmyQuest.NPCChallengeStart(Alias_BaboFollowerRef01, Alias_FoeRef10, None, BaboLoanSharkFaction, None, BaboLoanSharkTempFaction)
BaboFollowerSceneTriggerCLQ05S17.enable()
;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
Actor Foe02 = (Alias_FoeRef02.getref() as actor)
Foe02.removefromfaction(BaboLoanSharkTempFaction)
Foe02.addtofaction(BaboLoanSharkFaction)
(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
kmyQuest.MovetoSpot((Alias_BaboFollowerRef01.getref() as actor), BaboFollowerCLQ05Marker03)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_15
Function Fragment_15()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
;Everything over
Debug.notification("This is.. more than I expected... What a luck?")
BaboFollowerCLQ05Scene04.stop()


(Alias_BaboFollowerRef01.getref() as actor).addtofaction(BaboCLQ05Faction)
(Alias_BaboFollowerRef02.getref() as actor).addtofaction(BaboCLQ05Faction)
kmyQuest.DFollowerFaction(Alias_BaboFollowerRef01.getref() as actor)
kmyQuest.DFollowerFaction(Alias_BaboFollowerRef02.getref() as actor)
kmyQuest.GetBasic((Alias_BaboFollowerRef01.getref() as actor), 1)
kmyQuest.GetBasic((Alias_BaboFollowerRef02.getref() as actor), 2)
(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
(Alias_BaboFollowerRef02.getref() as actor).EvaluatePackage()
Game.getplayer().additem(BaboFollowerGift05, 1)
BFollowerCLQ05Switch.setvalue(1)


(BaboFollowerSceneTriggerCLQ05S10 as BaboFollowerSceneTriggerScript).ResetTrigger()
BaboFollowerSceneTriggerCLQ05S10.disable()
(BaboFollowerSceneTriggerCLQ05S012 as BaboFollowerSceneTriggerScript).ResetTrigger()
BaboFollowerSceneTriggerCLQ05S012.disable()
(BaboFollowerSceneTriggerCLQ05S17 as BaboFollowerSceneTriggerScript).ResetTrigger()
BaboFollowerSceneTriggerCLQ05S17.disable()
Alias_FoeRef01.GetReference().Disable(True)
Alias_FoeRef02.GetReference().DeleteWhenAble()
Alias_FoeRef03.GetReference().Disable(True)
Alias_FoeRef04.GetReference().Disable(True)
Alias_FoeRef05.GetReference().Disable(True)
Alias_FoeRef06.GetReference().Disable(True)
Alias_FoeRef07.GetReference().Disable(True)
Alias_FoeRef08.GetReference().DeleteWhenAble()
Alias_FoeRef09.GetReference().DeleteWhenAble()
Alias_FoeRef10.GetReference().DeleteWhenAble()
Alias_FoeRef02.Clear()
Alias_FoeRef08.Clear()
Alias_FoeRef09.Clear()
Alias_FoeRef10.Clear()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_16
Function Fragment_16()
;BEGIN CODE
;Waterfall appears
BaboFollowerCLQ05MarkerWaterfall.enable()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_13
Function Fragment_13()
;BEGIN CODE
(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
;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("BaboFollowerCLQ04 Started")
;BaboFollowerCLQ05Marker02 =DisableXmarker
;BaboFollowerCLQ05Marker04 = EnableXmarker
;BaboFollowerCLQ05Marker05 = Follower2SummoningPoint
;BaboFollowerCLQ05DoorRef=initially it's locked

kmyQuest.GoStateFirst()
BaboFollowerSceneTriggerCLQ05S00.enable()
kmyQuest.SpawnFolloweratPlace(BaboFollowerCLQ05Marker01, 1)
kmyQuest.SpawnEnemies(BaboLoansharkBandits, BaboFollowerCLQ05SceneMarker01, 4, Alias_FoeRef02)
(Alias_BaboFollowerRef01.getref() as actor).addtofaction(BaboCLQ05Faction)
Actor Foe02 = (Alias_FoeRef02.getref() as actor)
Foe02.removefromfaction(BaboLoanSharkFaction)
Foe02.addtofaction(BaboLoanSharkTempFaction)
Utility.Wait(1.0)
(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
(Alias_FoeRef02.getref() as actor).EvaluatePackage()
;CLQ05SceneTriggerRef01.Enable()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_5
Function Fragment_5()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
;When you refuse to help him
BFollowerCLQ05Route02.setvalue(1)
kmyQuest.RegisterUpdate(24)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_14
Function Fragment_14()
;BEGIN CODE
;He and I killed them all
;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
;Fight!!
BaboFollowerCLQQuestObjective.setstage(51)
BaboFollowerSceneTriggerCLQ05S012.Enable();EventTriggerBox appears
kmyQuest.SpawnFolloweratPlace(BaboFollowerCLQ05Marker05, 2)
kmyQuest.DSlaveFaction((Alias_BaboFollowerRef02.getref() as actor))
(Alias_BaboFollowerRef02.getref() as actor).EvaluatePackage()
kmyQuest.Getnaked((Alias_BaboFollowerRef02.getref() as actor), 1)
kmyQuest.SwitchXmarker(BaboFollowerCLQ05Marker04, BaboFollowerCLQ05Marker02)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_3
Function Fragment_3()
;BEGIN CODE
;Nothing
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_11
Function Fragment_11()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
;After all enemies all down except for the boss
;triggered by triggerbox
;(Alias_FoeRef01.getref() as actor).EvaluatePackage()
;(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
BaboFollowerCLQ05DoorRef.lock(false);Now the door has opened.
kmyQuest.SpawnEnemies(BaboLoansharkEliteBandits, BaboFollowerCLQ05Marker10, 4, Alias_FoeRef08)
kmyQuest.SpawnEnemies(BaboLoansharkEliteBandits, BaboFollowerCLQ05Marker10, 4, Alias_FoeRef09)
kmyQuest.SpawnEnemies(BaboLoansharkEliteBandits, BaboFollowerCLQ05Marker10, 4, Alias_FoeRef10)
Utility.wait(3.0)
kmyQuest.MovetoSpot((Alias_BaboFollowerRef01.getref() as actor), BaboFollowerCLQ05Marker14)
kmyQuest.SceneToStart()
;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
;Standing by for the dialogue with a potential follower

(Alias_FoeRef02.getref() as actor).EvaluatePackage()
;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
;When you are trying to help him
BFollowerCLQ05Route01.setvalue(1)
(Alias_BaboFollowerRef01.getref() as actor).EvaluatePackage()
BaboFollowerCLQQuestObjective.setstage(50)
BaboFollowerCLQ05MapMarker.addtomap()
kmyQuest.RegisterUpdate(2)
;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
;BaboFollowerCLQ05Marker03= Follower Moving Point
Actor Foe02 = (Alias_FoeRef02.getref() as actor)
Foe02.removefromfaction(BaboLoanSharkTempFaction)
Foe02.addtofaction(BaboLoanSharkFaction)
BaboFollowerSceneTriggerCLQ05S10.enable()
kmyQuest.MovetoSpot((Alias_BaboFollowerRef01.getref() as actor), BaboFollowerCLQ05Marker03)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_8
Function Fragment_8()
;BEGIN AUTOCAST TYPE BaboFollowerMasterScript
Quest __temp = self as Quest
BaboFollowerMasterScript kmyQuest = __temp as BaboFollowerMasterScript
;END AUTOCAST
;BEGIN CODE
;Reset
kmyQuest.GoStateFirst()
BFollowerCLQ05Switch.setvalue(0)
BaboFollowerCLQ05MarkerWaterfall.disable()
kmyQuest.SwitchXmarker(BaboFollowerCLQ05Marker02, BaboFollowerCLQ05Marker04)
BaboFollowerCLQ05DoorRef.lock(true)
BFollowerCLQ05Route01.setvalue(0)
BFollowerCLQ05Route02.setvalue(0)
(BaboFollowerSceneTriggerCLQ05S10 as BaboFollowerSceneTriggerScript).ResetTrigger()
BaboFollowerSceneTriggerCLQ05S10.disable()
(BaboFollowerSceneTriggerCLQ05S012 as BaboFollowerSceneTriggerScript).ResetTrigger()
BaboFollowerSceneTriggerCLQ05S012.disable()
(BaboFollowerSceneTriggerCLQ05S17 as BaboFollowerSceneTriggerScript).ResetTrigger()
BaboFollowerSceneTriggerCLQ05S17.disable()
;END CODE
EndFunction
;END FRAGMENT

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

ObjectReference Property BaboFollowerCLQ05Marker01  Auto  

Actor Property BaboFollowerCLQ05Foe01  Auto  

ObjectReference Property BaboFollowerCLQ05Marker02  Auto  

ObjectReference Property BaboFollowerCLQ05DoorRef  Auto  

ObjectReference Property BaboFollowerCLQ05SceneMarker01  Auto  

ActorBase Property BaboLoansharkBandits  Auto  

ObjectReference Property BaboFollowerSceneTriggerCLQ05S00  Auto  

ObjectReference Property BaboFollowerCLQ05Marker03  Auto  

ObjectReference Property BaboFollowerCLQ05Marker04  Auto  

ObjectReference Property BaboFollowerCLQ05Marker05  Auto  

GlobalVariable Property BFollowerCLQ05Route01  Auto  

GlobalVariable Property BFollowerCLQ05Route02  Auto  

ObjectReference Property BaboFollowerSceneTriggerCLQ05S10  Auto  

Faction Property BaboLoanSharkFaction  Auto  

Faction Property BaboLoanSharkTempFaction  Auto  

Faction Property BaboLoanSharkBossFaction  Auto  

Faction Property BaboCLQ05Faction  Auto  

ActorBase Property BaboLoansharkEliteBandits  Auto  

ObjectReference Property BaboFollowerSceneTriggerCLQ05S012  Auto  

ObjectReference Property BaboFollowerCLQ05Marker10  Auto  

Scene Property BaboFollowerCLQ05Scene03  Auto  

Quest Property BaboFollowerCLQQuestObjective  Auto  

ObjectReference Property BaboFollowerSceneTriggerCLQ05S17  Auto  

ObjectReference Property BaboFollowerCLQ05MapMarker  Auto  

LeveledItem Property BaboFollowerGift05  Auto  

ObjectReference Property BaboFollowerCLQ05MarkerWaterfall  Auto  

GlobalVariable Property BFollowerCLQ05Switch  Auto  

ActorBase Property BaboLoanSharkBossHighelf  Auto  

Scene Property BaboFollowerCLQ05Scene04  Auto  

ObjectReference Property BaboFollowerCLQ05Marker14  Auto  
