SKSE-free pipe smoking
This commit is contained in:
parent
91ca470ecf
commit
5ffd5d7e97
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,7 +1,7 @@
|
|||||||
Scriptname HealthBarManager Hidden
|
Scriptname HealthBarManager Hidden
|
||||||
|
|
||||||
function Show(Actor akActor) global
|
function Show(Actor akActor) global
|
||||||
if akActor
|
if akActor && SKSE.GetVersion()
|
||||||
int handle = ModEvent.Create("Enderal_ShowActorHealth")
|
int handle = ModEvent.Create("Enderal_ShowActorHealth")
|
||||||
if handle
|
if handle
|
||||||
ModEvent.PushForm(handle, akActor)
|
ModEvent.PushForm(handle, akActor)
|
||||||
@ -11,7 +11,7 @@ function Show(Actor akActor) global
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function Hide(Actor akActor) global
|
function Hide(Actor akActor) global
|
||||||
if akActor
|
if akActor && SKSE.GetVersion()
|
||||||
int handle = ModEvent.Create("Enderal_HideActorHealth")
|
int handle = ModEvent.Create("Enderal_HideActorHealth")
|
||||||
if handle
|
if handle
|
||||||
ModEvent.PushForm(handle, akActor)
|
ModEvent.PushForm(handle, akActor)
|
||||||
|
@ -2,21 +2,31 @@ Scriptname _00E_CameraControl Hidden
|
|||||||
|
|
||||||
Function LockVanityCamera() Global
|
Function LockVanityCamera() Global
|
||||||
|
|
||||||
|
Actor PlayerREF = Game.GetForm(0x14) as Actor
|
||||||
|
float fMinDist = 150.0
|
||||||
|
|
||||||
|
if SKSE.GetVersion()
|
||||||
float fCameraMaxDistance = Utility.GetIniFloat("fVanityModeMaxDist:Camera")
|
float fCameraMaxDistance = Utility.GetIniFloat("fVanityModeMaxDist:Camera")
|
||||||
(Game.GetForm(0x14) as Actor).SetActorValue("Variable08", fCameraMaxDistance)
|
PlayerREF.SetActorValue("Variable08", fCameraMaxDistance)
|
||||||
Utility.SetINIFloat("fVanityModeMaxDist:Camera", Utility.GetIniFloat("fVanityModeMinDist:Camera"))
|
fMinDist = Utility.GetIniFloat("fVanityModeMinDist:Camera")
|
||||||
|
else
|
||||||
|
PlayerREF.SetActorValue("Variable08", 600.0)
|
||||||
|
endif
|
||||||
|
|
||||||
|
Utility.SetINIFloat("fVanityModeMaxDist:Camera", fMinDist)
|
||||||
|
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
Function UnlockVanityCamera() Global
|
Function UnlockVanityCamera() Global
|
||||||
|
|
||||||
float fCameraMaxDistance = (Game.GetForm(0x14) as Actor).GetActorValue("Variable08")
|
Actor PlayerREF = Game.GetForm(0x14) as Actor
|
||||||
|
float fCameraMaxDistance = PlayerREF.GetActorValue("Variable08")
|
||||||
|
|
||||||
if fCameraMaxDistance <= 0
|
if fCameraMaxDistance <= 0
|
||||||
fCameraMaxDistance = 600
|
fCameraMaxDistance = 600.0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
Utility.SetINIFloat("fVanityModeMaxDist:Camera", fCameraMaxDistance)
|
Utility.SetINIFloat("fVanityModeMaxDist:Camera", fCameraMaxDistance)
|
||||||
(Game.GetForm(0x14) as Actor).SetActorValue("Variable08", 0)
|
PlayerREF.SetActorValue("Variable08", 0)
|
||||||
|
|
||||||
EndFunction
|
EndFunction
|
||||||
|
@ -190,8 +190,10 @@ State RealPlayer
|
|||||||
; Level up
|
; Level up
|
||||||
If iLevelUpsNeeded > 0
|
If iLevelUpsNeeded > 0
|
||||||
; Level up if not in combat, not in dialogue, activate controls enabled (not in a scene?) and, obviously, not dead
|
; Level up if not in combat, not in dialogue, activate controls enabled (not in a scene?) and, obviously, not dead
|
||||||
While !IsInCombat() && (SKSE.GetVersion() == 0 || UI.IsMenuOpen("Dialogue Menu") == False) && Game.IsActivateControlsEnabled() && !Player.IsDead() && (isdead == False) && (iLevelUpsNeeded > 0)
|
While !IsInCombat() && Game.IsActivateControlsEnabled() && !Player.IsDead() && (isdead == False) && (iLevelUpsNeeded > 0)
|
||||||
|
if SKSE.GetVersion() == 0 || UI.IsMenuOpen("Dialogue Menu") == False
|
||||||
levelUp()
|
levelUp()
|
||||||
|
endif
|
||||||
EndWhile
|
EndWhile
|
||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Sound Property _00E_FS_DecreaseArcaneFeverM Auto
|
|||||||
Message Property _00E_AlchAmbrosia_sArcaneFeverDecreased Auto
|
Message Property _00E_AlchAmbrosia_sArcaneFeverDecreased Auto
|
||||||
|
|
||||||
Actor Property PlayerRef Auto
|
Actor Property PlayerRef Auto
|
||||||
|
bool bSKSE = true
|
||||||
|
|
||||||
|
|
||||||
;=====================================================================================
|
;=====================================================================================
|
||||||
@ -76,6 +77,11 @@ State Smoking
|
|||||||
|
|
||||||
Event OnUpdate()
|
Event OnUpdate()
|
||||||
_UpdateSmoking()
|
_UpdateSmoking()
|
||||||
|
|
||||||
|
if ! bSKSE
|
||||||
|
Utility.Wait(2.5)
|
||||||
|
StopSmoking()
|
||||||
|
endif
|
||||||
EndEvent
|
EndEvent
|
||||||
|
|
||||||
EndState
|
EndState
|
||||||
@ -100,7 +106,7 @@ Int Property SMOKING_STAGE_SMOKING = 3 AutoReadOnly
|
|||||||
|
|
||||||
Float Property SMOKING_ARCANE_FEVER_REDUCE = 1.0 AutoReadOnly
|
Float Property SMOKING_ARCANE_FEVER_REDUCE = 1.0 AutoReadOnly
|
||||||
|
|
||||||
Int StoredCameraState = -1
|
bool bFirstPerson = true
|
||||||
Armor StoredEquippedShield
|
Armor StoredEquippedShield
|
||||||
Armor StoredEquippedHelmet
|
Armor StoredEquippedHelmet
|
||||||
Form[] EquippedTorches
|
Form[] EquippedTorches
|
||||||
@ -121,12 +127,14 @@ Function StartSmoking()
|
|||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
Function _TryStartSmoking()
|
Function _TryStartSmoking()
|
||||||
|
bSKSE = (SKSE.GetVersion() > 0)
|
||||||
|
|
||||||
If TheriantrophistControlQuest.IsTransformed()
|
If TheriantrophistControlQuest.IsTransformed()
|
||||||
_00E_PeaceweedSmoking_CantSmokeInWolfForm.Show()
|
_00E_PeaceweedSmoking_CantSmokeInWolfForm.Show()
|
||||||
Return
|
Return
|
||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
If (_00E_Meditate_Allowed.GetValueInt() == 0) || (PlayerRef.GetWorldSpace() == MQ07aDreamRealm) || PlayerRef.IsOnMount() || PlayerRef.IsSwimming() || (PlayerRef.GetSitState() != 0) || PlayerRef.IsInCombat() || PlayerREF.IsInLocation(_00E_ClassMenuLocation)
|
If (_00E_Meditate_Allowed.GetValueInt() == 0) || (PlayerRef.GetWorldSpace() == MQ07aDreamRealm) || PlayerRef.IsOnMount() || (bSKSE && PlayerRef.IsSwimming()) || (PlayerRef.GetSitState() != 0) || PlayerRef.IsInCombat() || PlayerREF.IsInLocation(_00E_ClassMenuLocation)
|
||||||
_00E_PeaceweedSmoking_CantSmokeNow.Show()
|
_00E_PeaceweedSmoking_CantSmokeNow.Show()
|
||||||
Return
|
Return
|
||||||
EndIf
|
EndIf
|
||||||
@ -149,12 +157,9 @@ Function _TryStartSmoking()
|
|||||||
Game.SetInChargen(true, true, false) ; Forbid saving the game while smoking
|
Game.SetInChargen(true, true, false) ; Forbid saving the game while smoking
|
||||||
Game.DisablePlayerControls(abMovement=true, abFighting=true, abCamSwitch=true, abLooking=false, abSneaking=true, abMenu=true, abActivate = true, abJournalTabs=true)
|
Game.DisablePlayerControls(abMovement=true, abFighting=true, abCamSwitch=true, abLooking=false, abSneaking=true, abMenu=true, abActivate = true, abJournalTabs=true)
|
||||||
|
|
||||||
StoredCameraState = Game.GetCameraState()
|
bFirstPerson = PlayerREF.GetAnimationVariableBool("IsFirstPerson")
|
||||||
Game.ForceThirdPerson()
|
Game.ForceThirdPerson()
|
||||||
|
|
||||||
RefreshCancelKeys()
|
|
||||||
RegisterCancelKeys()
|
|
||||||
|
|
||||||
EquippedTorches = New Form[2]
|
EquippedTorches = New Form[2]
|
||||||
Bool bTorchesUnequipping = _00E_TorchControl.UnequipTorches(EquippedTorches)
|
Bool bTorchesUnequipping = _00E_TorchControl.UnequipTorches(EquippedTorches)
|
||||||
|
|
||||||
@ -179,7 +184,7 @@ Function _TryStartSmoking()
|
|||||||
SmokingStage = SMOKING_STAGE_WARMUP
|
SmokingStage = SMOKING_STAGE_WARMUP
|
||||||
|
|
||||||
; Unequip armor in the HEAD slot. Will work for most closed-face helmets, I hope.
|
; Unequip armor in the HEAD slot. Will work for most closed-face helmets, I hope.
|
||||||
StoredEquippedHelmet = PlayerRef.GetWornForm(0x00000001) as Armor
|
StoredEquippedHelmet = PlayerRef.GetEquippedArmorInSlot(30) as Armor
|
||||||
If StoredEquippedHelmet
|
If StoredEquippedHelmet
|
||||||
PlayerREF.UnequipItem(StoredEquippedHelmet, False, True)
|
PlayerREF.UnequipItem(StoredEquippedHelmet, False, True)
|
||||||
EndIf
|
EndIf
|
||||||
@ -191,9 +196,13 @@ Function _TryStartSmoking()
|
|||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
Debug.SendAnimationEvent(PlayerRef, "IdleSitCrossLeggedEnter")
|
Debug.SendAnimationEvent(PlayerRef, "IdleSitCrossLeggedEnter")
|
||||||
|
|
||||||
Utility.Wait(1.1)
|
Utility.Wait(1.1)
|
||||||
_AdjustCameraPositionToSitting()
|
_AdjustCameraPositionToSitting()
|
||||||
|
|
||||||
|
if bSKSE
|
||||||
|
RefreshCancelKeys()
|
||||||
|
RegisterCancelKeys()
|
||||||
|
|
||||||
If (bQuitTutorialShown == False) && (_00E_DisableOtherTutorials.GetValueInt() == 0)
|
If (bQuitTutorialShown == False) && (_00E_DisableOtherTutorials.GetValueInt() == 0)
|
||||||
bQuitTutorialShown = True
|
bQuitTutorialShown = True
|
||||||
Message.ResetHelpMessage("Empty")
|
Message.ResetHelpMessage("Empty")
|
||||||
@ -206,9 +215,12 @@ Function _TryStartSmoking()
|
|||||||
_00E_PeaceweedSmoking_ExitTutorial.ShowAsHelpMessage("Empty", 7, 30, 1)
|
_00E_PeaceweedSmoking_ExitTutorial.ShowAsHelpMessage("Empty", 7, 30, 1)
|
||||||
EndIf
|
EndIf
|
||||||
EndIf
|
EndIf
|
||||||
|
RegisterForSingleUpdate(2.9)
|
||||||
|
else
|
||||||
|
RegisterForSingleUpdate(5.0)
|
||||||
|
endif
|
||||||
|
|
||||||
Utility.Wait(0.4)
|
Utility.Wait(0.4)
|
||||||
RegisterForSingleUpdate(2.5)
|
|
||||||
Debug.SendAnimationEvent(PlayerRef, "pipesmokingcrossleggedstartblaze")
|
Debug.SendAnimationEvent(PlayerRef, "pipesmokingcrossleggedstartblaze")
|
||||||
Debug.SendAnimationEvent(PlayerRef, "pipesmokingcrossleggedblazed")
|
Debug.SendAnimationEvent(PlayerRef, "pipesmokingcrossleggedblazed")
|
||||||
EndFunction
|
EndFunction
|
||||||
@ -249,6 +261,7 @@ Function ApplySmokingSideEffects(Ingredient peaceweedIngredient, Float fReduceFe
|
|||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
; Teach ambrosia effect
|
; Teach ambrosia effect
|
||||||
|
if bSKSE
|
||||||
Int Index = peaceweedIngredient.getNumEffects()
|
Int Index = peaceweedIngredient.getNumEffects()
|
||||||
While Index > 0
|
While Index > 0
|
||||||
Index -= 1
|
Index -= 1
|
||||||
@ -257,6 +270,9 @@ Function ApplySmokingSideEffects(Ingredient peaceweedIngredient, Float fReduceFe
|
|||||||
Index = 0 ; Break
|
Index = 0 ; Break
|
||||||
EndIf
|
EndIf
|
||||||
EndWhile
|
EndWhile
|
||||||
|
else
|
||||||
|
peaceweedIngredient.LearnEffect(1)
|
||||||
|
endif
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
Function StopSmoking()
|
Function StopSmoking()
|
||||||
@ -296,10 +312,9 @@ Function StopSmoking()
|
|||||||
|
|
||||||
_00E_TorchControl.ReequipTorches(EquippedTorches)
|
_00E_TorchControl.ReequipTorches(EquippedTorches)
|
||||||
|
|
||||||
If StoredCameraState == 0
|
If bFirstPerson
|
||||||
Game.ForceFirstPerson()
|
Game.ForceFirstPerson()
|
||||||
EndIf
|
EndIf
|
||||||
StoredCameraState = -1
|
|
||||||
|
|
||||||
_00E_Meditate_Allowed.SetValueInt(1)
|
_00E_Meditate_Allowed.SetValueInt(1)
|
||||||
EndIf
|
EndIf
|
||||||
@ -337,14 +352,21 @@ Float fStoredOverShoulderPosZ
|
|||||||
Function _SetCameraPosition(Float x, Float z)
|
Function _SetCameraPosition(Float x, Float z)
|
||||||
Utility.SetINIFloat("fOverShoulderPosX:Camera", x)
|
Utility.SetINIFloat("fOverShoulderPosX:Camera", x)
|
||||||
Utility.SetINIFloat("fOverShoulderPosZ:Camera", z)
|
Utility.SetINIFloat("fOverShoulderPosZ:Camera", z)
|
||||||
|
if bSKSE
|
||||||
Game.UpdateThirdPerson()
|
Game.UpdateThirdPerson()
|
||||||
|
endif
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
Function _AdjustCameraPositionToSitting()
|
Function _AdjustCameraPositionToSitting()
|
||||||
If bStoredCameraPositions == False
|
If bStoredCameraPositions == False
|
||||||
bStoredCameraPositions = True
|
bStoredCameraPositions = True
|
||||||
|
if bSKSE
|
||||||
fStoredOverShoulderPosX = Utility.GetINIFloat("fOverShoulderPosX:Camera")
|
fStoredOverShoulderPosX = Utility.GetINIFloat("fOverShoulderPosX:Camera")
|
||||||
fStoredOverShoulderPosZ = Utility.GetINIFloat("fOverShoulderPosZ:Camera")
|
fStoredOverShoulderPosZ = Utility.GetINIFloat("fOverShoulderPosZ:Camera")
|
||||||
|
else
|
||||||
|
fStoredOverShoulderPosX = 30.0
|
||||||
|
fStoredOverShoulderPosZ = -10.0
|
||||||
|
endif
|
||||||
_00E_CameraControl.LockVanityCamera()
|
_00E_CameraControl.LockVanityCamera()
|
||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user