enderalse/source/scripts/_00e_mq11a_sc20_zombietriggerscript.psc

33 lines
740 B
Plaintext

Scriptname _00E_MQ11a_SC20_ZombieTriggerScript extends ObjectReference
Actor Property PlayerRef Auto
_00E_MQ11a_Functions Property MQ11a Auto
Bool bDone = False
Event OnTriggerEnter(ObjectReference triggerRef)
If triggerRef == PlayerRef
TryActivateFight()
EndIf
EndEvent
Event OnActivate(ObjectReference triggerRef)
If (bDone == False) && (triggerRef as Actor) ; Probably activated by one of the zombies on entering combat
TryActivateFight()
EndIf
EndEvent
Function TryActivateFight()
Int mq11aStage = MQ11a.GetCurrentStageID()
If mq11aStage == 125
If (bDone == False)
bDone = True
MQ11a.PreparePortcullisFight()
Self.Disable()
EndIf
ElseIf mq11aStage > 125
bDone = True
Self.Disable()
EndIf
EndFunction