2021-10-05 22:15:58 +00:00
|
|
|
Scriptname _00E_Class_OpenClassMenuScript extends activemagiceffect
|
|
|
|
|
|
|
|
Import Utility
|
|
|
|
Import Game
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; EVENTS
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Event OnEffectStart(Actor TheTarget, Actor TheCaster)
|
|
|
|
If _00E_Meditate_PlayerIsTeleporting.GetValue() != 0
|
|
|
|
Return
|
|
|
|
EndIf
|
|
|
|
_00E_Meditate_PlayerIsTeleporting.SetValue(1)
|
|
|
|
|
|
|
|
Bool bDoSettleDownWait = True
|
|
|
|
|
2024-01-10 14:08:24 +00:00
|
|
|
If (MQP03.GetCurrentStageID() <= 15) && (MQP03.IsRunning())
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
_00E_Class_MenuIMODIntro.Apply()
|
|
|
|
Wait(0.5)
|
|
|
|
PlayerREF.MoveTo(MQP03_PlayerStartMarker)
|
|
|
|
PlayerREF.SetAlpha(1.0)
|
2024-01-10 14:08:24 +00:00
|
|
|
MQP03.SetCurrentStageID(20)
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
Else
|
|
|
|
|
|
|
|
if !(PlayerREF.IsInLocation(_00E_ClassMenuLocation))
|
2021-10-12 02:10:35 +00:00
|
|
|
If PlayerREF.GetRace() == _00E_Theriantrophist_PlayerWerewolfRace || _00E_Meditate_Allowed.GetValueInt() == 0
|
2021-10-05 22:15:58 +00:00
|
|
|
_00E_Meditation_sCantMeditateNow.Show()
|
|
|
|
bDoSettleDownWait = False
|
|
|
|
ElseIf PlayerREF.IsInCombat()
|
|
|
|
_00E_Meditation_sCantMeditateWithEnemies.Show()
|
|
|
|
bDoSettleDownWait = False
|
|
|
|
Else
|
|
|
|
EnterClassMenu()
|
|
|
|
EndIf
|
|
|
|
else
|
|
|
|
ExitClassMenu()
|
|
|
|
endif
|
|
|
|
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
If bDoSettleDownWait ; Give a few moments for things to settle down before allowing another teleport
|
|
|
|
Wait(0.75)
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
_00E_Meditate_PlayerIsTeleporting.SetValue(0)
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; FUNCTIONS
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Function EnterClassMenu()
|
|
|
|
|
2024-02-15 17:03:58 +00:00
|
|
|
bool bDisableFighting = SKSE.GetVersion() > 0 && ! EnderalFunctions.IsVR()
|
2024-02-08 06:45:07 +00:00
|
|
|
DisablePlayerControls(false, bDisableFighting, true, false, true, false, false, true)
|
2021-10-05 22:15:58 +00:00
|
|
|
Player.ForceRefTo(PlayerREF)
|
|
|
|
|
2024-02-13 09:02:30 +00:00
|
|
|
_00E_Meditate_FirstPerson.SetValue(PlayerREF.GetAnimationVariableBool("isFirstPerson") as float)
|
|
|
|
|
|
|
|
_00E_EquipControl.SheatheWeapon(PlayerREF)
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
Form[] equippedTorches = New Form[2]
|
2024-02-05 01:29:37 +00:00
|
|
|
_00E_TorchControl.UnequipTorches(equippedTorches)
|
2021-10-05 22:15:58 +00:00
|
|
|
|
|
|
|
_00E_RealWorldOrigin.MoveTo(playerREF)
|
|
|
|
_00E_Class_MenuMeditationSound.Play(PlayerREF)
|
|
|
|
_00E_Class_MenuIMODIntro.Apply()
|
|
|
|
Wait(0.7)
|
|
|
|
PlayerREF.MoveTo(_00E_ClassMenuOrigin)
|
|
|
|
Game.ShowFirstPersonGeometry(False)
|
2024-02-08 06:45:07 +00:00
|
|
|
DisablePlayerControls(false, bDisableFighting, true, false, true, false, false, true)
|
2021-10-05 22:15:58 +00:00
|
|
|
ForceFirstPerson()
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
Function ExitClassMenu()
|
|
|
|
|
|
|
|
_00E_Class_MenuMeditationSound.Play(PlayerREF)
|
|
|
|
_00E_Class_MenuIMODIntro.Apply()
|
|
|
|
Wait(0.7)
|
|
|
|
PlayerREF.MoveTo(_00E_RealWorldOrigin)
|
|
|
|
PlayerREF.SetAlpha(1.0)
|
|
|
|
Player.Clear()
|
|
|
|
Game.EnablePlayerControls()
|
|
|
|
Game.ShowFirstPersonGeometry(True)
|
|
|
|
If _00E_Meditate_FirstPerson.GetValueInt() == 0
|
|
|
|
Game.ForceThirdPerson()
|
|
|
|
EndIf
|
|
|
|
Game.RequestAutoSave()
|
|
|
|
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
;=====================================================================================
|
|
|
|
; PROPERTIES
|
|
|
|
;=====================================================================================
|
|
|
|
|
|
|
|
Actor Property PlayerREF Auto
|
|
|
|
ImagespaceModifier Property _00E_Class_MenuIMODIntro Auto
|
|
|
|
|
|
|
|
Quest Property MQP03 Auto
|
|
|
|
|
|
|
|
Sound Property _00E_Class_MenuMeditationSound Auto
|
|
|
|
Location property _00E_ClassMenuLocation Auto
|
|
|
|
ObjectReference Property _00E_ClassMenuOrigin Auto
|
|
|
|
ObjectReference Property _00E_RealWorldOrigin Auto
|
|
|
|
ObjectReference Property MQP03_PlayerStartMarker Auto
|
|
|
|
|
|
|
|
Message Property _00E_Meditation_sCantMeditateWithEnemies Auto
|
|
|
|
Message Property _00E_Meditation_sCantMeditateNow Auto
|
|
|
|
|
|
|
|
GlobalVariable Property _00E_Meditate_PlayerIsTeleporting Auto
|
|
|
|
GlobalVariable Property _00E_Meditate_FirstPerson Auto
|
|
|
|
GlobalVariable Property _00E_Meditate_Allowed Auto
|
|
|
|
|
|
|
|
ReferenceAlias Property Player Auto
|
2021-10-12 02:10:35 +00:00
|
|
|
|
|
|
|
Race Property _00E_Theriantrophist_PlayerWerewolfRace Auto
|