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

;BEGIN ALIAS PROPERTY FieldCO
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_FieldCO Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison3EnableImperial
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Garrison3EnableImperial Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly2EnableImperial
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly2EnableImperial Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison4EnableImperial
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Garrison4EnableImperial Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly5EnableImperial
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly5EnableImperial Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison1EnableImperial
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Garrison1EnableImperial Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison4EnableSons
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Garrison4EnableSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison3EnableSons
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Garrison3EnableSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison2ResourceObject
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Garrison2ResourceObject Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly3ResourceObject
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly3ResourceObject Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Galmar
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Galmar Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY FieldHQ
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_FieldHQ Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY CampaignStartMarker
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_CampaignStartMarker Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GenericFieldCOImperial
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GenericFieldCOImperial Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Hold
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_Hold Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly3EnableSons
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly3EnableSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly4EnableSons
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly4EnableSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly1ResourceObject
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly1ResourceObject Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY CampEnableSons
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_CampEnableSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY CapitalHQMarker
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_CapitalHQMarker Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY CapitalHQ
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_CapitalHQ Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly4ResourceObject
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly4ResourceObject Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GenericFieldCOSons
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GenericFieldCOSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Capital
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_Capital Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Jarl
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Jarl Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly5
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_GarrisonDefenderOnly5 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison3ResourceObject
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Garrison3ResourceObject Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison3
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_Garrison3 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly2ResourceObject
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly2ResourceObject Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY CampSons
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_CampSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY EnemyFieldCO
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_EnemyFieldCO Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison4ResourceObject
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Garrison4ResourceObject Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly5ResourceObject
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly5ResourceObject Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison1ResourceObject
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Garrison1ResourceObject Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison2EnableSons
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Garrison2EnableSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison1EnableSons
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Garrison1EnableSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY CampEnableImperial
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_CampEnableImperial Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison2
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_Garrison2 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly1
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_GarrisonDefenderOnly1 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison2EnableImperial
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Garrison2EnableImperial Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly3EnableImperial
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly3EnableImperial Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly2
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_GarrisonDefenderOnly2 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison1
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_Garrison1 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Garrison4
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_Garrison4 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY FortEnableImperial
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_FortEnableImperial Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Rikke
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_Rikke Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly4
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_GarrisonDefenderOnly4 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY CapitalEnableSons
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_CapitalEnableSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly6EnableImperial
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly6EnableImperial Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly2EnableSons
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly2EnableSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly1EnableSons
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly1EnableSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly6EnableSons
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly6EnableSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly3
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_GarrisonDefenderOnly3 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly5EnableSons
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly5EnableSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly1EnableImperial
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly1EnableImperial Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY CampImperialLocationCenterMarker
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_CampImperialLocationCenterMarker Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY CampSonsLocationCenterMarker
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_CampSonsLocationCenterMarker Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY EnemyFieldHQ
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_EnemyFieldHQ Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly6ResourceObject
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly6ResourceObject Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Fort
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_Fort Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY FortEnableSons
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_FortEnableSons Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly6
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_GarrisonDefenderOnly6 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY CapitalEnableImperial
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_CapitalEnableImperial Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY GarrisonDefenderOnly4EnableImperial
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_GarrisonDefenderOnly4EnableImperial Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY CampImperial
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_CampImperial Auto
;END ALIAS PROPERTY

;BEGIN FRAGMENT Fragment_6
Function Fragment_6()
;BEGIN AUTOCAST TYPE CWCampaignScript
Quest __temp = self as Quest
CWCampaignScript kmyQuest = __temp as CWCampaignScript
;END AUTOCAST
;BEGIN CODE
;TURN ON EVERYTHING IN THE SIEGE QUEST

kmyquest.CWSiege.setStage(1)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_2
Function Fragment_2()
;BEGIN AUTOCAST TYPE CWCampaignScript
Quest __temp = self as Quest
CWCampaignScript kmyQuest = __temp as CWCampaignScript
;END AUTOCAST
;BEGIN CODE
; ; debug.traceConditional("CWCampaign Stage 255. Shutting down campaign. ", kmyquest.CWs.debugon.value)

kmyquest.CWs.finishCampaign()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_4
Function Fragment_4()
;BEGIN AUTOCAST TYPE CWCampaignScript
Quest __temp = self as Quest
CWCampaignScript kmyQuest = __temp as CWCampaignScript
;END AUTOCAST
;BEGIN CODE
;kmyquest.CWs.CampaignRunning = 0 ;not running
;THIS NOW HAPPENS IN THE CW Script FinishCampaign() function in case the player gets back to faction leader before the new campaign starts and sets it to 1
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_0
Function Fragment_0()
;BEGIN AUTOCAST TYPE CWCampaignScript
Quest __temp = self as Quest
CWCampaignScript kmyQuest = __temp as CWCampaignScript
;END AUTOCAST
;BEGIN CODE
; ; debug.traceConditional("CWCampaign Stage 0. Setting up new campaign. ", kmyquest.CWs.debugon.value)

;Initialize a new Campaign
kmyquest.CWs.CampaignRunning = 1 ;busy setting up
kmyquest.ForceFieldHQAliases()
kmyquest.SetCWCampaignFieldCOAliases()
kmyquest.ResetCampaign()
kmyquest.PurchaseGarrisons()
kmyquest.AdvanceCampaignPhase()
kmyquest.CWs.CampaignRunning = 2 ;done setting up

; ; debug.traceConditional("CWCampaign Stage 0. Done setting up new campaign. Calling StartTraveling()  on FieldCO and EnemyFieldCO to have them moveTo if the player isn't around", kmyquest.CWs.debugon.value)
; ; debug.traceConditional("CWCampaign Stage 0. FieldCO = Ref" +Alias_FieldCO.GetReference(), kmyquest.CWs.debugon.value)
; ; debug.traceConditional("CWCampaign Stage 0. EnemyFieldCO = Ref" +Alias_EnemyFieldCO.GetReference(), kmyquest.CWs.debugon.value)
(Alias_FieldCO as CWCampaignFieldCOScript).StartTraveling(kmyquest.GetFieldHQMarker())
(Alias_EnemyFieldCO as CWCampaignFieldCOScript).StartTraveling(kmyquest.GetEnemyFieldHQMarker())
;END CODE
EndFunction
;END FRAGMENT

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