Scriptname _00E_MQ08JesparFollowEntrigger extends ObjectReference ;===================================================================================== ; EVENTS ;===================================================================================== Event OnTriggerEnter(ObjectReference akActionRef) if (akActionRef == PlayerREF) SendEnterEvent() endif EndEvent Event OnTriggerLeave(ObjectReference akActionRef) if (akActionRef == PlayerREF) SendExitEvent() endif EndEvent ;===================================================================================== ; FUNCTIONS ;===================================================================================== Function SendEnterEvent() if(MQ08b_IntoTheDeep.GetStage() >= 75) && (MQ08b_IntoTheDeep.GetStage() < 100 ) If _00E_MC_JesparREF == None _00E_MC_JesparREF = Game.GetForm(0x0002b253) as Actor EndIf bool bWasZero if Counter.GetValue() == 0 bWasZero = True EndIf If InTrigger == False InTrigger = True Counter.SetValue((Counter.GetValue()+1)) EndIf if ((Counter.GetValue() == 0) || bWasZero) && !bIsStartBox bWasZero = False if _00E_JesparEntriggerFollowNotif != None _00E_JesparEntriggerFollowNotif.Show() endif If CompanionIsTalking == NONE CompanionIsTalking = Game.GetForm(0x000250BB) as GlobalVariable EndIf If CompanionIsTalking.GetValueInt() == 0 CompanionIsTalking.SetValueInt(1) _00E_MC_JesparREF.Say(JesparDialogue_Misc_PlayerReentersFollowTrigger) EndIf _00E_MC_JesparREF.EvaluatePackage() EndIf EndIf Return EndFunction Function SendExitEvent() If(MQ08b_IntoTheDeep.GetStage() >= 75) && (MQ08b_IntoTheDeep.GetStage() < 100) If InTrigger == True Counter.SetValue((Counter.GetValue() - 1)) _00E_MC_JesparREF.EvaluatePackage() InTrigger = False EndIf If (Counter.GetValue() == 0) If _00E_JesparEntriggerStopNotif != None _00E_JesparEntriggerStopNotif.Show() EndIf If CompanionIsTalking == NONE CompanionIsTalking = Game.GetForm(0x000250BB) as GlobalVariable EndIf If CompanionIsTalking.GetValueInt() == 0 CompanionIsTalking.SetValueInt(1) _00E_MC_JesparREF.Say(JesparDialogue_Misc_PlayerLeavesFollowTrigger) EndIf _00E_MC_JesparREF.EvaluatePackage() EndIf EndIf Return EndFunction ;===================================================================================== ; PROPERTIES ;===================================================================================== bool InTrigger bool bHasEntered bool Property bIsStartBox = False Auto Actor Property PlayerREF Auto Actor Property _00E_MC_JesparREF Auto Quest Property MQ08b_IntoTheDeep Auto GlobalVariable Property Counter Auto GlobalVariable Property CompanionIsTalking Auto Topic Property JesparDialogue_Misc_PlayerLeavesFollowTrigger Auto Topic Property JesparDialogue_Misc_PlayerReentersFollowTrigger Auto Message Property _00E_JesparEntriggerFollowNotif Auto Message Property _00E_JesparEntriggerStopNotif Auto