Scriptname _00E_MQ12a_Functions extends Quest int function _GetScriptVersion() Global return 1 endFunction ;===================================================================================== ; EVENTS ;===================================================================================== Event OnUpdate() If Self.GetCurrentStageID() >= 20 && Self.GetCurrentStageID() < 25 Self.SetCurrentStageID(25) Return EndIf ; Failsave for the case when MQ12b fails to start ; ( http://sureai.net:9898/browse/ERB-165 ). If IsCompleted() && (MQ12b.GetCurrentStageID() < 5 || !MQ12b.IsRunning()) MQ12b.SetCurrentStageID(5) Utility.Wait(1) if MQ12b.GetCurrentStageID() < 5 _00E_MQ12aQuestBugMSG.Show() RegisterForSingleUpdate(6) endif EndIf EndEvent ;===================================================================================== ; FUNCTIONS ;===================================================================================== Function EnableBonfire() If MQ10b_SC2_Temple.IsPlaying() MQ10b_SC2_Temple.Stop() EndIf if MQ10b_SC4_Tealor.IsPlaying() MQ10b_SC2_Temple.Stop() EndIf _00E_TeleportGlobal.SetValueInt(0) LeuchtfeuerSwitcher.Enable() EndFunction Function UpdateStoneCount() int iStoneCount = MQ12a_BlackStonesInserted.GetValueInt() if iStoneCount < 3 Self.UpdateCurrentInstanceGlobal(MQ12a_BlackStonesInserted) Self.SetObjectiveCompleted(5, 0) Self.SetObjectiveDisplayed(5, True, True) Elseif iStoneCount == 3 Self.UpdateCurrentInstanceGlobal(MQ12a_BlackStonesInserted) Self.SetObjectiveCompleted(5) EndIf EndFunction Function StartSC01() MQ12a_SC1_Insert1stStone.ForceStart() EndFunction Function InsertFirstStoneFX() PlayLexInsertStoneAnimation(MQ12a_SC1_BlackStone01) Bool bLexIsGhost = _00E_MC_LexREF.IsGhost() If bLexIsGhost _00E_MC_LexREF.SetGhost(False) ; For _00E_Ability_StaggerSelfSpell to work on Lex EndIf MQ07a_SC14_SigilstoneActivationExpIMOD.Apply() _00E_Ability_StaggerSelfSpell.Cast(_00E_MC_LexREF, _00E_MC_LexREF) MQ12a_SC1_BlackStone01.Enable() MQ12a_SC1_BlackStone01.PlaceAtMe(ExplosionShockMassNoEffects, 1) If bLexIsGhost _00E_MC_LexREF.SetGhost(True) EndIf EndFunction Function InsertFirstStone02FX() PlayLexInsertStoneAnimation(MQ12a_SC1_BlackStone02) MQ07a_SC14_SigilstoneActivationExpIMOD.Apply() MQ12a_SC1_BlackStone02.Enable() MQ12a_SC1_BlackStone02.PlaceAtMe(ExplosionShockMassNoEffects, 1) EndFunction Function InsertFirstStone03FX() PlayLexInsertStoneAnimation(MQ12a_SC3_BlackStone03) MQ07a_SC14_SigilstoneActivationExpIMOD.Apply() MQ12a_SC3_BlackStone03.Enable() MQ12a_SC3_BlackStone03.PlaceAtMe(ExplosionShockMassNoEffects, 1) Utility.Wait(0.5) _00E_MQ12a_ActivateBeaconIMOD.Apply() _00E_MQ12a_BeaconMagicREF.KnockAreaEffect(1, 2048) Game.ShakeCamera(afStrength = 0.5) _00E_MQ12a_BeaconMagicREF.EnableNoWait() _00E_MQ12a_BeaconMagicREF.PlaceAtMe(PowerRacialWoodElfCommandAnimalExplosion01) EndFunction Function PlayLexInsertStoneAnimation(ObjectReference refStone) _00E_MC_LexREF.SetLookAt(refStone) Utility.Wait(0.25) _00E_MC_LexREF.PlayIdle(IdleGive) Utility.Wait(2.0) EndFunction Function LexLookAtStone03() _00E_MC_LexREF.SetLookAt(MQ12a_SC3_BlackStone03) EndFunction Function ClearLexLookAt() _00E_MC_LexREF.ClearLookAt() EndFunction Function StartSC02() MQ12a_SC2_Insert2ndStone.ForceStart() EndFunction Function StartSC03() MQ12a_SC3_Insert3rdStone.ForceStart() EndFunction Function FinishQuestAndStartMQ12b() MQ12a_SC3_Insert3rdStone.Stop() _00E_EPHandler.GiveEP(__Config_iRewardExp) Self.CompleteQuest() Self.SetObjectiveCompleted(5) MQ12b.SetCurrentStageID(5) RegisterForSingleUpdate(4) ; Failsafe in case SC3 fails to do this MQ12a_SC3_BlackStone03.EnableNoWait() _00E_MQ12a_BeaconMagicREF.EnableNoWait() Steam.UnlockAchievement("END_BLACK_STONES_01") ;added in FS If FS_NQ03 == NONE FS_NQ03 = Game.GetFormFromFile(0x000438AD, "Skyrim.esm") as Quest EndIf if FS_NQ03.GetCurrentStageID() < 280 FS_NQ03.FailAllObjectives() FS_NQ03.SetCurrentStageID(1000) endif EndFunction Function StartCQC04() If !CQC03.IsCompleted() && CQC03.IsRunning() CQC03.SetCurrentStageID(20) CQC03.FailAllObjectives() Elseif CQC03.IsCompleted() CQC04.SetCurrentStageID(5) EndIf EndFunction Function StartCQJ04() If CQJ02.IsCompleted() CQJ04.SetCurrentStageID(5) Elseif !(CQJ02.IsCompleted()) && CQJ02.IsRunning() CQJ04.FailAllObjectives() CQJ04.SetCurrentStageID(40) EndIf EndFunction Function StartMQ12bFailsave() RegisterForSingleUpdate(45) EndFunction ;===================================================================================== ; PROPERTIES ;===================================================================================== bool bStartJesparCQ bool bStartCaliaCQ int Property __Config_iRewardExp = 500 Auto {How much EP are to be granted upon quest completion} Quest Property CQC04 Auto Quest Property CQC03 Auto Quest Property CQJ04 Auto Quest Property CQJ02 Auto Quest Property FS_NQ03 Auto Quest Property MQ12b Auto Actor Property _00E_MC_LexREF Auto ObjectReference Property LeuchtfeuerSwitcher Auto ObjectReference Property MQ12a_SC1_BlackStone01 Auto ObjectReference Property MQ12a_SC1_BlackStone02 Auto ObjectReference Property MQ12a_SC3_BlackStone03 Auto ObjectReference Property _00E_MQ12a_BeaconMagicREF Auto ImageSpaceModifier Property MQ07a_SC14_SigilstoneActivationExpIMOD Auto ImageSpaceModifier Property _00E_MQ12a_ActivateBeaconIMOD Auto GlobalVariable Property MQ12a_BlackStonesInserted Auto GlobalVariable Property _00E_TeleportGlobal Auto Spell Property _00E_Ability_StaggerSelfSpell Auto Scene Property MQ12a_SC1_Insert1stStone Auto Scene Property MQ12a_SC2_Insert2ndStone Auto Scene Property MQ12a_SC3_Insert3rdStone Auto Scene Property MQ10b_SC4_Tealor Auto Scene Property MQ10b_SC2_Temple Auto Explosion Property ExplosionShockMassNoEffects Auto Explosion Property PowerRacialWoodElfCommandAnimalExplosion01 Auto Idle Property IdleGive Auto Message Property _00E_MQ12aQuestBugMSG Auto