enderalse/source/scripts/_00e_nq_g_03_functions.psc

250 lines
7.6 KiB
Plaintext
Raw Normal View History

Scriptname _00E_NQ_G_03_Functions extends Quest Conditional
Import Utility
2024-02-29 22:28:19 +00:00
int function _GetScriptVersion() Global
return 1
endFunction
;=====================================================================================
; EVENTS
;=====================================================================================
Event OnUpdate()
2024-02-05 02:17:04 +00:00
_00E_PlayerFunctions.GetSoundControl().RemoveCombatSoundtracks()
EndEvent
;=====================================================================================
; FUNCTIONS
;=====================================================================================
Function GiveLetter()
PlayerREF.AddItem(_00E_NQ_G_03_LetterForCaravan)
EndFunction
Function RemoveLetter()
PlayerREF.RemoveItem(_00E_NQ_G_03_LetterForCaravan)
EndFunction
Function GivePaycheck()
PlayerREF.AddItem(_00E_NQ_G_03_Paycheck)
EndFunction
Function RemovePaycheck()
PlayerREF.RemoveItem(_00E_NQ_G_03_Paycheck)
EndFunction
Function RemoveBrooch()
PlayerREF.RemoveItem(_00E_NQ_G_03_GoldenSickleBrooch)
_00E_NQ_G_03_BroochHandedIn.SetValue(1)
EndFunction
Function RewardMoney()
PlayerREF.AddItem(Gold001, __Config_RewardMoney)
EndFunction
Function EnableCaravan()
_00E_NQ_G_03_CaravanEnableMarker001.Enable()
_00E_NQ_G_03_AlyxREF001.SetGhost(true)
_00E_NQ_G_03_DevraREF001.SetGhost(true)
EndFunction
Function DisableCaravan()
_00E_NQ_G_03_CaravanEnableMarker001.Disable()
EndFunction
Function ShowInnerVoice()
if !Done
if !(__Config_MessageBox)
Message.ResetHelpMessage(InputEventName)
TutorialMessage.ShowAsHelpMessage(InputEventName, Duration, IntervalTime, HowManyTimesDisplayed)
Done = True
Else
TutorialMessage.Show()
Done = True
EndIf
EndIf
EndFunction
Function StartSC01()
NQ_G_03_SC01_CaravanFight.ForceStart()
EndFunction
Function StartSC02()
_00E_PlayerFunctions.GetSoundControl().RemoveSilence()
2024-02-05 02:17:04 +00:00
_00E_PlayerFunctions.GetSoundControl().RemoveCombatSoundtracks()
NQ_G_03_SC02_PetrifiedExamineCaravan.ForceStart()
EndFunction
Function StartFight()
;rest is done in _00E_NG_G_03_PetrifiedCombatSC
_00E_NQ_G_03_DevraREF001.StartCombat(PlayerREF)
_00E_NQ_G_03_AlyxREF001.StartCombat(PlayerREF)
EndFunction
Function TryToChangeCombatSoundtrack()
If (_00E_NQ_G_03_DevraREF001.IsInCombat() || _00E_NQ_G_03_AlyxREF001.IsInCombat()) && !bSoundtrackPlaying
_00E_Music_Combat_Dark.Add()
bSoundtrackPlaying = true
ElseIf !_00E_NQ_G_03_DevraREF001.IsInCombat() && !_00E_NQ_G_03_AlyxREF001.IsInCombat()
_00E_Music_Combat_Dark.Remove()
bSoundtrackPlaying = false
EndIf
EndFunction
Function StopFight()
2024-01-10 14:08:24 +00:00
SetCurrentStageID(20)
_00E_NQ_G_03_DevraREF001.SetActorValue("Aggression", 0)
_00E_NQ_G_03_AlyxREF001.SetActorValue("Aggression", 0)
_00E_NQ_G_03_DevraREF001.StopCombat()
_00E_NQ_G_03_AlyxREF001.StopCombat()
_00E_NQ_G_03_DevraREF001.SetGhost(True)
_00E_NQ_G_03_AlyxREF001.SetGhost(True)
_00E_NQ_G_03_AlyxREF001.RestoreActorValue("Health", 300.0)
_00E_NQ_G_03_DevraREF001.RestoreActorValue("Health", 300.0)
; The birds need some time to get 3D-loaded for the animations to play (at least half a second)
_00E_NQ_G_03_AlyxBirdsREF001.EnableNoWait()
_00E_NQ_G_03_DevraBirdsREF001.EnableNoWait()
Wait(2)
Debug.SendAnimationEvent(_00E_NQ_G_03_AlyxREF001, "returnToDefault")
_00E_NQ_G_03_AlyxREF001.PlayIdle(IdleRitualStart)
ObjectReference refRavenMarkerAlyx = _00E_NQ_G_03_AlyxREF001.PlaceAtMe(XMarker, 1)
refRavenMarkerAlyx.MoveTo(_00E_NQ_G_03_AlyxREF001, 0.0, 0.0, -250, false)
_00E_NQ_G_03_AlyxBirdsREF001.MoveTo(refRavenMarkerAlyx, 0.0, 0.0, 0.0, false)
_00E_NQ_G_03_AlyxBirdsREF001.SetAngle(0.0, 0.0, 0.0)
_00E_NQ_G_03_AlyxBirdsREF001.PlayAnimation("Playanim01")
_00E_NQ_G_03_AlyxBirdsREF001.PlayGamebryoAnimation("AnimPlay")
ObjectReference refRavenMarkerDevra = _00E_NQ_G_03_DevraREF001.PlaceAtMe(XMarker, 1)
refRavenMarkerDevra.MoveTo(_00E_NQ_G_03_DevraREF001, 0.0, 0.0, -250, false)
_00E_NQ_G_03_DevraBirdsREF001.MoveTo(refRavenMarkerDevra, 0.0, 0.0, 0.0, false)
_00E_NQ_G_03_DevraBirdsREF001.SetAngle(0.0, 0.0, 0.0)
_00E_NQ_G_03_DevraBirdsREF001.PlayAnimation("Playanim01")
_00E_NQ_G_03_DevraBirdsREF001.PlayGamebryoAnimation("AnimPlay")
Wait(3)
AtronachUnsummonDeathFXS.Play(_00E_NQ_G_03_AlyxREF001)
_00E_A2_GhostwalkTeleportVFX.Play(_00E_NQ_G_03_AlyxREF001)
AtronachUnsummonDeathFXS.Play(_00E_NQ_G_03_DevraREF001)
_00E_A2_GhostwalkTeleportVFX.Play(_00E_NQ_G_03_DevraREF001)
Wait(1.5)
_00E_NQ_G_03_DevraREF001.PlaceAtMe(ExplosionShockMassNoEffects, 1)
_00E_NQ_G_03_AlyxREF001.PlaceAtMe(ExplosionShockMassNoEffects, 1)
_00E_NQ_G_03_DevraREF001.MoveTo(_00E_NPCDumpMarker)
_00E_NQ_G_03_AlyxREF001.MoveTo(_00E_NPCDumpMarker)
_00E_NQ_G_03_DevraREF001.KillEssential()
_00E_NQ_G_03_AlyxREF001.KillEssential()
_00E_Music_Combat_Dark.Remove()
SetObjectiveDisplayed(20)
_00E_NQ_G_03_AlyxBirdsREF001.DisableNoWait()
_00E_NQ_G_03_DevraBirdsREF001.DisableNoWait()
refRavenMarkerAlyx.DisableNoWait()
refRavenMarkerDevra.DisableNoWait()
refRavenMarkerAlyx.Delete()
refRavenMarkerDevra.Delete()
NQ_G_03_SC01_CaravanFight.Stop()
RegisterForSingleUpdate(5)
EndFunction
Function FadeOutIn()
FadeToBlackIMOD.Apply()
Wait(2)
FadeToBlackHoldIMOD.ApplyCrossFade(1)
FadeToBlackBackIMOD.ApplyCrossFade(1)
EndFunction
Function FinishQuest()
_00E_EPHandler.GiveEP(__Config_RewardEXP)
Self.CompleteQuest()
EndFunction
;=====================================================================================
; PROPERTIES
;=====================================================================================
bool Done
bool bSoundtrackPlaying
bool Property bLetterOpened Auto Conditional
bool Property bAmuletPickedUp Auto Conditional
;rewards
int Property __Config_RewardEXP Auto
int Property __Config_RewardMoney Auto
MiscObject Property Gold001 Auto
;actors
Actor Property PlayerRef Auto
Actor Property _00E_NQ_G_03_AlyxREF001 Auto
Actor Property _00E_NQ_G_03_DevraREF001 Auto
ObjectReference Property _00E_NQ_G_03_CaravanEnableMarker001 Auto
;items
Book Property _00E_NQ_G_03_LetterForCaravan Auto
Book Property _00E_NQ_G_03_Paycheck Auto
Armor Property _00E_NQ_G_03_GoldenSickleBrooch Auto
;inner voice
bool Property __Config_MessageBox Auto ;If true, the message will be displayed in a messagebox rather than a floating tutorial message
int Property Duration Auto ;How long should the message be displayed
int Property IntervalTime Auto ;How much time should elapse between showings of the message
int Property HowManyTimesDisplayed Auto ;How often should the message be displayed in total
Message Property TutorialMessage Auto
String Property InputEventName Auto ; If available, specify and input event, such as "Jump" or "Attack". The message will disappear after sucessful execution of this event.
;marker
Objectreference Property _00E_NPCDumpMarker Auto
;effects for scene
VisualEffect Property _00E_A2_GhostwalkTeleportVFX Auto
Idle Property IdleRitualStart Auto
Static Property XMarker Auto ;for placing the ravens
ObjectReference Property _00E_NQ_G_03_AlyxBirdsREF001 Auto
ObjectReference Property _00E_NQ_G_03_DevraBirdsREF001 Auto
Explosion Property ExplosionShockMassNoEffects Auto
EffectShader Property AtronachUnsummonDeathFXS Auto
MusicType Property _00E_Music_Combat_Dark Auto
;scenes
Scene Property NQ_G_03_SC01_CaravanFight Auto
Scene Property NQ_G_03_SC02_PetrifiedExamineCaravan Auto
;fadeout
ImagespaceModifier Property FadeToBlackIMOD Auto
ImagespaceModifier Property FadeToBlackHoldIMOD Auto
ImagespaceModifier Property FadeToBlackBackIMOD Auto
;for use in later quests
Globalvariable Property _00E_NQ_G_03_BroochHandedIn Auto