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.
 
 
 

120 lines
3.3 KiB

Scriptname _00E_MQ02JesparFollowEntrigger extends ObjectReference
; I have replaced this script by a modified copy of
; _00E_JesparFollowTriggerSC. -- arvisrend, 17 Aug 2016
; Changed vital parts of the script as it hasn't worked properly, -- Till, 29 March 2019
;=====================================================================================
; 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 (MQ02.GetStage() >= 140) && (MQ02.GetStage() < 160) && (PlayerREF.GetWorldSpace() != Ark)
if _00E_MQ02_TravelState.GetValue() == 0
_00E_MQ02_TravelState.SetValue(1)
if !bIsStartBox
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
ElseIf _00E_MQ02_TravelState.GetValue() == 1
_00E_MQ02_TravelState.SetValue(2)
EndIf
_00E_MC_JesparREF.EvaluatePackage()
EndIf
if PlayerREF.GetWorldSpace() == Ark && MQ02.GetStage() > 140
MQ02.SetStage(160)
EndIf
Return
EndFunction
Function SendExitEvent()
If (MQ02.GetStage() >= 140) && (MQ02.GetStage() < 160)
If _00E_MQ02_TravelState.GetValue() == 1
_00E_MQ02_TravelState.SetValue(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
ElseIf _00E_MQ02_TravelState.GetValue() == 2
_00E_MQ02_TravelState.SetValue(1)
Endif
_00E_MC_JesparREF.EvaluatePackage()
EndIf
Return
EndFunction
;=====================================================================================
; PROPERTIES
;=====================================================================================
bool Property bIsStartBox = False Auto
Actor Property PlayerREF Auto
Actor Property _00E_MC_JesparREF Auto
Quest Property MQ02 Auto
GlobalVariable Property _00E_MQ02_TravelState Auto
GlobalVariable Property CompanionIsTalking Auto
Topic Property JesparDialogue_Misc_PlayerLeavesFollowTrigger Auto
Topic Property JesparDialogue_Misc_PlayerReentersFollowTrigger Auto
Worldspace Property Ark Auto
Message Property _00E_JesparEntriggerFollowNotif Auto
Message Property _00E_JesparEntriggerStopNotif Auto