Scriptname _00E_Complex_AddSilenceSC extends ObjectReference ; Eddoursul: Reworked in 2.1.4 to use states and the OnTrigger() event to encure silence track removal Event OnTriggerEnter(ObjectReference akActionRef) If akActionRef == PlayerREF If (__Config_QuestToSet.GetCurrentStageID() >= __Config_iMinStage) && (__Config_QuestToSet.GetCurrentStageID() <= __Config_iMaxStage) if GetState() == "" _00E_SilenceLongTransitionHighPriority.Add() GoToState("WaitLeave") endif EndIf EndIf EndEvent Event OnTriggerLeave(ObjectReference akActionRef) If akActionRef == PlayerREF _00E_SilenceLongTransitionHighPriority.Remove() GoToState("") UnregisterForUpdate() ;Debug.Notification("Leaving area") EndIf EndEvent Event OnCombatStateChanged(Actor akTarget, int aeCombatState) ; endEvent State WaitLeave Event OnBeginState() RegisterForSingleUpdate(3.0) ;Debug.Notification("Waiting to leave") EndEvent Event OnCombatStateChanged(Actor akTarget, int aeCombatState) if akTarget == PlayerREF ; Remove silence on combat start if aeCombatState == 1 GoToState("") endif endif endEvent Event OnTrigger(ObjectReference akActionRef) If akActionRef == PlayerREF RegisterForSingleUpdate(3.0) EndIf EndEvent Event OnUpdate() GoToState("") EndEvent Event OnEndState() _00E_SilenceLongTransitionHighPriority.Remove() ;Debug.Notification("Leaving area") EndEvent EndState int Property __Config_iMinStage Auto int Property __Config_iMaxStage Auto Actor Property PlayerREF Auto Quest Property __Config_QuestToSet Auto MusicType Property _00E_SilenceLongTransitionHighPriority Auto