2021-10-05 22:15:58 +00:00
|
|
|
Scriptname _00E_JesparFollowTriggerSC 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()
|
|
|
|
|
2022-08-23 14:07:54 +00:00
|
|
|
if (CurrentQuest.GetCurrentStageID() >= ValidStageMin ) && (CurrentQuest.GetCurrentStageID() < ValidStageMax )
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
bool bWasZero
|
|
|
|
|
|
|
|
if TravelStateVariable.GetValue() == 0
|
|
|
|
bWasZero = True
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
If InTrigger == False
|
|
|
|
InTrigger = True
|
|
|
|
TravelStateVariable.SetValue((TravelStateVariable.GetValue()+1))
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
if ((TravelStateVariable.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
|
|
|
|
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
_00E_MC_JesparREF.EvaluatePackage()
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function SendExitEvent()
|
|
|
|
|
2022-08-23 14:07:54 +00:00
|
|
|
If (CurrentQuest.GetCurrentStageID() >= ValidStageMin) && (CurrentQuest.GetCurrentStageID() < ValidStageMax )
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
If InTrigger == True
|
|
|
|
TravelStateVariable.SetValue((TravelStateVariable.GetValue() - 1))
|
|
|
|
_00E_MC_JesparREF.EvaluatePackage()
|
|
|
|
InTrigger = False
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
If (TravelStateVariable.GetValue() == 0) && !bIsStartBox
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; PROPERTIES
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
bool InTrigger
|
|
|
|
bool bHasEntered
|
|
|
|
|
|
|
|
bool Property bIsStartBox = False Auto
|
|
|
|
|
|
|
|
int Property ValidStageMax Auto
|
|
|
|
int Property ValidStageMin Auto
|
|
|
|
|
|
|
|
Actor Property PlayerREF Auto
|
|
|
|
Actor Property _00E_MC_JesparREF Auto
|
|
|
|
|
|
|
|
Quest Property CurrentQuest Auto
|
|
|
|
|
|
|
|
GlobalVariable Property TravelStateVariable 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
|