forked from Rukan/Grimy-Skyrim-Papyrus-Source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUI_Script_AutoStaminaPotion.psc
40 lines (34 loc) · 1.13 KB
/
GUI_Script_AutoStaminaPotion.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
scriptName GUI_Script_AutoStaminaPotion extends activemagiceffect
actor property PlayerRef auto
gui_menumain property MainMenu auto
Event OnEffectStart(actor akTarget, actor akCaster)
self.RegisterForActorAction(0)
self.RegisterForAnimationEvent(PlayerRef, "SoundPlay.NPCHumanCombatShieldBash")
self.GotoState("Neutral")
EndEvent
state Cooldown
Event onBeginState()
RegisterForSingleUpdate(MainMenu.GUI_Interval_AutoStaminaPotionCooldown)
EndEvent
Event OnUpdate()
GotoState("Neutral")
EndEvent
endState
state Neutral
Event OnAnimationEvent(objectreference akSource, String asEventName)
if akSource == PlayerRef && asEventName == "SoundPlay.NPCHumanCombatShieldBash"
if PlayerRef.GetActorValuePercentage("Stamina") < MainMenu.GUI_Interval_AutoStaminaPotion
MainMenu.equipStaminaPotion()
GotoState("Cooldown")
endIf
endIf
EndEvent
Event OnActorAction(Int actionType, actor akActor, Form source, Int slot)
if actionType == 0
if PlayerRef.GetActorValuePercentage("Stamina") < MainMenu.GUI_Interval_AutoStaminaPotion
MainMenu.equipStaminaPotion()
GotoState("Cooldown")
endIf
endIf
EndEvent
endState