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

;BEGIN ALIAS PROPERTY MG05ArnielGaneAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05ArnielGaneAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05AssurAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05AssurAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05AncanoAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05AncanoAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05EiridAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05EiridAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05FaraldaGateMarker
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05FaraldaGateMarker Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05MirabelleAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05MirabelleAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05CreatureAlias04
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05CreatureAlias04 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05DagurAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05DagurAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05KraldarAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05KraldarAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY Winterhold
;ALIAS PROPERTY TYPE LocationAlias
LocationAlias Property Alias_Winterhold Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05CreatureAlias03
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05CreatureAlias03 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05SavosArenAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05SavosArenAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05CreatureAlias02
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05CreatureAlias02 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05HaranAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05HaranAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05CreatureAlias08
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05CreatureAlias08 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MGGateAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MGGateAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05MalurAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05MalurAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05SergiusAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05SergiusAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05GuardMarker02
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05GuardMarker02 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05CreatureAlias05
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05CreatureAlias05 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05CreatureAlias06
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05CreatureAlias06 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05ThaenaAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05ThaenaAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05TorcAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05TorcAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05TolfdirAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05TolfdirAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05CreatureAlias01
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05CreatureAlias01 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05CreatureAlias09
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05CreatureAlias09 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05CreatureAlias010
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05CreatureAlias010 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05FaraldaAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05FaraldaAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05RanmirAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05RanmirAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05NelacarAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05NelacarAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY WinterholdGuard1
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_WinterholdGuard1 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05CreatureAlias07
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05CreatureAlias07 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05ArnielGateMarker
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05ArnielGateMarker Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05KorirAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05KorirAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05BirnaAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05BirnaAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY WinterholdGuard2
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_WinterholdGuard2 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY WinterholdGuard3
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_WinterholdGuard3 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MGGate
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MGGate Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05GuardMarker01
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05GuardMarker01 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05GuardMarker03
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05GuardMarker03 Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05DrevisAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05DrevisAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05NiryaAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05NiryaAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY MG05PhinisAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_MG05PhinisAlias Auto
;END ALIAS PROPERTY

;BEGIN FRAGMENT Fragment_11
Function Fragment_11()
;BEGIN AUTOCAST TYPE MG05QuestScript
Quest __temp = self as Quest
MG05QuestScript kmyQuest = __temp as MG05QuestScript
;END AUTOCAST
;BEGIN CODE
SetObjectiveCompleted(50,1)
Game.GetPlayer().SetFactionRank(CollegeFaction,5)
Game.GetPlayer().AddItem(Alias_MG05TorcAlias.GetReference(), 1)
MGTorcAlias.ForceRefTo(Alias_MG05TorcAlias.GetReference())
Game.GetPlayer().Additem(MG05RewardAmulet,1)
Alias_MG05MirabelleAlias.GetActorReference().ModFavorPoints(kmyQuest.FavorRewardMedium.GetValueInt())
MG07.Start()
Stop()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_22
Function Fragment_22()
;BEGIN CODE
SetObjectiveCompleted(30,1)
SetObjectiveDisplayed(40,1)
if IsObjectiveDisplayed(20)
SetObjectiveDisplayed(20,0)
endif
if MG05CreatureEnableParentREF.IsDisabled()
MG05CreatureEnableParentREF.Enable()
endif
Alias_MG05SavosArenAlias.GetReference().Disable()
Alias_MG05AncanoAlias.GetActorReference().EvaluatePackage()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_19
Function Fragment_19()
;BEGIN CODE
SetObjectiveCompleted(20,1)
SetObjectiveDisplayed(30,1)
MG05CreatureEnableParentREF.Enable()
Alias_MGGateAlias.GetReference().Lock(false)
Alias_MGGateAlias.GetReference().SetOpen(true)
Alias_WinterholdGuard1.GetReference().Moveto(Alias_MG05GuardMarker01.GetReference())
Alias_WinterholdGuard2.GetReference().MoveTo(Alias_MG05GuardMarker02.GetReference())
Alias_WinterholdGuard3.GetReference().Moveto(Alias_MG05GuardMarker02.Getreference())
Alias_WinterholdGuard1.GetActorReference().EvaluatePackage()
Alias_WinterholdGuard2.GetActorReference().EvaluatePackage()
Alias_WinterholdGuard3.GetActorReference().EvaluatePackage()
MG05SmallBarrierRef.Enable()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_26
Function Fragment_26()
;BEGIN CODE
;Alias_MG05TolfdirAlias.GetReference().MoveTo(MG05TolfdirMarker)
;Alias_MG05TolfdirAlias.GetActorReference().EvaluatePackage()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_17
Function Fragment_17()
;BEGIN CODE
;SetObjectiveCompleted(10,1)
SetObjectiveDisplayed(20,1)
;Move Faralda and Arniel to markers if they haven't made it there already
Actor Faralda = Alias_MG05FaraldaAlias.GetReference() as Actor
if Faralda.IsDead() == False
Alias_MG05FaraldaAlias.GetReference().MoveTo(Alias_MG05FaraldaGateMarker.GetReference())
endif
Actor Arniel = Alias_MG05ArnielGaneAlias.GetReference() as Actor
if Arniel.IsDead() == False
Alias_MG05ArnielGaneAlias.GetReference().Moveto(Alias_MG05ArnielGateMarker.GetReference())
endif
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_0
Function Fragment_0()
;BEGIN CODE
;Alias_MGGate.GetReference().Lock(false)
;Alias_MGGate.GetReference().SetOpen(true)
Alias_MG05SavosArenAlias.GetReference().MoveTo(MG05SavosMarker)
Alias_MG05SavosArenAlias.GetActorReference().Kill()
Alias_MG05SavosArenAlias.GetReference().BlockActivation(true)
DialogueWinterholdCollegeQuestScript DQScript = MGDialogueQuest as DialogueWinterholdCollegeQuestScript
DQScript.GateOpen=1
Game.GetPlayer().SetFactionRank(CollegeFaction,4)
TolfdirCrouchMarker.Enable()
Alias_MG05TolfdirAlias.GetReference().MoveTo(TolfdirCrouchMarker)
SetStage(20)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_24
Function Fragment_24()
;BEGIN CODE
SetObjectiveCompleted(40,1)
SetObjectiveDisplayed(50,1)
MG05FaraldaTownScene.Start()
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_15
Function Fragment_15()
;BEGIN CODE
SetObjectiveDisplayed(10,1)
;END CODE
EndFunction
;END FRAGMENT

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

ObjectReference Property MG05SavosMarker  Auto  

ObjectReference Property MG05AncanoHoldMarker  Auto  




ObjectReference Property MG05TolfdirMarker  Auto  

Quest Property MG07  Auto  

Quest Property MGDialogueQuest  Auto  

MiscObject Property Keystone  Auto  

Faction Property CollegeFaction  Auto  

scene Property MG05FaraldaTownscene  Auto  

ObjectReference Property TolfdirCrouchMarker  Auto  

Armor Property MG05RewardAmulet  Auto  

ReferenceAlias Property MGTorcAlias  Auto  

ObjectReference Property MG05SmallBarrierRef  Auto  

ObjectReference Property MG05CreatureEnableParentREF  Auto  
