enderalse/source/scripts/_00e_mq07a_functions.psc

1143 lines
33 KiB
Plaintext

Scriptname _00E_MQ07a_Functions extends Quest Conditional
Import Utility
Import Debug
int function _GetScriptVersion() Global
return 1
endFunction
;=====================================================================================
; FUNCTIONS
;=====================================================================================
Function EnableOetzi()
MQ07a_OetziREF.Enable()
If _00E_MC_JesparREF.IsDisabled()
_00E_MC_JesparREF.Enable()
EndIf
_00E_MC_LexREF.Enable()
If (!_00E_MC_JesparREF.GetParentCell() == PlayerREF.GetParentCell())
_00E_MC_JesparREF.MoveTo(MQ07a_SC1_JesparMarker)
EndIf
If (!_00E_MC_LexREF.GetParentCell() == PlayerREF.GetParentCell())
_00E_MC_LexREF.MoveTo(MQ07a_SC1_LexMarker)
EndIf
StartSC01()
EndFunction
Function MoveTealor()
If _00E_MC_TealorREF.IsDisabled()
_00E_MC_TealorREF.Enable()
EndIf
_00E_MC_TealorREF.MoveTo(MQ07a_SC1_TealorMarker)
EndFunction
Function StartSC01()
MQ07a_SC1_ExplanationInChronikum.ForceStart()
_00E_MC_JesparREF.MoveTo(MQ07a_SC1_JesparMarker)
_00E_MC_LexREF.MoveTo(MQ07a_SC1_LexMarker)
EndFunction
Function SC01Failsave()
_00E_MC_JesparREF.Enable()
_00E_MC_JesparREF.MoveTo(MQ07a_SC1_JesparMarker)
_00E_MC_LexREF.MoveTo(MQ07a_SC1_LexMarker)
_00E_MC_JesparREF.GetActorBase().SetEssential(True)
If !MQ07a_SC1_ExplanationInChronikum.IsPlaying()
MQ07a_SC1_ExplanationInChronikum.ForceStart()
EndIf
EndFunction
Function PlayerAddNecklace()
PlayerREF.AddSpell(_00E_MQ07a_TeleportPyreanSP)
_00E_MQ07a_GlyphDrawingContainerREF.RemoveItem(_00E_MQ07a_TealorNecklace, 1, PlayerREF)
If PlayerREF.GetItemCount(_00E_MQ07a_TealorNecklace) < 1
PlayerREF.AddItem(_00E_MQ07a_TealorNecklace, 1)
EndIf
EndFunction
Function PlayerRemoveNecklace()
PlayerREF.RemoveItem(_00E_MQ07a_TealorNecklace, 1)
EndFunction
Function MoveJesparToMyradTower()
_00E_MC_JesparREF.MoveTo(MQ07a_SC2_JesparTargetMarker)
MQ07A_SC2_TravelToManor.ForceStart()
EndFunction
Function StartJourney()
If MQ07a_JesparFollowTriggerStartREF == None
MQ07a_JesparFollowTriggerStartREF = Game.GetForm(0x00106646) as ObjectReference
EndIf
_00E_Func_SetNPCAsCompanion.SetNPCAsCompanion(_00E_MC_JesparREF, True, 350, 350, 100)
CompanionIsTalking.SetValueInt(0)
MQ07a_JesparFollowTriggerStartREF.Enable()
EndFunction
Function WaitForNightfall()
Game.DisablePlayerControls()
FadeToBlackIMOD.Apply()
Wait(2)
FadeToBlackHoldIMOD.ApplyCrossFade()
Wait(1)
_00E_TimeControl.SkipTimeToHour(23)
_00E_MC_JesparREF.MoveTo(MQ07a_SC2_JesparWaitForNightfallMarker)
PlayerREF.MoveTo(MQ07a_SC2_PlayerWaitMarker)
MQ07a_SC2_Campfire.Enable()
Wait(2)
Game.EnablePlayerControls()
FadeToBlackBackIMOD.ApplyCrossFade(afFadeDuration = 3.0)
EndFunction
Function StartSC03()
_00E_Func_SetNPCAsCompanion.SetNPCAsCompanion(_00E_MC_JesparREF, False)
MQ07a_SC3_LivingRoomDoor.SetOpen(False)
MQ07a_SC3_LivingRoomDoor.BlockActivation(True)
MQ07A_SC3_GateScene.ForceStart()
EndFunction
Function AdjustAgedManSpeed()
MQ07a_TheAgedManREF.SetActorValue("speedMult", 75)
_00E_MC_JesparREF.SetActorValue("speedMult", 75)
_00E_PlayerFunctions.GetVisionControl().UpdateSpeed(MQ07a_TheAgedManREF)
EndFunction
Function StartSC04()
_00E_MC_JesparREF.SetActorValue("speedMult", 100.0)
MQ07A_SC4_Interlude.ForceStart()
_00E_TeleportGlobal.SetValue(1)
EndFunction
Function FadeOut()
MQ07a_SC6_CollPlane.Enable()
FadeToBlackIMOD.Apply()
Utility.Wait(2.5)
FadeToBlackHoldIMOD.ApplyCrossFade(afFadeDuration = 0.5)
PlayerREF.MoveTo(MQ07a_SC4_ChairREF)
MQ07a_SC4_ChairREF.Activate(PlayerREF)
EndFunction
Function FadeBack()
FadeToBlackBackIMOD.ApplyCrossFade(0.5)
EndFunction
Function PlayerStandUp()
MQ07a_SC4_ChairREF.Activate(PlayerREF)
Self.SetCurrentStageID(85)
EndFunction
Function StartSC5()
MQ07a_SC3_LivingRoomDoor.BlockActivation(False)
MQ07a_SC3_LivingRoomDoor.SetOpen(True)
MQ07a_SC6_CollPlane.Disable()
Game.RequestAutoSave()
MQ07a_SC3_LivingRoomDoor.Lock(False)
MQ07a_SC3_LivingRoomDoor.SetOpen(True)
MQ07a_SC4_ExtraRoomDoor.SetLockLevel(75)
MQ07a_TheAgedManREF.Disable()
MQ07a_SC3_PianoMusic.Enable()
MQ07A_SC5_Riddle.ForceStart()
EndFunction
Function MoveDownPlayer()
Debug.SetGodMode(True)
MQ07a_SC5_LiftPlatform.KnockAreaEffect(256, 1)
MQ07a_SC5_LiftPlatform.PlaceAtMe(FallingDustExplosion01)
MQ07a_SC5_LiftPlatform.TranslateToRef(MQ07a_SC5_LiftMarkerDown, 600.0, 600.0)
PlayerREF.TranslateTo(PlayerREF.GetPositionX(), PlayerREF.GetPositionY(), (PlayerREF.GetPositionZ() - 1730.0), PlayerREF.GetAngleX(), PlayerREF.GetAngleY(), PlayerREF.GetAngleZ(), 600.0, 600.0)
Game.ShakeCamera(afStrength = 0.7)
DRSStoneLabyrinthianOpenM.Play(MQ07a_SC5_LiftPlatform)
LiftSound = DRSStoneRotatingDiscLPM.Play(MQ07a_SC5_LiftPlatform)
EndFunction
Function MovePlatformForward()
MQ07a_PlatformActivated.SetValueInt(1)
PlayerREF.TranslateTo(PlayerREF.GetPositionX(), PlayerREF.GetPositionY(), (MQ07a_SC5_LiftPlatform.GetPositionZ() + 10), PlayerREF.GetAngleX(), PlayerREF.GetAngleY(), PlayerREF.GetAngleZ(), 600.0, 600.0)
Sound.StopInstance(LiftSound)
Utility.Wait(0.5)
Game.ShakeCamera(afStrength = 0.5)
LiftSound = DRSStoneRotatingDiscLPM.Play(MQ07a_SC5_LiftPlatform)
MQ07a_SC5_LiftPlatform.TranslateToRef(MQ07a_SC5_LiftMarker02, 100.0, 100.0)
MQ07a_SC5_LiftMarker02.TranslateToRef(MQ07a_SC5_LiftMarker02, 100.0, 100.0)
PlayerREF.TranslateTo(PlayerREF.GetPositionX(), PlayerREF.GetPositionY() - 1500.0, MQ07a_SC5_LiftPlatform.GetPositionZ() + 10.0, PlayerREF.GetAngleX(), PlayerREF.GetAngleY(), PlayerREF.GetAngleZ(), 100.0, 100.0)
EndFunction
Function StopSound()
Debug.SetGodMode(False)
PlayerREF.StopTranslation()
Game.EnablePlayerControls()
Game.SetPlayerAIDriven(False)
Game.ShakeCamera(afStrength = 0.3)
Sound.StopInstance(LiftSound)
EndFunction
Function ActivatePlatform()
Debug.SetGodMode(1)
Game.DisablePlayerControls()
ObjectReference Dust = MQ07a_SC5_Platform.PlaceAtMe(FallingDustExplosion01)
Dust.MoveTo(MQ07a_SC5_Platform, 0.0, 0.0, -25.0)
MQ07a_SC5_Platform.TranslateToRef(MQ07a_SC5_PlatformMarker01, 100.0, 100.0)
PlayerREF.TranslateToRef(MQ07a_SC5_PlatformMarker01, 100.0, 100.0)
LiftSound = DRSStoneRotatingDiscLPM.Play(MQ07a_SC5_Platform)
EndFunction
Function AddPyreanSpell()
Game.RequestAutoSave()
_00E_Music_Special_Zyklus_OneSelection.Add()
EndFunction
Function TranslatePlatform02()
Actor PlayerAc = PlayerREF as Actor
PlayerAc.SetGhost(1)
Sound.StopInstance(LiftSound)
Utility.Wait(0.5)
MQ07a_SC5_Platform.TranslateToRef(MQ07a_SC5_PlatformMarker02, 100.0, 100.0)
PlayerREF.TranslateToRef(MQ07a_SC5_PlatformMarker02, 100.0, 100.0)
LiftSound = DRSStoneRotatingDiscLPM.Play(MQ07a_SC5_Platform)
EndFunction
Function JesparGivePlayerScroll()
PlayerREF.AddItem(_01E_TeleportrolleSonnentempel, 1)
EndFunction
Function TranslatePlatform03()
Actor PlayerAc = PlayerREF as Actor
PlayerAc.SetGhost(1)
Debug.SetGodMode(1)
Sound.StopInstance(LiftSound)
Utility.Wait(0.5)
MQ07a_SC5_Platform.TranslateToRef(MQ07a_SC5_PlatformMarker03, 100.0, 100.0)
PlayerREF.TranslateTo(MQ07a_SC5_PlatformMarker03.GetPositionX(), MQ07a_SC5_PlatformMarker03.GetPositionY(), MQ07a_SC5_PlatformMarker03.GetPositionZ() + 5, PlayerREF.GetAngleX(), PlayerREF.GetAngleY(), PlayerREF.GetAngleZ(), 100.0, 100.0)
LiftSound = DRSStoneRotatingDiscLPM.Play(MQ07a_SC5_Platform)
EndFunction
Function StopPlatform()
Actor PlayerAc = PlayerREF as Actor
Sound.StopInstance(LiftSound)
Game.ShakeCamera(afStrength = 0.3)
Game.EnablePlayerControls()
PlayerREF.StopTranslation()
Wait(1)
Debug.SetGodMode(0)
PlayerAc.SetGhost(0)
EndFunction
Function PortPyrean()
_00E_TeleportCharge.Play(PlayerREF)
Utility.Wait(2)
_00E_A2_Ghostwalk_TeleportDoneSound.Play(PlayerREF)
_00e_TeleportArrive.Apply()
PlayerREF.MoveTo(MQ07a_SC5_TeleportPlayerMarker)
PlayerREF.PlaceAtMe(_00E_TeleportExplosion)
MQ07a_SC5_OetziREFNew.EnableNoWait(False)
MQ07a_SC5_Mist.EnableNoWait(False)
MQ07a_SC5_OetziREFNew.PlaceAtMe(_00E_TeleportExplosion)
Self.SetCurrentStageID(115)
PlayerREF.UnequipSpell(_00E_MQ07a_TeleportPyreanSP, 0)
PlayerREF.UnequipSpell(_00E_MQ07a_TeleportPyreanSP, 1)
PlayerREF.RemoveSpell(_00E_MQ07a_TeleportPyreanSP)
EndFunction
Function StartMemory()
_FS_TheriantrophistControlQuest.TransformBackIfTransformed()
_FS_Phasmalist_ControlQuest.UnsummonApparitionIfExists()
_00E_EquipControl.SheatheWeapon(PlayerREF)
OBJEyeofMagnusVanishM.Play(PlayerREF)
_00E_MQ07a_WordOfTheDeadTransformSpiritM.Play(PlayerREF)
_00E_MQ07a_WordOfTheDeadTransformIMOD.Apply()
_00E_Ability_StaggerSelfSpell.Cast(PlayerREF, PlayerREF)
Game.ShakeCamera(afStrength = 0.2)
MQ07a_SC5_SpiritActor.MoveTo(PlayerREF)
MQ07a_SC5_SpiritActor.SetPlayerControls(False)
MQ07a_SC5_SpiritActor.EnableAI(False)
MQ07a_SC5_SpiritActor.EnableAI(True)
MQ07a_SC5_SpiritActor.SetAllowFlying(True)
Game.ForceThirdPerson()
Game.SetCameraTarget(MQ07a_SC5_SpiritActor)
Game.SetPlayerAIDriven(True)
Game.DisablePlayerControls(true, true, true, True, true, true, true, true)
Game.SetHUDCartMode(True)
MQ07a_SC5_SpiritActor.SplineTranslateToRef(MQ07a_SC5_FlyMarkerM, 50.0, 50.0, 2000.0)
EndFunction
Function FlyTowardsPyrean()
FXExplosionCatapultNearM.Play(PlayerREF)
MQ07a_SC5_SpiritActor.SplineTranslateToRef(MQ07a_SC5_PyreanHeadmarker, 2000.0, 2000.0, 2000.0)
EndFunction
Function PortPlayerIntoMemory()
PlayerREF.StopTranslation()
FadeToBlackHoldImod.Apply()
Utility.Wait(1)
Game.SetPlayerAIDriven(False)
MQ07a_SC5_SpiritActor.EnableAI(False)
Game.SetCameraTarget(PlayerREF)
GhostFXShader.Play(PlayerREF)
PlayerREF.SetAlpha(0.5)
_00E_MQ07a_VisionStartM.Play(PlayerREF)
_00E_MQ07a_VisionAwake.Apply()
TimescaleDefault = Timescale.GetValue()
Timescale.SetValue(0.01)
_00E_TimeControl.SkipTimeToHour(22)
PlayerREF.MoveTo(MQ07a_VisionStart_REF)
Utility.Wait(1)
PlayerREF.MoveTo(MQ07a_VisionStart_REF) ; Yes, move the player again. Without it the worldspace's weather does not start.
Game.EnablePlayerControls()
Game.SetHUDCartMode(False)
FadeToBlackHoldImod.Remove()
_00E_MQ07a_VisionIMOD.ApplyCrossFade(2)
SetCurrentStageID(120)
EndFunction
Function StartSC06()
Game.ShowFirstPersonGeometry(False)
Game.ForceThirdPerson()
Game.DisablePlayerControls()
Game.SetPlayerAIDriven(True)
MQ07A_SC6_Doorstep.ForceStart()
EndFunction
Function PortPlayerFailsave()
If PlayerREF.GetDistance(MQ07a_SC6_KnockDoorMarker) >= 100
PlayerREF.MoveTo(MQ07a_SC6_KnockDoorMarker)
EndIf
EndFunction
Function KnockDoor()
_FS_TheriantrophistControlQuest.TransformBackIfTransformed()
Game.ForceThirdPerson()
Wait(0.1)
PlayerREF.PlayIdle(IdleMT_DoorBang)
Wait(1)
_00E_MQ07a_DoorBangM.Play(PlayerREF)
EndFunction
Function StartSC07()
MQ07A_SC7_KitchenScene.ForceStart()
EndFunction
Function ShowThoughtText()
Game.EnablePlayerControls()
Game.SetPlayerAIDriven(False)
Game.ShowFirstPersonGeometry(true)
_00E_MQ07a_ThoughtsMemory02.ShowAsHelpMessage("Memory02", 5, 5, 1)
EndFunction
Function DebugSetUpMemory()
EndFunction
Function OpenDoor()
MQ07a_SC06_KitchenDoorREF.Activate(MQ07a_ZuraREF, True)
EndFunction
Function StartSC08()
Game.ForceFirstPerson()
Game.DisablePlayerControls(true, true, false, true, true, true, true, true)
Game.SetPlayerAIDriven()
PlayerREF.equipItem(ElderScrollHandAttachArmor, false, true)
Wait(0.5)
QSTMQ206ElderScrollRead2DSound.Play(PlayerREF)
MQ07a_ZuraREF.MoveTo(MQ07a_SC08_ZuraMarker)
MQ07a_KurmarREF.MoveTo(MQ07a_SC08_KurmarWalkout)
MQ07a_SC8_HouseDoor.SetOpen(True)
MQ07A_SC8_PlayerReadScroll.ForceStart()
_00E_MQ07a_ThoughtsMemory03.ShowAsHelpMessage("Memory03", 5, 5, 1)
EndFunction
Function StopReading()
Game.ForceThirdPerson()
Game.EnablePlayerControls()
Game.DisablePlayerControls()
PlayerREF.UnequipItem(ElderScrollHandAttachArmor, false, true)
PlayerREF.PlayIdle(IdleStop)
EndFunction
Function KillKurmar()
PlayerREF.SetGhost(False)
MQ07a_ZuraREF.SetGhost(False)
MQ07a_SC8_ShouterREF.Enable()
MQ07a_KurmarREF.SetGhost(False)
MQ07a_KurmarREF.GetActorBase().SetEssential(False)
If (MQ07a_SC8_HouseDoor.GetOpenState() != 1)
MQ07a_SC8_HouseDoor.SetOpen(True)
Wait(1)
EndIf
_00E_MQ07a_KillerArrowSP.Cast(MQ07a_SC08_ArrowMarker, MQ07a_KurmarREF)
Wait(0.5)
_00E_Music_Combat_BonehunterNoCond.Add()
Game.TriggerScreenBlood(5)
Game.ShakeCamera()
TRPImpactImpalex.Play(MQ07a_KurmarREF)
_00E_Ability_StaggerSelfSpell.Cast(MQ07a_ZuraREF, MQ07a_ZuraREF)
_00E_Ability_StaggerSelfSpell.Cast(PlayerREF, PlayerREF)
EndFunction
Function KillKurmarFailsave()
if !MQ07a_KurmarREF.IsDead()
MQ07a_KurmarREF.SetGhost(False)
MQ07a_KurmarREF.GetActorBase().SetEssential(False)
MQ07a_KurmarREF.Kill(MQ07a_KurmarREF)
EndIf
EndFunction
Function EnableEnemiesInFormlist(Formlist formlistToProcess, GlobalVariable counterGlobal)
Int Index
int nItems = formlistToProcess.GetSize()
counterGlobal.SetValueInt(nItems)
bDoneBattleFailsave = True
Index = 0
While Index < nItems
Actor enemyRef = (formlistToProcess.GetAt(Index) as Actor)
enemyRef.Enable()
enemyRef.SetAlpha(0.0)
Index += 1
EndWhile
ResetHouseEnemyCounter()
Utility.Wait(1)
MQ07a_EnemiesLeft.SetValueInt(nItems)
UpdateCurrentInstanceGlobal(MQ07a_EnemiesLeft)
If MQ07a_CurrentWave.GetValueInt() == 1
SetObjectiveDisplayed(30)
Else
Self.SetObjectiveCompleted(30,0)
Self.SetObjectiveDisplayed(30, True, True)
EndIf
RegisterForSingleUpdate(BATTLE_LONG_UPDATE_PERIOD)
EndFunction
Function ResetHouseEnemyCounter()
(_00E_MQ07a_SC6_VisionHomeTGBX_Ref as _00E_VisionHomeSC).ResetEnemiesInside()
EndFunction
Function StartSC09()
Game.SetPlayerAIDriven(False)
Game.EnablePlayerControls()
Game.ShowFirstPersonGeometry(True)
MQ07a_ZuraREF.SetGhost(True)
MQ07a_SC9_Door.SetOpen(True)
MQ07a_SC8_ShouterREF.Disable()
MQ07a_CurrentWave.SetValueInt(1) ; Just in case
EnableEnemiesInFormlist(_00E_MQ07a_Enemies_Wave_01, MQ07a_Wave_01_EnemiesTotal)
_00E_FS_Theriantrophist_AllowTemporaryTransform.SetValueInt(1)
MQ07A_SC9_Battle.ForceStart()
Game.RequestAutoSave()
EndFunction
Function StartSecondWave()
EnableEnemiesInFormlist(_00E_MQ07a_Enemies_Wave_02, MQ07a_Wave_02_EnemiesTotal)
EndFunction
Function StartThirdWave()
EnableEnemiesInFormlist(_00E_MQ07a_Enemies_Wave_03, MQ07a_Wave_03_EnemiesTotal)
EndFunction
Function TeleportMage()
Game.RequestAutoSave()
_00E_Music_Combat_BonehunterNoCond.Remove()
SetObjectiveCompleted(30)
ObjectReference FXExplosion = MQ07a_SC9_MageAppearMarker.PlaceAtMe(_00E_TeleportExplosion, 1)
_00E_NPCTeleportExplosionIMOD.Apply()
MQ07a_SC10_MageREF.Enable()
MQ07a_SC10_MageREF.MoveTo(MQ07a_SC9_MageAppearMarker)
_00E_Func_WaitForRef.WaitForReferenceToLoad(MQ07a_SC10_MageREF)
Debug.sendAnimationEvent(MQ07a_SC10_MageREF, "IdleWebEnterInstant")
MQ07a_SC10_MageREF.setActorValue("Variable03", 5)
TimeFadeOut01FXS.Stop(MQ07a_SC10_MageREF)
TimeFadeIn01FXS.Play(MQ07a_SC10_MageREF)
Wait(0.5)
MQ07a_SC10_MageREF.playidle(WebIdleExit)
Wait(1)
SC10_Mage.ForceRefTo(MQ07a_SC10_MageREF)
TimeFadeIn01FXS.Stop(MQ07a_SC10_MageREF)
MQ07a_SC10_MageREF.setActorValue("Variable03", 0)
Wait(0.4)
MQ07a_SC8_HouseDoor.SetOpen(True)
MQ07a_SC8_HouseDoor.BlockActivation(False)
SetCurrentStageID(155)
EndFunction
Function StartSC10()
_FS_TheriantrophistControlQuest.TransformBackIfTransformed()
_00E_FS_Theriantrophist_AllowTemporaryTransform.SetValueInt(0)
Game.ShowFirstPersonGeometry(False)
Game.DisablePlayerControls(true, true, true, false, true, true, true, true)
Game.SetPlayerAIDriven(True)
Game.ForceThirdPerson()
Debug.SetGodMode(False)
MQ07A_SC10_MageKillsPyrean.ForceStart()
EndFunction
Function FreezePlayer()
If !bKnockedOut
bKnockedOut = True
Game.ShakeCamera(afStrength = 0.5)
_00E_MQ07a_FreezePlayer.Apply()
PlayerREF.PlayIdle(bleedoutStart)
Utility.Wait(2)
Self.SetCurrentStageID(165)
EndIf
EndFunction
Function KnockOutPlayer()
If Self.GetCurrentStageID() < 170
_00E_MQ07a_FreezePlayerFinal.ApplyCrossFade(0.1)
_00E_MQ07a_SC10_PyreanDeathFreezeM.Play(PlayerREF)
FXExplosionCatapultNearM.Play(PlayerREF)
Utility.Wait(1.5)
_00E_MQ07a_FreezePlayer.Remove()
FadeToBlackHoldIMOD.Apply()
Self.SetCurrentStageID(170)
EndIf
EndFunction
Function EndDream()
Weapon weap
PlayerREF.RemoveItem(_00E_MQ07a_RitualScroll)
PlayerREF.RemoveItem(_00E_MQ07a_ChestKey)
PlayerREF.RemoveItem(ElderScrollHandAttachArmor, abSilent = True)
PlayerREF.PlayIdle(bleedoutStop)
Game.ShowFirstPersonGeometry(True)
MQ07a_SC6_CollPlane.Enable()
MQ07a_SC11_Door.BlockActivation(True)
MQ07a_SC11_Door.SetOpen(False)
MQ07a_SC11_light.Enable()
Game.DisablePlayerControls()
Game.SetPlayerAIDriven(True)
Game.RequestAutoSave()
_00E_TimeControl.SkipTimeToHour(1)
MQ07a_ZuraREF.SetGhost(False)
MQ07a_ZuraREF.GetActorBase().SetEssential(False)
MQ07a_ZuraREF.Kill(MQ07a_ZuraREF)
PlayerREF.DispelSpell(_00E_MQ07a_MageIceSpike)
PlayerREF.DispelSpell(_00E_MQ07a_MageIceSTorm)
_00E_EquipControl.SheatheWeapon(PlayerREF) ; Needed for the player to lay down in the bed in SC11
weap = PlayerREF.GetEquippedWeapon(0)
If weap
PlayerREF.UnEquipItem(weap, abSilent = True)
EndIf
weap = PlayerREF.GetEquippedWeapon(1)
If weap
PlayerREF.UnEquipItem(weap, abSilent = True)
EndIf
Utility.Wait(2.5)
Debug.SendAnimationEvent(PlayerREF, "IdleForceDefaultState") ; Resets drawn weapon in 1p
Timescale.SetValue(TimescaleDefault)
Weather.ReleaseOverride()
PlayerREF.SetAlpha(1)
GhostFXShader.Stop(PlayerREF)
PlayerREF.MoveTo(MQ07a_SC11_PlayerMarker)
MQ07a_TheAgedManREF.Enable()
MQ07a_TheAgedManREF.MoveTo(MQ07a_SC11_AgedManLeanFurniture)
Game.ForceThirdPerson()
MQ07A_SC11_DialogueWithAgedMan.ForceStart()
EndFunction
Function FadeBack02()
FadeToBlackBackIMOD.Apply()
FadeToBlackHoldIMOD.Remove()
EndFunction
Function EnableControls()
Game.SetPlayerAIDriven(False)
Game.EnablePlayerControls()
EndFunction
Function CollapseManor()
_00E_MQ07a_CollapseManor.Apply()
Weather.ReleaseOverride()
_00E_MQ07aOldManManorNoRain.SetActive()
_00E_MC_JesparREF.MoveTo(MQ07a_SC12_JesparPortMarker)
_00E_Horror_Ghosts_01M.Play(PlayerREF)
Utility.Wait(1.75)
MQ07a_SC12_Linker.Disable()
PlayerREF.MoveTo(MQ07a_SC12_PlayerPortOutMarker)
Debug.sendAnimationEvent(playerREF, "IdleWebEnterInstant")
FadeToWhiteBackImod.Apply()
PlayerREF.setActorValue("Variable03", 5)
Wait(0.5)
PlayerREF.playidle(WebIdleExit)
Utility.Wait(3)
Debug.SendAnimationEvent(PlayerREF, "IdleForceDefaultState")
MQ07A_SC12_JesparFinalDialogue.ForceStart()
MQ07a_OetziREF.Disable()
EndFunction
Function MoveJesparAndPlayer()
Game.DisablePlayerControls()
FadeToBlackIMOD.Apply()
Utility.Wait(2.5)
FadeToBlackHoldIMOD.Apply()
FadeToBlackIMOD.Remove()
MQ07a_SC13_WordOfTheDead.Enable()
PlayerREF.MoveTo(MQ07a_SC13_PlayerMarker)
_00E_MC_JesparREF.MoveTo(MQ07a_SC13_JesparLean)
EndFunction
Function FadeBackSC13()
If _00E_MC_TealorREF.IsDisabled()
_00E_MC_TealorREF.Enable()
EndIf
_00E_MQ07a_GlyphDrawingContainerREF.RemoveItem(_00E_MQ07a_PyreanGlyphsDrawing, 1, PlayerREF)
If PlayerREF.GetItemCount(_00E_MQ07a_PyreanGlyphsDrawing) < 1
PlayerREF.AddItem(_00E_MQ07a_PyreanGlyphsDrawing, 1)
EndIf
Game.EnablePlayerControls()
FadeToBlackBackImod.Apply()
FadeToBlackHoldIMOD.Remove()
_00E_TeleportGlobal.SetValueInt(0)
EndFunction
Function Teleport(String WhoToTeleport)
_00E_TeleportGlobal.SetValue(0)
Weather.ReleaseOverride()
MQ07a_SC13_WordOfTheDeadSoundREF.Disable()
MQ07a_SC13_WordOfTheDead.PlaceAtMe(_00E_TeleportExplosion)
Utility.Wait(0.1)
MQ07a_SC13_WordOfTheDead.Disable()
if WhoToTeleport == "Jespar"
_00E_PlayerFunctions.GetTeleportControl().TeleportNPC(_00E_MC_JesparREF, MQ07a_SC13_JesparTeleport)
ElseIf WhoToTeleport == "Both"
Game.DisablePlayerControls()
_00E_PlayerFunctions.GetTeleportControl().TeleportNPC(_00E_MC_JesparREF, MQ07a_SC13_JesparTeleport)
_00E_PlayerFunctions.GetTeleportControl().TeleportPlayer(MQ07a_SC13_PlayerTeleport)
EndIf
EndFunction
Function FadeToBlackTealor()
Game.DisablePlayerControls()
FadeToBlackImod.Apply()
Utility.Wait(2.5)
MQ07A_SC13_TealorFinalDialogue.ForceStart()
_00E_MC_TealorREF.MoveTo(MQ07a_SC13_TealorTableMarker)
PlayerREF.MoveTo(MQ07a_SC13_PlayerStand)
FadeToBlackHoldImod.Apply()
FadeToBlackImod.Remove()
Utility.Wait(3)
FadeToBlackBackImod.Apply()
FadeToBlackHoldImod.Remove()
EndFunction
Function EnableSigilStone()
Game.EnablePlayerControls()
MQ07a_SC14_SigilstoneMarker.PlaceAtMe(_00E_MQ07a_SigilStoneShards)
_00E_MC_LexREF.MoveTo(MQ07a_SC14_LexMoveToMarker)
_00E_MC_KonstantinREF.MoveTo(MQ07a_SC14_KonstantinMoveToMarker)
_00E_MQ07a_YoungMageREF.MoveTo(MQ07a_SC14_YoungMageMarker)
MQ07A_SC14_SigilstoneActivation.ForceStart()
MQ07a_SC14_Pedestal.EnableNoWait()
MQ07a_SC14_SigilStone.EnableNoWait()
MQ07a_SC14_SigilstoneFX.EnableNoWait()
MQ07a_SC14_SigilStoneLight2.EnableNoWait()
ActorBase dummyOwner = PlayerREF.GetActorBase()
int nItems = MQ07a_SC14_FurnitureToDisable.GetSize()
Int Index = 0
While Index < nItems
(MQ07a_SC14_FurnitureToDisable.GetAt(Index) as ObjectReference).SetActorOwner(dummyOwner)
Index += 1
EndWhile
EndFunction
Function RemoveDrawing()
PlayerREF.RemoveItem(_00E_MQ07a_PyreanGlyphsDrawing)
EndFunction
Function ActivateSigilStone()
_00E_MQ07a_SigilStoneActivationM.Play(MQ07a_SC14_SigilStone)
MQ07a_SC14_SigilStone.PlaceAtMe(_00E_NPCOorbayaUnleashHeavenExplosion)
MQ07a_SC14_SigilStone.PlaceAtMe(_00E_MQ07a_SigilStoneShardsAct)
MQ07a_SC14_SigilStone.PlaceAtMe(_00E_MQ07a_SigilStoneShardsAct)
MQ07a_SC14_SigilStone.PlaceAtMe(_00E_MQ07a_SigilStoneShardsAct)
Game.ShakeCamera(afStrength = 0.5)
MQ07a_SC14_SigilStone.KnockAreaEffect(1, 1024)
MQ07a_SC14_SigilstoneActivationExpIMOD.Apply()
EndFunction
Function AddSigilStone()
_00E_MQ07a_SigilStoneShardTouchIMOD.Apply()
PlayerREF.AddSpell(_00E_MQ07a_AbSigilStoneShard, True)
EndFunction
Function GiveMoneyReward()
PlayerREF.AddItem(Gold001, __Config_rewardGold)
EndFunction
Function EndSC14()
int nItems = MQ07a_SC14_FurnitureToDisable.GetSize()
Int Index = 0
While Index < nItems
(MQ07a_SC14_FurnitureToDisable.GetAt(Index) as ObjectReference).SetActorOwner(None)
Index += 1
EndWhile
EndFunction
Function CompleteMQ07a()
_00E_PlayerFunctions.GetSoundControl().RemoveSilence()
AllowIdleChatter.SetValue(1)
_00E_EPHandler.GiveEP(__Config_RewardEXP)
MQ07.SetObjectiveDisplayed(20)
MQ07.SetObjectiveCompleted(10)
Self.CompleteQuest()
Steam.UnlockAchievement("END_WORD_OF_THE_DEAD_01")
EndFunction
Function EnableWordOfTheDeadSound()
MQ07a_SC13_WordOfTheDeadSoundREF.Enable()
EndFunction
Function SC06DoorstepFailsave()
PlayerREF.MoveTo(MQ07a_SC10_PlayerWalkmarker)
EndFunction
Function SC06DoorstepFailsave2()
If PlayerREF.GetDistance(MQ07a_SC6_KitchenMarker001) > 32.0 || Math.Abs(PlayerRef.GetAngleZ() - MQ07a_SC6_KitchenMarker001.GetAngleZ()) > 15.0
PlayerREF.MoveTo(MQ07a_SC6_KitchenMarker001)
EndIf
EndFunction
;=====================================================================================
; AMBUSH FAILSAVE
;=====================================================================================
Function StartAmbushFailsave()
If bDoneBattleFailsave == False ; Version update
bDoneBattleFailsave = True
RegisterForSingleUpdate(1.0)
EndIf
EndFunction
Event OnUpdate()
Int iCurWave = MQ07a_CurrentWave.GetValueInt()
If iCurWave >= 1 && iCurWave <= 3
LocationRefType locRefType
GlobalVariable enemyCounterGlobal
Int aliveEnemyCount
bDoneBattleFailsave = True
If iCurWave == 1
locRefType = MQ07a_SC9_Footman_Wave01
enemyCounterGlobal = MQ07a_Wave_01_EnemiesTotal
ElseIf iCurWave == 2
locRefType = MQ07a_SC9_Footman_Wave02
enemyCounterGlobal = MQ07a_Wave_02_EnemiesTotal
ElseIf iCurWave == 3
locRefType = MQ07a_SC9_Footman_Wave03
enemyCounterGlobal = MQ07a_Wave_03_EnemiesTotal
Else
Return
EndIf
If MQ07a_VisionRealm.GetRefTypeAliveCount(locRefType) <= 0
aliveEnemyCount = 0 ; Failsave
Else
aliveEnemyCount = enemyCounterGlobal.GetValueInt()
EndIf
If MQ07a_EnemiesLeft.GetValueInt() != aliveEnemyCount
MQ07a_EnemiesLeft.SetValueInt(aliveEnemyCount)
UpdateCurrentInstanceGlobal(MQ07a_EnemiesLeft)
SetObjectiveCompleted(30, 0)
SetObjectiveDisplayed(30, True, True)
If aliveEnemyCount <= 0
ResetHouseEnemyCounter()
Utility.Wait(1.0)
MQ07a_CurrentWave.Mod(1)
Else
RegisterForSingleUpdate(BATTLE_LONG_UPDATE_PERIOD)
EndIf
Else
RegisterForSingleUpdate(1.0)
EndIf
EndIf
EndEvent
;=====================================================================================
; PROPERTIES
;=====================================================================================
float TimescaleDefault
bool bKurmarFailsave
Bool bDoneBattleFailsave
Float Property BATTLE_LONG_UPDATE_PERIOD = 5.1 AutoReadOnly
bool Property bKnockedOut Auto Hidden Conditional
int LiftSound
int Property __Config_RewardEXP Auto
{How much EXP is to be granted upon quest completion}
int Property __Config_rewardGold Auto
{How much Gold is to be granted upon quest completion}
GlobalVariable Property AllowIdleChatter Auto
Actor SC9_Mage
Actor Property _00E_MC_JesparREF Auto
Actor Property _00E_MC_TealorREF Auto
Actor Property _00E_MC_LexREF Auto
Actor Property _00E_MC_KonstantinREF Auto
Actor Property PlayerREF Auto
Actor Property MQ07a_TheAgedManREF Auto
Actor Property MQ07a_SC5_SpiritActor Auto
Actor Property MQ07a_KurmarREF Auto
Actor Property MQ07a_ZuraREF Auto
Actor Property _00E_MQ07a_YoungMageREF Auto
Actor Property MQ07a_SC10_MageREF Auto
ObjectReference Property MQ07a_SC8_ShouterREF Auto
ReferenceAlias Property PlayerVoice Auto
MiscObject Property Gold001 Auto
Sound Property _00E_MQ07a_SC10_PyreanDeathFreezeM Auto
Armor Property ElderScrollHandAttachArmor Auto
Armor Property _00E_MQ07a_TealorNecklace Auto
EffectShader Property GhostFXShader Auto
EffectShader Property TimeFadeIn01FXS Auto
EffectShader Property TimeFadeOut01FXS Auto
Explosion Property _00E_TeleportExplosion Auto
Quest Property MQ07 Auto
Explosion Property FallingDustExplosion01 Auto
Explosion Property _00E_NPCOorbayaUnleashHeavenExplosion Auto
Location Property MQ07a_VisionRealm Auto
Activator Property _00E_MQ07a_SigilStoneShardsAct Auto
LocationRefType Property MQ07a_SC9_Footman_Wave01 Auto
LocationRefType Property MQ07a_SC9_Footman_Wave02 Auto
LocationRefType Property MQ07a_SC9_Footman_Wave03 Auto
Weather Property _00E_MQ07aOldManManorNoRain Auto
ReferenceAlias Property SC10_Mage Auto
MusicType Property _00E_Music_Combat_BonehunterNoCond Auto
ObjectReference Property MQ07a_OetziREF Auto
ObjectReference Property MQ07a_SC1_LexMarker Auto
ObjectReference Property MQ07a_SC1_JesparMarker Auto
ObjectReference Property MQ07a_SC1_TealorMarker Auto
ObjectReference Property MQ07a_SC2_JesparTargetMarker Auto
ObjectReference Property MQ07a_SC2_Campfire Auto
ObjectReference Property MQ07a_SC2_JesparWaitForNightfallMarker Auto
ObjectReference Property MQ07a_SC2_PlayerWaitMarker Auto
ObjectReference Property MQ07a_SC4_ChairREF Auto
ObjectReference Property MQ07a_SC3_LivingRoomDoor Auto
ObjectReference Property MQ07a_SC4_ExtraRoomDoor Auto
ObjectReference Property MQ07a_SC5_LiftPlatform Auto
ObjectReference Property MQ07a_SC5_LiftMarkerDown Auto
ObjectReference Property MQ07a_SC5_LiftMarker02 Auto
ObjectReference Property MQ07a_SC5_Platform Auto
ObjectReference Property MQ07a_SC5_PlatformMarker01 Auto
ObjectReference Property MQ07a_SC5_PlatformMarker02 Auto
ObjectReference Property MQ07a_SC5_PlatformMarker03 Auto
ObjectReference Property MQ07a_SC5_OetziREFNew Auto
ObjectReference Property MQ07a_SC5_TeleportPlayerMarker Auto
ObjectReference Property MQ07a_SC5_Mist Auto
ObjectReference Property MQ07a_SC5_FlyMarkerM Auto
ObjectReference Property MQ07a_SC6_KitchenMarker001 Auto
ObjectReference Property MQ07a_SC08_ZuraMarker Auto
ObjectReference Property MQ07a_SC08_KurmarWalkout Auto
ObjectReference Property MQ07a_SC08_ArrowMarker Auto
ObjectReference Property MQ07a_SC8_HouseDoor Auto
ObjectReference Property MQ07a_SC9_Door Auto
ObjectReference Property MQ07a_SC9_MageAppearMarker Auto
ObjectReference Property MQ07a_SC11_AgedManLeanFurniture Auto
ObjectReference Property MQ07a_SC11_PlayerMarker Auto
ObjectReference Property MQ07a_SC11_light Auto
ObjectReference Property MQ07a_SC11_Door Auto
ObjectReference Property MQ07a_SC12_PlayerPortOutMarker Auto
ObjectReference Property MQ07a_SC12_Linker Auto
ObjectReference Property MQ07a_SC12_JesparPortMarker Auto
ObjectReference Property MQ07a_SC13_JesparLean Auto
ObjectReference Property MQ07a_SC13_PlayerMarker Auto
ObjectReference Property MQ07a_SC13_WordOfTheDead Auto
ObjectReference Property MQ07a_SC13_JesparTeleport Auto
ObjectReference Property MQ07a_SC13_PlayerTeleport Auto
ObjectReference Property MQ07a_SC3_PianoMusic Auto
ObjectReference Property MQ07a_SC13_TealorTableMarker Auto
ObjectReference Property MQ07a_SC13_PlayerStand Auto
ObjectReference Property MQ07a_SC14_Pedestal Auto
ObjectReference Property MQ07a_SC14_SigilStone Auto
ObjectReference Property MQ07a_SC14_SigilstoneFX Auto
ObjectReference Property MQ07a_SC14_SigilStoneLight2 Auto
ObjectReference Property MQ07a_SC14_LexMoveToMarker Auto
ObjectReference Property MQ07a_SC14_KonstantinMoveToMarker Auto
ObjectReference Property MQ07a_SC14_YoungMageMarker Auto
ObjectReference Property MQ07a_SC14_SigilstoneMarker Auto
ObjectReference Property MQ07a_SC6_CollPlane Auto
ObjectReference Property MQ07a_SC5_PyreanHeadmarker Auto
ObjectReference Property MQ07a_SC6_KnockDoorMarker Auto
ObjectReference Property MQ07a_SC06_KitchenDoorREF Auto
ObjectReference Property _00E_MQ07a_GlyphDrawingContainerREF Auto
ObjectReference Property MQ07a_JesparFollowTriggerStartREF Auto
ObjectReference Property MQ07a_SC13_WordOfTheDeadSoundREF Auto
ObjectReference Property MQ07a_SC10_PlayerWalkmarker Auto
ObjectReference Property MQ07a_VisionStart_REF Auto
ObjectReference Property _00E_MQ07a_SC6_VisionHomeTGBX_Ref Auto
Sound Property DRSStoneLabyrinthianOpenM Auto
Sound Property DRSStoneRotatingDiscLPM Auto
Sound Property _00E_A2_Ghostwalk_TeleportDoneSound Auto
Sound Property _00E_TeleportCharge Auto
Sound Property _00E_MQ07a_WordOfTheDeadTransformSpiritM Auto
Sound Property OBJEyeofMagnusVanishM Auto
Sound Property FXExplosionCatapultNearM Auto
Sound Property _00E_MQ07a_VisionStartM Auto
Sound Property _00E_MQ07a_DoorBangM Auto
Sound Property QSTMQ206ElderScrollRead2DSound Auto
Sound Property TRPImpactImpalex Auto
Sound Property _00E_Horror_Ghosts_01M Auto
Sound Property _00E_MQ07a_SigilStoneActivationM Auto
Idle Property IdleMT_DoorBang Auto
Idle Property IdleStop Auto
Idle Property WebIdleExit Auto
Idle Property bleedoutStart Auto
Idle Property bleedoutStop Auto
MusicType Property _00E_Music_Special_Zyklus_OneSelection Auto
ImageSpaceModifier Property FadeToBlackIMOD Auto
ImageSpaceModifier Property FadeToBlackHoldIMOD Auto
ImageSpaceModifier Property FadeToBlackBackIMOD Auto
ImageSpaceModifier Property _00e_TeleportArrive Auto
ImageSpaceModifier Property _00E_MQ07a_WordOfTheDeadTransformIMOD Auto
ImageSpaceModifier Property _00E_MQ07a_VisionIMOD Auto
ImageSpaceModifier Property _00E_MQ07a_VisionAwake Auto
ImageSpaceModifier Property _00E_MQ07a_FreezePlayer Auto
ImageSpaceModifier Property _00E_MQ07a_FreezePlayerFinal Auto
ImageSpaceModifier Property _00E_MQ07a_CollapseManor Auto
ImageSpaceModifier Property _00E_NPCTeleportExplosionIMOD Auto
ImageSpaceModifier Property FadeToWhiteBackImod Auto
ImageSpaceModifier Property MQ07a_SC14_SigilstoneActivationExpIMOD Auto
ImageSpaceModifier Property _00E_MQ07a_SigilStoneShardTouchIMOD Auto
Formlist Property _00E_MQ07a_Enemies_Wave_01 Auto
Formlist Property _00E_MQ07a_Enemies_Wave_02 Auto
Formlist Property _00E_MQ07a_Enemies_Wave_03 Auto
GlobalVariable Property MQ07a_Wave_01_EnemiesTotal Auto
GlobalVariable Property MQ07a_Wave_02_EnemiesTotal Auto
GlobalVariable Property MQ07a_Wave_03_EnemiesTotal Auto
Scroll Property _01E_TeleportrolleSonnentempel Auto
Message Property _00E_MQ07a_ThoughtsMemory02 Auto
Message Property _00E_MQ07a_ThoughtsMemory03 Auto
MiscObject Property _00E_MQ07a_SigilStoneShards Auto
MiscObject Property _00E_MQ07a_PyreanGlyphsDrawing Auto
MiscObject Property _00E_MQ07a_RitualScroll Auto
Scene Property MQ07a_SC1_ExplanationInChronikum Auto
Scene Property MQ07A_SC2_TravelToManor Auto
Scene Property MQ07A_SC3_GateScene Auto
Scene Property MQ07A_SC4_Interlude Auto
Scene Property MQ07A_SC5_Riddle Auto
Scene Property MQ07A_SC6_Doorstep Auto
Scene Property MQ07A_SC7_KitchenScene Auto
Scene Property MQ07A_SC8_PlayerReadScroll Auto
Scene Property MQ07A_SC9_Battle Auto
Scene Property MQ07A_SC10_MageKillsPyrean Auto
Scene Property MQ07A_SC11_DialogueWithAgedMan Auto
Scene Property MQ07A_SC12_JesparFinalDialogue Auto
Scene Property MQ07A_SC13_TealorFinalDialogue Auto
Scene Property MQ07A_SC14_SigilstoneActivation Auto
Spell Property _00E_MQ07a_MageIceSpike Auto
Spell Property _00E_MQ07a_MageIceSTorm Auto
Spell Property _00E_Ability_StaggerSelfSpell Auto
Spell Property _00E_MQ07a_TeleportPyreanSP Auto
Spell Property _00E_MQ07a_KillerArrowSP Auto
Spell Property _00E_MQ07a_AbSigilStoneShard Auto
Key Property _00E_MQ07a_ChestKey Auto
GlobalVariable Property MQ07a_PlatformActivated Auto
GlobalVariable Property Timescale Auto
GlobalVariable Property MQ07a_EnemiesLeft Auto
GlobalVariable Property MQ07a_CurrentWave Auto
GlobalVariable Property _00E_TeleportGlobal Auto
GlobalVariable Property CompanionIsTalking Auto
GlobalVariable Property _00E_FS_Theriantrophist_AllowTemporaryTransform Auto
Formlist Property MQ07a_SC14_FurnitureToDisable Auto