4
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

87 lines
2.5 KiB

Scriptname _00E_ComplexSermonTriggerBox extends ObjectReference
Import Utility
;=====================================================================================
; EVENTS
;=====================================================================================
Event OnInit()
Ready = True
EndEvent
Event OnTriggerEnter(ObjectReference akActionRef)
If akActionRef == PlayerREF && !SermonSceneArray[0].IsPlaying() && !__Config_Priest.IsDead() && Ready
If (GameHour.GetValue() >= __Config_ValidGameTimeMax) || (GameHour.GetValue() <= __Config_ValidGameTimeMin)
PreachingMarker.ForceRefTo(__Config_Priest.GetLinkedRef())
Preaching_LookMarker.ForceRefTo(__Config_Priest.GetLinkedRef(PreachingMarkerKeyword))
Preacher.ForceRefTo(__Config_Priest)
If __Config_Priest.IsDisabled()
__Config_Priest.Enable()
EndIf
__Config_Priest.MoveTo(objSermonPriestStartMarker)
ChosenScene = GetRandomSermonScene()
ChosenScene.ForceStart()
If (ChosenScene.IsPlaying())
Ready = False
RegisterForSingleUpdateGameTime(6)
EndIf
EndIf
EndIf
EndEvent
Event OnUpdateGameTime()
Ready = True
EndEvent
;=====================================================================================
; FUNCTION
;=====================================================================================
Scene Function GetRandomSermonScene()
SceneToPlay = SermonSceneArray[SermonIndex]
int SermonIndex = RandomInt(0, SermonSceneArray.Length)
Return SceneToPlay
EndFunction
;=====================================================================================
; PROPERTIES
;=====================================================================================
bool Ready = True
Scene Property SceneToPlay Auto Hidden
Scene Property ChosenScene Auto Hidden
Scene[] Property SermonSceneArray Auto
ReferenceAlias Property Preacher Auto
ReferenceAlias Property PreachingMarker Auto
ReferenceAlias Property Preaching_LookMarker Auto
Keyword Property PreachingMarkerKeyword Auto
GlobalVariable Property GameHour Auto
ObjectReference Property objSermonPriestStartMarker Auto
Float Property __Config_ValidGameTimeMin Auto
{The minimum game time}
Float Property __Config_ValidGameTimeMax Auto
{The max game time}
Actor Property PlayerREF Auto
Actor Property __Config_Priest Auto
{The priest who owns this temple and who should hold the sermon}