-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_lull_autoeffectscript.psc
55 lines (45 loc) · 1.43 KB
/
_lull_autoeffectscript.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
Scriptname _Lull_autoEffectScript extends activemagiceffect
actor myTarget
weapon myWeapon
int property clipSize auto
int clip
float property firingSpeed auto
Event OnEffectStart(Actor Target, Actor Caster)
myTarget = Target ;Target is the same as caster, generally the player.
myWeapon = myTarget.GetEquippedWeapon()
RegisterForAnimationEvent(myTarget, "BowRelease")
RegisterForAnimationEvent(myTarget, "bowDrawn")
RegisterForAnimationEvent(myTarget, "AttackStop")
EndEvent
Event OnAnimationEvent(ObjectReference akSource, string asEventName)
if (akSource == myTarget)
if asEventName == "bowDrawn"
clip = clipSize
RegisterForSingleUpdate(firingSpeed)
gotostate("firing")
else
gotostate("")
endif
endif
endEvent
Event OnUpdate()
EndEvent
state firing
Event OnUpdate() ; This event occurs every five seconds
if clip > 0
myWeapon.fire(myTarget)
clip = clip - 1
RegisterForSingleUpdate(firingSpeed)
else
Debug.SendAnimationEvent(myTarget, "AttackRelease")
endif
EndEvent
Event OnAnimationEvent(ObjectReference akSource, string asEventName)
;debug.notification(asEventName)
if (akSource == myTarget)
if asEventName != "bowDrawn"
gotostate("")
endif
endif
endEvent
endstate