2021-10-05 22:15:58 +00:00
|
|
|
scriptName _00E_MQ01_TrapDweBallistaDam extends TrapBase
|
|
|
|
;
|
|
|
|
;Dart Trap extending TrapBase
|
|
|
|
;integrated with the TrapTriggerBase
|
|
|
|
;
|
|
|
|
;================================================================
|
2021-10-05 22:22:24 +00:00
|
|
|
; SE: Removed unused lines, causing errors in the log
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
import debug
|
|
|
|
import utility
|
|
|
|
import custom
|
|
|
|
|
|
|
|
Actor property enemy1 auto
|
|
|
|
Actor property enemy2 auto
|
|
|
|
|
|
|
|
Function initialize()
|
|
|
|
|
|
|
|
endFunction
|
|
|
|
|
2021-10-05 22:22:24 +00:00
|
|
|
Function fireTrap()
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2021-10-05 22:22:24 +00:00
|
|
|
playAnimation("TriggerAll") ;fire all
|
|
|
|
WaitForAnimationEvent("FTransAll")
|
|
|
|
|
|
|
|
; A failsafe to ensure that at least one spider has been dealt with,
|
|
|
|
; as their slightly random positioning on the cell's navmesh makes
|
|
|
|
; this not easy to predict.
|
|
|
|
|
|
|
|
utility.wait(2)
|
|
|
|
if (enemy1.isDead() == 0)
|
|
|
|
if (enemy2.isDead() == 0)
|
|
|
|
; If the spiders are on the ground floor, it's the player's
|
|
|
|
; fault.
|
|
|
|
if (enemy1.getPositionZ() > -1200)
|
|
|
|
enemy1.kill()
|
|
|
|
elseif (enemy2.getPositionZ() > -1200)
|
|
|
|
enemy2.kill()
|
|
|
|
endif
|
|
|
|
endIf
|
|
|
|
endIf
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2021-10-05 22:22:24 +00:00
|
|
|
goToState("Reset")
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
endFunction
|
|
|
|
|
|
|
|
State Reset
|
|
|
|
|
|
|
|
Event OnBeginState()
|
2021-10-05 22:22:24 +00:00
|
|
|
TrapDisarmed = True
|
|
|
|
GoToState ("Disabled")
|
2021-10-05 22:15:58 +00:00
|
|
|
endEvent
|
|
|
|
|
|
|
|
Event OnActivate( objectReference activateRef )
|
|
|
|
;TRACE("Reset trigger")
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
endState
|