-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINEQ_RuneBashProximity.psc
60 lines (46 loc) · 2.3 KB
/
INEQ_RuneBashProximity.psc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Scriptname INEQ_RuneBashProximity extends ObjectReference Hidden
{Reports to the runebash ability whether this attached trigger box is occupied}
;=========================================== Properties ===========================================================================>
;========================================== Autoreadonly ==========================================================================>
float Property WaitForTrigger = 0.15 Autoreadonly
;=========================================== Variables ============================================================================>
INEQ_RuneBash BashAbility
ObjectReference BoxRef
;===============================================================================================================================
;==================================== States ================================================
;================================================================================================
auto state Ready
; If box is occupied, go to the inert state and delete the box unless its the player
Event OnTriggerEnter(ObjectReference triggerRef)
;Debug.Notification("OnTriggerEnter time: " + (Utility.getCurrentRealTime() - gametime))
if triggerRef != BoxRef
GoToState("Triggered")
else
;Debug.Notification("player in box")
endif
EndEvent
; If box is unoccupied before the timer expires, tell the ability to cast the spell
Event OnUpdate()
BashAbility.castRune()
Disable()
Delete()
EndEvent
endstate
;___________________________________________________________________________________________________________________________
State Triggered
Event OnBeginState()
Disable()
Delete()
EndEvent
EndState
;===============================================================================================================================
;==================================== Functions ================================================
;================================================================================================
; Used by INEQ_RuneBash to start checking for occumants in the trigger box
function register(INEQ_RuneBash akBashability, ObjectReference akBoxRef)
BashAbility = akBashability
BoxRef = akBoxRef
;gametime = Utility.getCurrentRealTime()
RegisterForSingleUpdate(WaitForTrigger)
Enable()
EndFunction