scriptname _00E_MQ07b_Questfunctions extends Quest Conditional Import Utility Import _00E_QuestFunctions ;===================================================================================== ; EVENTS ;===================================================================================== Event OnUpdate() If GetStage() >= 145 && GetStage() < 150 SetStage(150) EndIf If (PlayerREF.GetParentCell() == AltDothulgradL4) && (GetStage() == 80) If !MQ07b_SC04_Massacre.IsPlaying() MQ07b_SC04_Massacre.ForceStart() If !_00E_MC_CaliaREF.IsEnabled() _00E_MC_CaliaREF.Enable() _00E_MC_CaliaREF.MoveTo(MQ07b_CaliaStandMarker) EndIf EndIf EndIf EndEvent ;===================================================================================== ; FUNCTIONS ;===================================================================================== Function StartQuest() CompanionIsTalking.SetValueInt(0) Levelsystem.SetAllowIdleChatter(False) Levelsystem.RemoveSilence() _00E_MC_CaliaREF.Enable() _00E_MC_CaliaREF.MoveTo(CaliaStartMarker) _00E_MC_CaliaREF.SetOutfit(_00E_MC_Calia_Outfit) MQ07b_DeusExMachina.SetObjectiveDisplayed(10) if !_00E_MC_LishariREF.IsDisabled() _00E_MC_LishariREF.Enable() EndIf _00E_MC_LishariREF.MoveTo(MQ07_SC02_LishariStartMarker) If !CQC01.IsCompleted() CQC01.SetStage(20) EndIf ; Fix for http://sureai.net:9898/browse/ERB-914 and ; http://sureai.net:9898/browse/ERB-982 (hopefully). Karek.SetGhost(True) Karek.GetActorBase().SetEssential(True) ; Stop Lishari's chatter scene in the tavern. (It would mess with ; her AI in the ruin.) If LishariDialogue_SC01_LishariConversation.IsPlaying() LishariDialogue_SC01_LishariConversation.Stop() EndIf EndFunction Function PrepareSC02() _00E_MC_LishariREF.MoveTo(MQ07_SC02_LishariStartMarker) SoldatAlias01.GetReference().MoveTo(MQ07b_SC02_GuardStandMarker) EndFunction Function StartEscort() MQ07b_DeusExMachina.SetObjectiveCompleted(20) MQ07b_DeusExMachina.SetObjectiveDisplayed(30) _00E_MC_CaliaREF.EvaluatePackage() _00E_MC_CaliaREF.SetOutfit(_00E_MC_Calia_Outfit) Counter.SetValue(1.0) MQ07MapMarker.AddToMap(false) DoorRef.Enable() MQ07b_SC01_CaliaComment.ForceStart() SetNPCAsCompanion(_00E_MC_CaliaREF, True, 350, 400, 100) EndFunction Function SC02Failsave() if !MQ07b_SC02_Lishari.IsActionComplete(7) MQ07b_SC02_Lishari.ForceStart() EndIf EndFunction Function PlayBellVision() if GetStage() < 55 MQ07b_DeusExMachina.SetObjectiveCompleted(40) EndIf Formlist refsInvolved refsInvolved.AddForm(_00E_MC_CaliaREF as Actor) refsInvolved.AddForm(_00E_MC_LishariREF as Actor) refsInvolved.AddForm(MQ07b_Hireling_Ref as Actor) Formlist glowingRefs glowingRefs.AddForm(MQ07b_SC03_BurntCorpseREF) Levelsystem.VisionEffectNoTimestop(glowingRefs, MQ07b_SC2_BellVisionStaticRefs, false) Wait(1.0) _00E_QuestshaderRed.Play(MQ07Bell01, 2.0) _00E_BellGong_03.Play(MQ07Bell01) Game.ShakeCamera(afStrength = 0.1) Wait(2.0) _00E_QuestshaderRed.Play(MQ07Bell02, 2.0) _00E_BellGong_04.Play(MQ07Bell02) Game.ShakeCamera(afStrength = 0.1) Wait(2.0) _00E_BellGong_05.Play(MQ07Bell03) _00E_QuestshaderRed.Play(MQ07Bell03, 2.0) Game.ShakeCamera(afStrength = 0.1) Wait(2.0) _00E_BellGong_02.Play(MQ07Bell04) _00E_QuestshaderRed.Play(MQ07Bell04, 2.0) Game.ShakeCamera(afStrength = 0.1) Wait(2.0) _00E_QuestshaderRed.Play(MQ07Bell02, 2.0) _00E_BellGong_04.Play(MQ07Bell02) Wait(2) Levelsystem.VisionEffectNoTimestopStop(glowingRefs, MQ07b_SC2_BellVisionStaticRefs) _00E_MC_CaliaREF.EvaluatePackage() _00E_MC_LishariREF.EvaluatePackage() if GetStage() < 55 MQ07b_DeusExMachina.SetStage(55) MQ07b_DeusExMachina.SetObjectiveDisplayed(45) EndIf EndFunction Function EnableBarrierCollision() MQ07b_SC02_CollisionRef001.EnableNoWait() MQ07b_SC02_CollisionRef002.EnableNoWait() MQ07b_SC02_CollisionRef003.EnableNoWait() MQ07b_SC02_CollisionRef004.EnableNoWait() EndFunction Function SpawnBarrier() QSTDA10Rumble.Play(PlayerREF) QSTHermaeusPortalOpenM.Play(PlayerREF) MQ07b_SC02_BarrierREF.Enable() MQ07b_SC02_CollisionRef001.EnableNoWait() MQ07b_SC02_CollisionRef002.EnableNoWait() MQ07b_SC02_CollisionRef003.EnableNoWait() MQ07b_SC02_CollisionRef004.EnableNoWait() Wait(0.5) MQ07b_SC02_BarrierREF.PlayAnimation("PlayAnim02") Game.EnablePlayerControls() _00E_TeleportGlobal.SetValueInt(1) MQ07b_DeusExMachina.SetObjectiveCompleted(45) EndFunction Function DissolvePlatform() Game.ShakeCamera(afDuration = 2.0) OBJEyeofMagnusVanishM.Play(PlayerREF) Wait(1) _00E_MQ07b_DissolvePlatformFXS.Play(Plattform) _00E_MQ07b_DissolvePlatformFXS.Play(MQ07b_SC03_BurntCorpseREF) EndFunction Function DisablePlatform() Wait(1) Game.ShakeCamera() MAGIllusionReleaseAimedSDM.Play(PlayerREF) MAGFireBallExpImod.Apply() Plattform.Disable() MQ07b_SC03_BurntCorpseREF.Disable() MQ07b_DeusExMachina.SetObjectiveDisplayed(46) Game.EnablePlayerControls() Game.SetPlayerAIDriven(0) EndFunction Function CastExplosionAtPlayer() If MQ07b_SC02_Lishari.IsPlaying() ; Failsave for http://sureai.net:9898/browse/ERB-251 . MQ07b_SC02_Lishari.Stop() Endif if Karek.IsDead() ; Failsave for http://sureai.net:9898/browse/ERB-423 . Karek.resurrect() endif _00E_SilenceAbruptHighPriority.Add() PlayerREF.Say(PlayerDialogue_Hit) Game.ShakeCamera(afStrength = 1.0) _00E_MAGBottleBreak.Play(MQ07b_SC04_BottleREF) MAGShockExpImod.Apply() MQ07b_SC04_BottleREF.PlaceAtMe(_00E_A1_ShadowtongueOilBottleExplosion) MQ07b_SC04_BottleREF.PlaceAtMe(FXdustDropMedExplosion) MQ07b_SC04_BottleREF.PlaceAtMe(TrapExplosionRuneLightning01) MQ07b_SC04_BottleREF.Disable() Game.ForceFirstPerson() Game.ShowFirstPersonGeometry(False) Game.DisablePlayerControls(true, true, true, false, true, true, true, false) Debug.SendAnimationEvent(PlayerREF, "IdleForceDefaultState") Wait(0.1) PlayerREF.PlayIdle(TG05_KnockOut) Enemy01.SetActorValue("Health", 0) Enemy02.SetActorValue("Health", 0) Enemy02.KillEssential(Karek) Enemy01.KillEssential(Karek) Wait(3.2) FadeToBlackHoldImod.Apply() _00E_NPCKillBodyfall.Play(PlayerREF) Wait(2) PlayerREF.MoveTo(MQ07b_SC05_PlayerMarkerREF) FadeToBlackHoldImod.Remove() _00E_MQP02_HeadacheAnimated.Apply() MQ07b_SC04_CollisionBox.Enable() _00E_MC_CaliaREF.EnableNoWait() _00E_MC_CaliaREF.MoveTo(MQ07b_CaliaStandMarker) Game.ShowFirstPersonGeometry(True) MQ07b_DeusExMachina_KarekScene.Start() Karek.SetGhost(false) Karek.MoveTo(MQ07b_KarrekPortMarker) MQ07b_SC04_Massacre.ForceStart() If !MQ07b_SC04_Massacre.IsPlaying() MQ07b_SC04_Massacre.ForceStart() EndIf RegisterForSingleUpdate(3) EndFunction Function SC04KarekFailsave() Karek.MoveTo(MQ07b_KarrekStandMarker001) EndFunction Function KillKarekFailsave() if !Karek.IsDead() Karek.SetGhost(False) Karek.GetActorBase().SetEssential(False) Karek.KillEssential(Karek) EndIf EndFunction Function PlayCaliaSound() FSTStoneSolidJumpDownSDM.Play(Karek) EndFunction Function CaliaKillKarek() If !bMassacreRunning bMassacreRunning = True Karek.GetActorBase().SetEssential(False) _00E_MQ07b_CaliaMassacreM.Play(_00E_MC_CaliaREF) _00E_MC_CaliaREF.PlayIdleWithTarget(pa_MQ07b_CaliaMassacre, Karek) Wait(5.16) _00E_MC_CaliaItFXS.Play(_00E_MC_CaliaREF) _00E_MC_CaliaREF.SetEyeTexture(_00E_MC_CaliaEyesIt) _00E_SilenceAbruptHighPriority.Remove() _00E_Music_Special_MQ07b_Massacre.Add() ObjectReference expRef = Karek.PlaceAtMe(XMarker) expRef.MoveTo(Karek, 0.0, 0.0, 70) expRef.PlaceAtMe(defaultGhostDeathExplosion) Wait(2) Wait(4.84) Karek.DropObject(Karek.GetEquippedWeapon(), 1) VampireChangeFX.Stop(Karek) Wait(4.28) Game.TriggerScreenBlood(100) Mq07b_SC04_BloodMarkerREF.Enable() Mq07b_SC04_BloodMarkerREF.PlayImpactEffect(BloodSprayImpactSetRed) Wait(2.78) Game.TriggerScreenBlood(50) Mq07b_SC04_BloodMarkerREF.PlayImpactEffect(BloodSprayImpactSetRed) Wait(0.23) Mq07b_SC04_BloodMarkerREF.PlayImpactEffect(BloodSprayImpactSetRed) Wait(1.78) Game.TriggerScreenBlood(50) MQ07Blood.Enable() Mq07b_SC04_BloodMarkerREF.PlayImpactEffect(BloodSprayImpactSetRed) Wait(0.97) Game.TriggerScreenBlood(50) Mq07b_SC04_BloodMarkerREF.PlayImpactEffect(BloodSprayImpactSetRed) Wait(2.17) ; Kick Wait(0.97) Mq07b_SC04_BloodMarkerREF.PlayImpactEffect(BloodSprayImpactSetRed) Wait(1.12) Mq07b_SC04_BloodMarkerREF.PlayImpactEffect(BloodSprayImpactSetRed) Wait(1.5) _00E_MC_CaliaItFXS.Stop(_00E_MC_CaliaREF) _00E_MC_CaliaREF.SetEyeTexture(EyesMaleHumanHazelBrown) SetStage(82) EndIf EndFunction Function PlayerWakeUp() _00E_MQ01_HeadacheEnd.Apply() Wait(2) PlayerREF.PlayIdle(TG05_GetUp) Wait(2.8) Game.EnablePlayerControls() Game.SetPlayerAIDriven(False) MQ07b_DeusExMachina.SetStage(95) _00E_MC_CaliaREF.EvaluatePackage() SetStage(95) EndFunction Function HallysFlee() _00E_MQ07b_HallysFree.SetValueInt(1) Game.DisablePlayerControls() Actor HallyActor = HallyRef as Actor HallyActor.EvaluatePackage() Wait(2) FadeToBlackImod.Apply() Wait(1) FadeToBlackHoldImod.ApplyCrossFade() Wait(1) HallyActor.Disable() _00E_MC_CaliaREF.MoveTo(MQ07CaliaMarker) _00E_MC_LishariREF.MoveTo(MQ07LishariMarker) MQ07MageRef.Enable() MQ07MageRef.MoveTo(MQ07MageMarker) MQ07b_SC05_GuardREF.Enable() MQ07b_SC05_GuardREF.MoveTo(MQ07MageMarker002) MQ07b_DeusExMachina_SceneLishariEnde01.ForceStart() Wait(2) PlayerREF.MoveTo(MQ07PlayerMarker) FadeToBlackBackImod.ApplyCrossFade() MQ07LeverRef.Enable() Wait(2) Game.EnablePlayerControls() EndFunction Function HallysArrest() SetObjectiveCompleted(46) bHallysArrested = True _00E_MQ07b_HallysFree.SetValueInt(0) Game.DisablePlayerControls() Actor HallyActor = HallyRef as Actor HallyActor.EvaluatePackage() Wait(3) FadeToBlackImod.Apply() Wait(1) FadeToBlackHoldImod.ApplyCrossFade() Wait(1) HallyRef.MoveTo(MQ07b_SC05_HallysMarker) Debug.SendAnimationEvent(HallyRef, "IdleBoundKneesStart") _00E_MC_CaliaREF.MoveTo(MQ07CaliaMarker) _00E_MC_LishariREF.MoveTo(MQ07LishariMarker) _00E_MC_LishariREF.Enable() MQ07MageRef.Enable() MQ07MageRef.MoveTo(MQ07MageMarker) MQ07b_SC05_GuardREF.Enable() MQ07b_SC05_GuardREF.MoveTo(MQ07MageMarker002) MQ07b_DeusExMachina_SceneLishariEnde01.ForceStart() Wait(3) PlayerREF.MoveTo(MQ07PlayerMarker) FadeToBlackBackImod.ApplyCrossFade() MQ07LeverRef.Enable() Wait(2) Game.EnablePlayerControls() EndFunction Function DisableHallysAndLishariDudes() HallyRef.Disable() MQ07b_SC05_GuardREF.Disable() MQ07MageRef.Disable() EndFunction Function StartSC06() MQ07b_SC06_Conclusion.ForceStart() EndFunction Function EnableBellHammer() If MQ07b_SC01_BellHammerREF == None MQ07b_SC01_BellHammerREF = Game.GetForm(0x000A9A95) as ObjectReference EndIf MQ07b_SC01_BellHammerREF.Enable() EndFunction Function SetUpFinalScene() AltDothulgradLever.disable() Game.DisablePlayerControls() FadeToBlackImod.Apply() _00E_TeleportGlobal.SetValue(0) Wait(2.7) FadeToBlackHoldImod.ApplyCrossFade(0.5) If _00E_MC_LexREF.IsDisabled() _00E_MC_LexREF.Enable() EndIf _00E_MC_KonstantinREF.MoveTo(_00E_MQ07PortMarkerRight) _00E_MC_NataraREF.MoveTo(_00E_MQ07PortMarkerLeft) _00E_MC_YuslanRef.MoveTo(_00E_MQ07PortMarkerRight001) _00E_MC_LexREF.MoveTo(_00E_MQ07PortMarkerLeft001) _00E_MC_JorrekRef.MoveTo(_00E_MQ08aPrologue_LishariMarker) _00E_MC_CaliaREF.MoveTo(MQ07PortCalia) _00E_MC_CaliaREF.SetOutfit(_00E_MC_Calia_SimpleClothing) PlayerREF.MoveTo(MQ07PortPlayer) MQ07b_S7_Abgabe.ForceStart() Wait(1.4) FadeToBlackBackImod.ApplyCrossFade(1.0) Wait(1.4) Game.EnablePlayerControls() EndFunction Function StartMQ08Prologue() MQ07bAftermath.SetStage(5) MQ08Prologue.SetStage(5) _00E_TeleportGlobal.SetValueInt(0) EndFunction Function InitiateResetAILoop() while GetStage() >= 75 Wait(1.5) EndWhile EndFunction Function PlayVisionVoice(int iVisionIndex, ObjectReference objShader) Formlist involvedFormlist involvedFormlist.AddForm(objShader) Formlist caliaFormlist caliaFormlist.AddForm(_00E_MC_CaliaREF as Actor) _00E_MQ07b_VisionREF.MoveTo(PlayerREF) iVisionIndexProperty = iVisionIndex Levelsystem.VisionEffectNoTimestop(involvedFormlist, caliaFormlist, true) Wait(1) _00E_MQ07b_VisionREF.Say(MQ07b_D7_VisionBranchTopic) Wait(7) _00E_MQ07b_VisionREF.Disable() Levelsystem.VisionEffectNoTimestopStop(involvedFormlist, caliaFormlist) _00E_MQ07b_VisionREF.Enable() EndFunction Function FinishQuest() CompanionIsTalking.SetValueInt(0) MQ07bAftermath.SetStage(5) Levelsystem.GiveEp(__Config_iRewardEXP) Levelsystem.RemoveSilence() Levelsystem.SetAllowIdleChatter(True) _00E_QuestFunctions.SetNPCAsCompanion(_00E_MC_CaliaREF, False) ; Failsafe SetObjectiveCompleted(125) PlayerREF.AddItem(Gold001, 250) CompleteAllObjectives() If CQC01.IsCompleted() CQC02.SetStage(5) EndIf If _00E_AchievementsEnabled.GetValueInt() == 1 Steam.UnlockAchievement("END_PROTO_BEACON_01") EndIf EndFunction Function SC06Failsave() RegisterForSingleUpdate(60) EndFunction ;===================================================================================== ; PROPERTIES ;===================================================================================== bool bMassacreRunning int Property __Config_iRewardEXP = 800 Auto int Property iVisionIndexProperty Auto Conditional Hidden bool Property bHallysArrested Auto Conditional Hidden _00E_QuestFunctions Property Levelsystem Auto Quest Property MQ08Prologue Auto Quest Property MQ07b_DeusExMachina Auto Quest Property MQ07bAftermath Auto Quest Property CQC01 Auto Quest Property CQC02 Auto Topic Property MQ07b_D7_VisionBranchTopic Auto Formlist Property MQ07b_SC2_BellVisionStaticRefs Auto MiscObject Property Gold001 Auto MusicType Property _00E_Music_Special_MQ07b_Massacre Auto MusicType Property _00E_SilenceAbruptHighPriority Auto ObjectReference Property _00E_MQ07b_VisionREF Auto ObjectReference Property _00E_MQ07PortMarkerRight001 Auto ObjectReference Property _00E_MQ07PortMarkerLeft001 Auto ObjectReference Property MQ07PortCalia Auto ObjectReference Property MQ07PortPlayer Auto ObjectReference Property DoorRef Auto ObjectReference Property CaliaStartMarker Auto ObjectReference Property Mq07b_SC04_BloodMarkerREF Auto ObjectReference Property MQ07b_SC03_BurntCorpseREF Auto ObjectReference Property MQ07Mapmarker Auto ObjectReference Property MQ07Bell01 Auto ObjectReference Property MQ07Bell02 Auto ObjectReference Property MQ07Bell03 Auto ObjectReference Property MQ07Bell04 Auto ObjectReference Property MQ07b_KarrekPortMarker Auto ObjectReference Property MQ07b_SC04_CollisionBox Auto ObjectReference Property Plattform Auto ObjectReference Property _00E_MQ07PortMarkerLeft Auto ObjectReference Property _00E_MQ07PortMarkerRight Auto ObjectReference Property MQ07b_SC04_BottleREF Auto ObjectReference Property AltDothulgradLever Auto ObjectReference Property MQ07MageMarker Auto ObjectReference Property MQ07PlayerMarker Auto ObjectReference Property MQ07LishariMarker Auto ObjectReference Property MQ07CaliaMarker Auto ObjectReference Property MQ07MageRef Auto ObjectReference Property MQ07MageMarker002 Auto ObjectReference Property MQ07LeverRef Auto ObjectReference Property MQ07b_SC05_PlayerMarkerREF Auto ObjectReference Property MQ07Blood Auto ObjectReference Property HallyRef Auto ObjectReference Property MQ07b_SC05_GuardREF Auto ObjectReference Property MQ07b_CaliaStandMarker Auto ObjectReference Property MQ07_SC02_LishariStartMarker Auto ObjectReference Property MQ07b_SC02_BarrierREF Auto ObjectReference Property MQ07b_SC02_GuardStandMarker Auto ObjectReference Property MQ07b_SC02_CollisionRef001 Auto ObjectReference Property MQ07b_SC02_CollisionRef002 Auto ObjectReference Property MQ07b_SC02_CollisionRef003 Auto ObjectReference Property MQ07b_SC02_CollisionRef004 Auto ObjectReference Property MQ07b_SC01_BellHammerREF Auto ObjectReference Property MQ07b_SC05_HallysMarker Auto ObjectReference Property _00E_MQ08aPrologue_LishariMarker Auto ObjectReference Property MQ07b_KarrekStandMarker001 Auto Explosion Property TrapExplosionRuneLightning01 Auto Explosion Property defaultGhostDeathExplosion Auto Explosion Property _00E_A1_ShadowtongueOilBottleExplosion Auto Explosion Property FXdustDropMedExplosion Auto Topic Property PlayerDialogue_Hit Auto Scene Property MQ07b_S7_Abgabe Auto Scene Property MQ07b_DeusExMachina_KarekScene Auto Scene Property MQ07b_SC01_CaliaComment Auto Scene Property MQ07b_DeusExMachina_SceneLishariEnde01 Auto Scene Property MQ07b_SC04_Massacre Auto Scene Property MQ07b_SC06_Conclusion Auto Scene Property LishariDialogue_SC01_LishariConversation Auto Scene Property MQ07b_SC02_Lishari Auto Actor Property _00E_MC_KonstantinREF Auto Actor Property _00E_MC_CaliaREF Auto Actor Property _00E_MC_NataraREF Auto Actor Property _00E_MC_LishariREF Auto Actor Property PlayerREF Auto Actor Property _00E_MC_LexREF Auto Actor Property _00E_MC_YuslanRef Auto Actor Property Enemy01 Auto Actor Property Enemy02 Auto Actor Property _00E_MC_JorrekRef Auto Actor Property Karek Auto Actor Property MQ07b_Hireling_Ref Auto GlobalVariable Property Counter Auto GlobalVariable Property _00E_TeleportGlobal Auto GlobalVariable Property _00E_MQ07b_HallysFree Auto GlobalVariable Property CompanionIsTalking Auto GlobalVariable Property _00E_AchievementsEnabled Auto EffectShader Property _00E_QuestshaderRed Auto EffectShader Property _00E_MC_CaliaItFXS Auto EffectShader Property VampireChangeFX Auto EffectShader Property _00E_MQ07b_DissolvePlatformFXS Auto Outfit Property _00E_MC_Calia_Outfit Auto Outfit Property _00E_MC_Calia_SimpleClothing Auto ReferenceAlias Property SoldatAlias01 Auto TextureSet Property EyesMaleHumanHazelBrown Auto TextureSet Property _00E_MC_CaliaEyesIt Auto ImpactDataSet Property BloodSprayImpactSetRed Auto Cell Property AltDothulgradL4 Auto Sound Property _00E_BellGong_02 Auto Sound Property _00E_BellGong_03 Auto Sound Property _00E_BellGong_04 Auto Sound Property _00E_BellGong_05 Auto Sound Property QSTDA10Rumble Auto Sound Property FSTStoneSolidJumpDownSDM Auto Sound Property _00E_MQ07b_CaliaMassacreM Auto Sound Property _00E_NPCKillBodyfall Auto Sound Property _00E_MAGBottleBreak Auto Sound Property OBJEyeofMagnusVanishM Auto Sound Property MAGIllusionReleaseAimedSDM Auto Sound Property QSTHermaeusPortalOpenM Auto ImageSpaceModifier Property MAGShockExpImod Auto ImageSpaceModifier Property FadeToBlackImod Auto ImageSpaceModifier Property FadeToBlackHoldImod Auto ImageSpaceModifier Property FadeToBlackBackImod Auto ImageSpaceModifier Property _00E_MQP02_HeadacheAnimated Auto ImageSpaceModifier Property _00E_MQ01_HeadacheEnd Auto ImageSpaceModifier Property MAGFireBallExpImod Auto Idle Property TG05_GetUp Auto Idle Property TG05_KnockOut Auto Idle Property pa_MQ07b_CaliaMassacre Auto Static Property XMarker Auto