Scriptname _00E_MQ13a_Functions extends Quest Conditional Import Utility ;===================================================================================== ; FUNCTIONS ;===================================================================================== Function SetUp() String facegen = "bUseFaceGenPreprocessedHeads:General" Utility.SetINIBool(facegen, False) Game.GetPlayer().QueueNiNodeUpdate() Utility.SetINIBool(facegen, True) MQ12c_SC1_ExecutionVoiceTealor001.Disable() MQ12c_SC1_ExecutionVoiceTealor001.Disable() MQ12c_SC1_ExecutionDoor001.BlockActivation(False) SetObjectiveDisplayed(1) If _00E_MC_YuslanREF.IsDisabled() _00E_MC_YuslanREF.Enable() EndIf If _00E_MC_LexREF.IsDisabled() _00E_MC_LexREF.Enable() EndIf MQ12b_SC15_TempleScene03.Stop() ; This starts the Forgotten Stories - quest for Yuslan. FS_NQ01.SetStage(5) _00E_MC_YuslanREF.MoveTo(MQ13a_SC01_YuslanMarker) _00E_MC_LexREF.MoveTo(MQ13a_SC01_LexMarkerREF) MQ13a_SC01_LexYuslan.ForceStart() EndFunction Function AddScrollSetUpSC02() If _00E_SC_KurmaiREF.IsDisabled() _00E_SC_KurmaiREF.Enable() EndIf if FS_NQ01.GetStage() < 10 FS_NQ01.SetStage(10) EndIf _00E_SC_KurmaiREF.MoveTo(MQ13a_SC03_KurmaiStartMarker) MQ13a_SC03_SpiderREF.MoveToMyEditorLocation() MQ13a_Duneville_NehrimeseSoldiersParentREF.Enable() MQ13a_SC02_StarlingCaveREF.Lock(False) PlayerREF.AddItem(_01E_TeleportrolleDuenenhaim, 1) If NQ01.IsRunning() && !NQ01.IsCompleted() NQ01.SetStage(35) EndIf EndFunction Function StartSC02() If NQ01.IsRunning() && !NQ01.IsCompleted() NQ01.SetStage(35) EndIf MQ13a_SC02_Cave_YoungMageREF.MoveTo(MQ13a_SC02_Cave_YoungMage01MarkerREF) MQ13a_SC02_Cave_YoungMage02REF.MoveTo(MQ13a_SC02_Cave_YoungMage02MarkerREF) MQ13a_SC02_ArcanistConversation.ForceStart() MQ13a_SC3TriggerREF.Enable() EndFunction Function StartSC03() _00E_SC_KurmaiREF.MoveTo(MQ13a_SC03_KurmaiStartMarker) MQ13a_SC03_SpiderREF.MoveTo(MQ13a_SC05_KurmaiMarker) MQ13a_SC03_KurmaiConversation.ForceStart() EndFunction Function EnableStuff() int iIndex = MQ13a_SC04_StuffFormlist.GetSize() while iIndex > 0 iIndex -= 1 ObjectReference objToEnable = MQ13a_SC04_StuffFormlist.GetAt(iIndex) as ObjectReference objToEnable.Enable() EndWhile EndFunction Function AddCube() bCubeCollected = True ;MQ13a_SC04_CubeStandREF001.Disable() PlayerREF.AddItem(DA04DweLexiconCubeRunes01, 1) Self.SetObjectiveCompleted(15) If Self.IsObjectiveCompleted(10) Self.SetStage(50) Game.RequestAutoSave() EndIf EndFunction Function UpdateAlloyCounter() MQ13a_SakkabakkuAlloysCollected.SetValue(MQ13a_SakkabakkuAlloysCollected.GetValue() + 1) Self.UpdateCurrentInstanceGlobal(MQ13a_SakkabakkuAlloysCollected) int iCurrentCount = MQ13a_SakkabakkuAlloysCollected.GetValueInt() if iCurrentCount == 5 Self.SetObjectiveCompleted(10, 1) bAlloysCollected = True ElseIf iCurrentCount < 5 Self.SetObjectiveCompleted(10,0) Self.SetObjectiveDisplayed(10, True, True) EndIf If Self.IsObjectiveCompleted(15) && iCurrentCount == 5 bAlloysCollected = True Self.SetStage(50) Game.RequestAutoSave() EndIf EndFunction Function GiveTeleportScroll() PlayerREF.AddItem(_01E_TeleportrolleKurmaiCave, 3) MQ13Barriere01.disable() EndFunction Function RemoveAlloys() PlayerREF.RemoveItem(_00E_MQ13a_SakkabakkuAlloy, 5) bAlloysRemoved = True EndFunction Function RemoveCrystalCube() PlayerREF.RemoveItem(DA04DweLexiconCubeRunes01) bCubeRemoved = True EndFunction Function MoveTealorFailsave() If _00E_MC_TealorREF.IsDisabled() _00E_MC_TealorREF.Enable() EndIf _00E_MC_TealorREF.MoveTo(MQ13a_SC04_TealorStandMarkerREF) EndFunction Function StartSC04() If _00E_MC_TealorREF.IsDisabled() _00E_MC_TealorREF.Enable() EndIf _00E_MC_TealorREF.MoveTo(MQ13a_SC04_TealorStandMarkerREF) MQ13a_SC04_Tealor.ForceStart() EndFunction Function OfferWaitOption() int iButton = MQ13a_WaitPrompt.Show() If iButton == 0 FadeToBlackIMOD.Apply() Wait(2) FadeToBlackHoldIMOD.ApplyCrossFade(1) SetUpSC05() PlayerREF.MoveTo(MQ13a_SC05_StarshipPlayerMarkerREF) FadeToBlackBackIMOD.ApplyCrossFade(1) Else RegisterForSingleUpdateGameTime(24) SetObjectiveDisplayed(50) EndIf EndFunction Function SetUpSC05() MQ13a_SC05_Spectator01.MoveTo(MQ13a_SC05_RailMarker01) MQ13a_SC05_Spectator02.MoveTo(MQ13a_SC05_RailMarker02) MQ13a_SC05_Spectator03.MoveTo(MQ13a_SC05_WallMarker01) MQ13a_SC05_Spectator04.MoveTo(MQ13a_SC05_SitEdgeMarker01) MQ13a_SC05_Spectator05.MoveTo(MQ13a_SC05_LookFarMarker01) MQ13a_SC05_Spectator06.MoveTo(MQ13a_SC05_TableMarker01) MQ13a_SC05_Spectator07.MoveTo(MQ13a_SC05_CrossedArmrsMarker) MQ13a_SC05_Spectator07.EvaluatePackage() MQ13a_SC05_Spectator06.EvaluatePackage() MQ13a_SC05_Spectator05.EvaluatePackage() MQ13a_SC05_Spectator04.EvaluatePackage() MQ13a_SC05_Spectator03.EvaluatePackage() MQ13a_SC05_Spectator02.EvaluatePackage() MQ13a_SC05_Spectator01.EvaluatePackage() MQ13a_SC02_Cave_YoungMageREF.EvaluatePackage() MQ13a_SC02_Cave_YoungMage02REF.EvaluatePackage() MQ13a_SC02_Cave_YoungMageREF.MoveTo(MQ13a_SC02_Cave_YoungMage01MarkerREF) MQ13a_SC02_Cave_YoungMage02REF.MoveTo(MQ13a_SC02_Cave_YoungMage02MarkerREF) EnableAndMove(_00E_MC_CaliaREF, MQ13a_SC05_CaliaRailMarker) EnableAndMove(_00E_MC_JesparREF, MQ13a_SC05_JesparSitMarker) EnableAndMove(_00E_MC_YaelaREF, MQ13a_SC05_YaelaStudyMarker) EnableAndMove(_00E_MQ07a_YoungMageREF, MQ13a_SC05_LijamMarker) EnableAndMove(_00E_MC_TealorREF, MQ13a_SC05_TealorMarker) EnableAndMove(_00E_SC_KurmaiREF, MQ13a_SC05_KurmaiMarker) MQ13a_SC05_SpiderParentREF.Disable() Self.SetStage(65) MQ13a_SC05_Departure01.ForceStart() EndFunction Function EnableAndMove(ObjectReference refToMove, ObjectReference refTargetLocation) If refToMove.IsDisabled() refToMove.Enable() EndIf refToMove.MoveTo(refTargetLocation) EndFunction Function AddAmulet() PlayerREF.AddItem(_00E_MQ13a_NarathzulsEmblem, 1) bAmuletGiven = True EndFunction Function CloseRamp() If _00E_Music_Special_MQ13a_StarshipTakeOff ; do nothing EndIf _00E_A2_StarlingdummySteamReleaseM.Play(MQ13a_SC06_Ramp) MQ13a_SC06_Ramp.SetOpen(True) EndFunction Function StartSC06() _00E_PlayerFunctions.GetSoundControl().RemoveSilence() _00E_Music_Special_MQ13a_StarshipTakeOff.Add() Game.RequestAutoSave() MQ13a_StarshipInteriorRockLinkerREF.Disable() MQ13a_StarshipCaveDoorMarkerREF.BlockActivation(True) MQ13a_SC06_StarshipTakeOff.ForceStart() EndFunction Function TakeOff() _00E_TeleportGlobal.SetValueInt(1) _00E_MQ13c_TurretChargeSoundM.Play(PlayerREF) Game.ShakeCamera() MQ13a_SC06_SmokeREF.Enable() MQ13a_SC06_NavcutREF.Enable() _00E_A2_StarlingdummySteamReleaseM.Play(MQ13a_SC06_SmokeREF) MQ13a_SC06_Ramp.SetOpen(True) _00E_MQ13c_StarshipTakeOffM.Play(PlayerREF) EndFunction Function TealorFailsave() _00E_MC_TealorREF.MoveTo(MQ13a_SC06_TealorWalkAway) EndFunction Function Levitate() Game.ShakeCamera(afStrength = 0.4) MQ13a_SC06_SmokeREF.TranslatetoREF(MQ13a_SC06_SmokeTranslateREF, 80.0, 75.0) MQ13a_SC06_SmokeREF001.TranslatetoREF(MQ13a_SC06_SmokeTranslateREF001, 80.0, 75.0) MQ13a_SC06_StarshipREF.TranslateToREF(MQ13a_SC06_StarshipTakeOffMarker, 75.0, 75.0) EndFunction Function StarshipFadeToBlack() FadeToBlackIMOD.Apply() Wait(2) FadeToBlackHoldIMOD.ApplyCrossFade(1) SetStage(75) EndFunction Function CleanUpAndSetUpSC07() If _00E_MC_JesparREF.IsDisabled() _00E_MC_JesparREF.Enable() EndIf Game.ShowFirstPersonGeometry(True) PlayerREF.UnequipAll() PlayerREF.EquipItem(_00E_Mining_FineClothesF_GreenA, false, true) PlayerREF.EquipItem(ClothesJarlShoes, false, true) PlayerREF.UnequipItem(PlayerREF.GetEquippedWeapon(0), false, true) PlayerREF.UnequipItem(PlayerREF.GetEquippedWeapon(1), false, true) PlayerREF.UnequipItem(PlayerREF.GetEquippedShield(), false, true) ; TODO, Gavrant, 2021-06-21: No idea what the commented-out code below was supposed to do. ; But it would conflict with the follow-up romance kiss scenes that attempt to do the same, but for both sexes of HighElfRace ; Why only for males and why no scale reverts if no romance happens are a mystery. Target this for later purge. ;/ If PlayerREF.GetActorBase().GetRace() == HighElfRace && PlayerREF.GetActorBase().GetSex() == 0 PlayerREF.SetScale(0.92) EndIf /; Weather.ReleaseOverride() MQ13a_Door02_REF.Enable() MQ13a_Door01_REF.Disable() _00E_MC_JesparREF.MoveTo(MQ13a_SC07_JesparLeanMarker) _00E_SC_KurmaiREF.MoveTo(MQ13a_SC07_KurmaiKneelMarker) _00E_MC_YaelaREF.MoveTo(MQ13a_SC07_YaelaPrayMarker) _00E_MQ07a_YoungMageREF.MoveTo(MQ13a_SC07_LijamLeanWallMarker01) _00E_SC_KurmaiREF.EvaluatePackage() _00E_MC_YaelaREF.EvaluatePackage() _00E_MC_JesparREF.EvaluatePackage() _00E_MQ07a_YoungMageREF.EvaluatePackage() MQ13a_SC06_StarshipREF.Disable() _00E_MC_TealorREF.MoveToMyEditorLocation() MQ13a_SC05_Spectator01.Disable() MQ13a_SC05_Spectator02.Disable() MQ13a_SC05_Spectator03.Disable() MQ13a_SC05_Spectator04.Disable() MQ13a_SC05_Spectator05.Disable() MQ13a_SC05_Spectator06.Disable() MQ13a_SC05_Spectator07.Disable() MQ13a_SC02_Cave_YoungMageREF.Disable() MQ13a_SC02_Cave_YoungMage02REF.Disable() Timescale.SetValue(0.1) _00E_TimeControl.SkipTimeToHour(0) PlayerREF.MoveTo(MQ13a_SC07_PlayerStart) PlayerREF.EquipItem(_00E_InvisibleHelmet_Armor, false, true) Utility.Wait(0.1) PlayerREF.RemoveItem(_00E_InvisibleHelmet_Armor, 1, true) Wait(3) _00E_Music_Special_MQ13a_StarshipTakeOff.Remove() FadeToBlackBackIMOD.ApplyCrossFade(0.5) Wait(4) If (RomanceLockedJespar.GetValueInt() == 1) && (CaliaFlirtCounter.GetValueInt() >= 3) ; Player is interested in pursuing a relationship with Calia _00E_MC_JesparREF.Enable() _00E_MC_JesparREF.SetAlpha(1.0) _00E_MQ13a_CaliaDump.SetValueInt(1) If CQJ04.IsCompleted() _00E_MC_CaliaREF.MoveTo(_00E_NPCDumpMarker) CQJ05.SetStage(5) SetObjectiveDisplayed(30) SetObjectiveDisplayed(35) Elseif CQC04.IsCompleted() CQC05.SetStage(5) SetObjectiveDisplayed(20) SetObjectiveDisplayed(25) Else _00E_MC_CaliaREF.MoveTo(_00E_NPCDumpMarker) SetObjectiveDisplayed(40) EndIf Elseif (RomanceLockedCalia.GetValueInt() == 1) && (JesparFlirtCounter.GetValueInt() >= 3) ; Player is interested in pursuing a relationship with Jespar _00E_MQ13a_JesparDump.SetValueInt(1) _00E_MC_CaliaREF.Enable() _00E_MC_CaliaREF.SetAlpha(1.0) If CQC04.IsCompleted() _00E_MC_JesparREF.MoveTo(_00E_NPCDumpMarker) CQC05.SetStage(5) SetObjectiveDisplayed(20) SetObjectiveDisplayed(25) Elseif CQJ04.IsCompleted() CQJ05.SetStage(5) SetObjectiveDisplayed(30) SetObjectiveDisplayed(35) Else _00E_MC_JesparREF.MoveTo(_00E_NPCDumpMarker) SetObjectiveDisplayed(40) EndIf Elseif (CaliaFlirtCounter.GetValueInt() > JesparFlirtCounter.GetValueInt()) _00E_MC_JesparREF.Enable() _00E_MC_JesparREF.SetAlpha(1.0) _00E_MQ13a_CaliaDump.SetValueInt(1) If CQJ04.IsCompleted() _00E_MC_CaliaREF.MoveTo(_00E_NPCDumpMarker) CQJ05.SetStage(5) SetObjectiveDisplayed(30) SetObjectiveDisplayed(35) Elseif CQC04.IsCompleted() CQC05.SetStage(5) SetObjectiveDisplayed(20) SetObjectiveDisplayed(25) Else _00E_MC_CaliaREF.MoveTo(_00E_NPCDumpMarker) SetObjectiveDisplayed(40) EndIf Else _00E_MC_CaliaREF.Enable() _00E_MC_CaliaREF.SetAlpha(1.0) If CQC04.IsCompleted() _00E_MC_JesparREF.Disable() CQC05.SetStage(5) SetObjectiveDisplayed(20) SetObjectiveDisplayed(25) Elseif CQJ04.IsCompleted() CQJ05.SetStage(5) SetObjectiveDisplayed(30) SetObjectiveDisplayed(35) Else _00E_MC_JesparREF.Disable() SetObjectiveDisplayed(40) EndIf EndIf EndFunction Function CallSleepBox() int iButton02 = MQ13a_SC07_WaitPrompt02.Show() if iButton02 == 0 FadeToBlackIMOD.Apply() Wait(2) FadeToBlackHoldIMOD.ApplyCrossFade(1) SetStage(80) SetObjectiveCompleted(25) ElseIf iButton02 == 1 Return EndIf EndFunction Function FinishQuest() CompleteAllObjectives() PlayerREF.EquipItem(_00E_Mining_FineClothesF_GreenA, false, true) PlayerREF.EquipItem(ClothesJarlShoes, false, true) _00E_EPHandler.GiveEP(__Config_RewardEXP) MQ13b.SetStage(5) If CQC05.IsRunning() && !CQC05.IsCompleted() CQC05.SetStage(65) EndIf If CQJ05.IsRunning() && !CQJ05.IsCompleted() CQJ05.SetStage(30) EndIf EndFunction ;===================================================================================== ; EVENTS ;===================================================================================== Event OnUpdateGameTime() SetUpSC05() SetObjectiveCompleted(50) EndEvent ;===================================================================================== ; PROPERTIES ;===================================================================================== int Property __Config_RewardEXP = 500 Auto {How much EXP is to be granted upon quest completion} bool Property bAlloysRemoved Auto Conditional Hidden bool Property bAlloysCollected Auto Conditional Hidden bool Property bCubeCollected Auto Conditional Hidden bool Property bCubeRemoved Auto Conditional Hidden bool Property bAmuletGiven Auto Conditional Hidden Actor Property _00E_MC_LexREF Auto Actor Property _00E_MC_TealorREF Auto Actor Property _00E_MC_YuslanREF Auto Actor Property _00E_MC_JesparREF Auto Actor Property _00E_MC_CaliaREF Auto Actor Property _00E_SC_KurmaiREF Auto Actor Property _00E_MC_YaelaREF Auto Actor Property _00E_MQ07a_YoungMageREF Auto Actor Property PlayerREF Auto Actor Property MQ13a_SC05_Spectator01 Auto Actor Property MQ13a_SC05_Spectator02 Auto Actor Property MQ13a_SC05_Spectator03 Auto Actor Property MQ13a_SC05_Spectator04 Auto Actor Property MQ13a_SC05_Spectator05 Auto Actor Property MQ13a_SC05_Spectator06 Auto Actor Property MQ13a_SC05_Spectator07 Auto Actor Property MQ13a_SC02_Cave_YoungMageREF Auto Actor Property MQ13a_SC02_Cave_YoungMage02REF Auto Armor Property _00E_MQ13a_NarathzulsEmblem Auto Armor Property _00E_Mining_FineClothesF_GreenA Auto Armor Property ClothesJarlShoes Auto Armor Property _00E_InvisibleHelmet_Armor Auto Formlist Property MQ13a_SC04_StuffFormlist Auto ObjectReference Property MQ13a_SC01_YuslanMarker Auto ObjectReference Property MQ13a_SC01_LexMarkerREF Auto ObjectReference Property MQ13a_SC02_StarlingCaveREF Auto ObjectReference Property MQ13a_SC02_Cave_YoungMage02MarkerREF Auto ObjectReference Property MQ13a_SC02_Cave_YoungMage01MarkerREF Auto ObjectReference Property MQ13a_SC03_SpiderREF Auto ObjectReference Property MQ13a_SC03_KurmaiStartMarker Auto ObjectReference Property MQ13a_SC04_CubeStandREF001 Auto ObjectReference Property MQ13a_SC04_TealorStandMarkerREF Auto ObjectReference Property MQ13a_SC05_StarshipPlayerMarkerREF Auto ObjectReference Property MQ13a_SC05_CrossedArmrsMarker Auto ObjectReference Property MQ13a_SC05_RailMarker01 Auto ObjectReference Property MQ13a_SC05_RailMarker02 Auto ObjectReference Property MQ13a_SC05_WallMarker01 Auto ObjectReference Property MQ13a_SC05_SitEdgeMarker01 Auto ObjectReference Property MQ13a_SC05_LookFarMarker01 Auto ObjectReference Property MQ13a_SC05_TableMarker01 Auto ObjectReference Property MQ13a_SC05_CaliaRailMarker Auto ObjectReference Property MQ13a_SC05_JesparSitMarker Auto ObjectReference Property MQ13a_SC05_YaelaStudyMarker Auto ObjectReference Property MQ13a_SC05_LijamMarker Auto ObjectReference Property MQ13a_SC05_KurmaiMarker Auto ObjectReference Property MQ13a_SC05_TealorMarker Auto ObjectReference Property MQ13a_SC05_SpiderParentREF Auto ObjectReference Property MQ13a_SC06_SmokeREF Auto ObjectReference Property MQ13a_SC06_SmokeREF001 Auto ObjectReference Property MQ13a_SC06_Ramp Auto ObjectReference Property MQ13a_SC06_NavcutREF Auto ObjectReference Property MQ13a_SC06_StarshipTakeOffMarker Auto ObjectReference Property MQ13a_SC06_SmokeTranslateREF Auto ObjectReference Property MQ13a_SC06_SmokeTranslateREF001 Auto ObjectReference Property MQ13a_SC06_StarshipREF Auto ObjectReference Property MQ13a_SC07_JesparLeanMarker Auto ObjectReference Property MQ13a_SC07_KurmaiKneelMarker Auto ObjectReference Property MQ13a_SC07_LijamLeanWallMarker01 Auto ObjectReference Property MQ13a_SC07_YaelaPrayMarker Auto ObjectReference Property MQ13a_SC07_PlayerStart Auto ObjectReference Property MQ13a_Door01_REF Auto ObjectReference Property MQ13a_Door02_REF Auto ObjectReference Property MQ13a_SC06_TealorWalkAway Auto ObjectReference Property MQ12c_SC1_ExecutionVoiceTealor001 Auto ObjectReference Property MQ12c_SC1_ExecutionDoor001 Auto ObjectReference Property MQ13a_Duneville_NehrimeseSoldiersParentREF Auto ObjectReference Property _00E_NPCDumpMarker Auto ObjectReference Property MQ13a_StarshipInteriorRockLinkerREF Auto ObjectReference Property MQ13a_StarshipCaveDoorMarkerREF Auto ObjectReference Property MQ13a_SC3TriggerREF Auto Quest Property CQC05 Auto Quest Property CQJ05 Auto Quest Property CQC04 Auto Quest Property CQJ04 Auto Quest Property MQ13b Auto Quest Property NQ01 Auto Quest Property FS_NQ01 Auto Race Property HighElfRace Auto Sound Property _00E_A2_StarlingdummySteamReleaseM Auto Sound Property _00E_MQ13c_StarshipTakeOffM Auto Sound Property _00E_MQ13c_TurretChargeSoundM Auto ImageSpaceModifier Property FadeToBlackIMOD Auto ImageSpaceModifier Property FadeToBlackHoldIMOD Auto ImageSpaceModifier Property FadeToBlackBackIMOD Auto MusicType Property _00E_Music_Special_MQ13a_StarshipTakeOff Auto GlobalVariable Property MQ13a_SakkabakkuAlloysCollected Auto GlobalVariable Property Timescale Auto GlobalVariable Property RomanceLockedCalia Auto GlobalVariable Property RomanceLockedJespar Auto GlobalVariable Property CaliaFlirtCounter Auto GlobalVariable Property JesparFlirtCounter Auto GlobalVariable Property _00E_TeleportGlobal Auto GlobalVariable Property _00E_MQ13a_JesparDump Auto GlobalVariable Property _00E_MQ13a_CaliaDump Auto Message Property MQ13a_WaitPrompt Auto Message Property MQ13a_SC07_WaitPrompt02 Auto MiscObject Property DA04DweLexiconCubeRunes01 Auto MiscObject Property _00E_MQ13a_SakkabakkuAlloy Auto Scene Property MQ13a_SC01_LexYuslan Auto Scene Property MQ13a_SC02_ArcanistConversation Auto Scene Property MQ13a_SC03_KurmaiConversation Auto Scene Property MQ13a_SC04_Tealor Auto Scene Property MQ13a_SC05_Departure01 Auto Scene Property MQ13a_SC06_StarshipTakeOff Auto Scene Property MQ12b_SC15_TempleScene03 Auto Scroll Property _01E_TeleportrolleDuenenhaim Auto Scroll Property _01E_TeleportrolleKurmaiCave Auto ObjectReference Property MQ13Barriere01 Auto