-
Notifications
You must be signed in to change notification settings - Fork 6
/
GUI_Script_AutoMagickaPotion.psc
41 lines (33 loc) · 1.11 KB
/
GUI_Script_AutoMagickaPotion.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
scriptName GUI_Script_AutoMagickaPotion extends activemagiceffect
gui_menumain property MainMenu auto
actor property PlayerRef auto
Event OnSpellHotCast(String eventName, String strArg, Float numArg, Form sender)
EndEvent
Event OnEffectStart(actor akTarget, actor akCaster)
RegisterForModEvent("SpellHotCast", "OnSpellHotCast")
GotoState("Neutral")
EndEvent
;-- State -------------------------------------------
state Cooldown
Event OnUpdate()
GotoState("Neutral")
EndEvent
Event onBeginState()
RegisterForSingleUpdate(MainMenu.GUI_Interval_AutoMagickaPotionCooldown)
EndEvent
endState
;-- State -------------------------------------------
state Neutral
Event OnSpellCast(Form akSpell)
if PlayerRef.GetActorValuePercentage("Magicka") < MainMenu.GUI_Interval_AutoMagickaPotion
MainMenu.equipMagickaPotion()
GotoState("Cooldown")
endIf
EndEvent
Event OnSpellHotCast(String eventName, String strArg, Float numArg, Form sender)
if PlayerRef.GetActorValuePercentage("Magicka") < MainMenu.GUI_Interval_AutoMagickaPotion
MainMenu.equipMagickaPotion()
GotoState("Cooldown")
endIf
EndEvent
endState