4
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

42 lines
1.1 KiB

Scriptname _00E_MeditationHotkeyAlias extends ReferenceAlias Hidden
int function _GetScriptVersion() Global
return 1
endFunction
Function UpdateKeyRegistration()
if SKSE.GetVersion()
RegisterForKey(iMeditateKeycode)
endif
EndFunction
Function SetMeditateKey(int iNewMeditateKeycode)
UnregisterForKey(iMeditateKeycode)
iMeditateKeycode = iNewMeditateKeycode
UpdateKeyRegistration()
EndFunction
Event OnInit()
UpdateKeyRegistration()
EndEvent
Event OnPlayerLoadGame()
UpdateKeyRegistration()
EndEvent
Event OnKeyDown(Int KeyCode)
Spell meditateSpell = _00E_Class_Meditate.GetNthSpell(0)
Actor PlayerREF = GetReference() as Actor
If ! Utility.IsInMenuMode() && PlayerREF.HasSpell(_00E_Class_Meditate) && ! UI.IsTextInputEnabled() && ! PlayerRef.IsOnMount() && ! PlayerRef.IsSwimming() && Game.IsLookingControlsEnabled() && ! UI.IsMenuOpen("Dialogue Menu") && PlayerREF.GetCurrentLocation() != _00E_Dreamworld_Location
meditateSpell.Cast(PlayerREF, PlayerREF)
EndIf
EndEvent
Int Property iMeditateKeycode = 21 Auto ; 21 (Y on QWERTY, Z on QWERTZ)
Shout Property _00E_Class_Meditate Auto
Location Property _00E_Dreamworld_Location Auto