|
|
|
@ -23,6 +23,7 @@ Sound Property _00E_FS_DecreaseArcaneFeverM Auto |
|
|
|
|
Message Property _00E_AlchAmbrosia_sArcaneFeverDecreased Auto |
|
|
|
|
|
|
|
|
|
Actor Property PlayerRef Auto |
|
|
|
|
bool bSKSE = true |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;===================================================================================== |
|
|
|
@ -76,6 +77,11 @@ State Smoking |
|
|
|
|
|
|
|
|
|
Event OnUpdate() |
|
|
|
|
_UpdateSmoking() |
|
|
|
|
|
|
|
|
|
if ! bSKSE |
|
|
|
|
Utility.Wait(2.5) |
|
|
|
|
StopSmoking() |
|
|
|
|
endif |
|
|
|
|
EndEvent |
|
|
|
|
|
|
|
|
|
EndState |
|
|
|
@ -100,7 +106,7 @@ Int Property SMOKING_STAGE_SMOKING = 3 AutoReadOnly |
|
|
|
|
|
|
|
|
|
Float Property SMOKING_ARCANE_FEVER_REDUCE = 1.0 AutoReadOnly |
|
|
|
|
|
|
|
|
|
Int StoredCameraState = -1 |
|
|
|
|
bool bFirstPerson = true |
|
|
|
|
Armor StoredEquippedShield |
|
|
|
|
Armor StoredEquippedHelmet |
|
|
|
|
Form[] EquippedTorches |
|
|
|
@ -121,12 +127,14 @@ Function StartSmoking() |
|
|
|
|
EndFunction |
|
|
|
|
|
|
|
|
|
Function _TryStartSmoking() |
|
|
|
|
bSKSE = (SKSE.GetVersion() > 0) |
|
|
|
|
|
|
|
|
|
If TheriantrophistControlQuest.IsTransformed() |
|
|
|
|
_00E_PeaceweedSmoking_CantSmokeInWolfForm.Show() |
|
|
|
|
Return |
|
|
|
|
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() |
|
|
|
|
Return |
|
|
|
|
EndIf |
|
|
|
@ -149,12 +157,9 @@ Function _TryStartSmoking() |
|
|
|
|
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) |
|
|
|
|
|
|
|
|
|
StoredCameraState = Game.GetCameraState() |
|
|
|
|
bFirstPerson = PlayerREF.GetAnimationVariableBool("IsFirstPerson") |
|
|
|
|
Game.ForceThirdPerson() |
|
|
|
|
|
|
|
|
|
RefreshCancelKeys() |
|
|
|
|
RegisterCancelKeys() |
|
|
|
|
|
|
|
|
|
EquippedTorches = New Form[2] |
|
|
|
|
Bool bTorchesUnequipping = _00E_TorchControl.UnequipTorches(EquippedTorches) |
|
|
|
|
|
|
|
|
@ -179,7 +184,7 @@ Function _TryStartSmoking() |
|
|
|
|
SmokingStage = SMOKING_STAGE_WARMUP |
|
|
|
|
|
|
|
|
|
; 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 |
|
|
|
|
PlayerREF.UnequipItem(StoredEquippedHelmet, False, True) |
|
|
|
|
EndIf |
|
|
|
@ -191,24 +196,31 @@ Function _TryStartSmoking() |
|
|
|
|
EndIf |
|
|
|
|
|
|
|
|
|
Debug.SendAnimationEvent(PlayerRef, "IdleSitCrossLeggedEnter") |
|
|
|
|
|
|
|
|
|
Utility.Wait(1.1) |
|
|
|
|
_AdjustCameraPositionToSitting() |
|
|
|
|
If (bQuitTutorialShown == False) && (_00E_DisableOtherTutorials.GetValueInt() == 0) |
|
|
|
|
bQuitTutorialShown = True |
|
|
|
|
Message.ResetHelpMessage("Empty") |
|
|
|
|
If Game.UsingGamepad() |
|
|
|
|
If _00E_PeaceweedSmoking_ExitTutorial_Console == None |
|
|
|
|
_00E_PeaceweedSmoking_ExitTutorial_Console = Game.GetFormFromFile(0x000482F8, "Skyrim.esm") as Message |
|
|
|
|
|
|
|
|
|
if bSKSE |
|
|
|
|
RefreshCancelKeys() |
|
|
|
|
RegisterCancelKeys() |
|
|
|
|
|
|
|
|
|
If (bQuitTutorialShown == False) && (_00E_DisableOtherTutorials.GetValueInt() == 0) |
|
|
|
|
bQuitTutorialShown = True |
|
|
|
|
Message.ResetHelpMessage("Empty") |
|
|
|
|
If Game.UsingGamepad() |
|
|
|
|
If _00E_PeaceweedSmoking_ExitTutorial_Console == None |
|
|
|
|
_00E_PeaceweedSmoking_ExitTutorial_Console = Game.GetFormFromFile(0x000482F8, "Skyrim.esm") as Message |
|
|
|
|
EndIf |
|
|
|
|
_00E_PeaceweedSmoking_ExitTutorial_Console.ShowAsHelpMessage("Empty", 7, 30, 1) |
|
|
|
|
Else |
|
|
|
|
_00E_PeaceweedSmoking_ExitTutorial.ShowAsHelpMessage("Empty", 7, 30, 1) |
|
|
|
|
EndIf |
|
|
|
|
_00E_PeaceweedSmoking_ExitTutorial_Console.ShowAsHelpMessage("Empty", 7, 30, 1) |
|
|
|
|
Else |
|
|
|
|
_00E_PeaceweedSmoking_ExitTutorial.ShowAsHelpMessage("Empty", 7, 30, 1) |
|
|
|
|
EndIf |
|
|
|
|
EndIf |
|
|
|
|
|
|
|
|
|
RegisterForSingleUpdate(2.9) |
|
|
|
|
else |
|
|
|
|
RegisterForSingleUpdate(5.0) |
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
Utility.Wait(0.4) |
|
|
|
|
RegisterForSingleUpdate(2.5) |
|
|
|
|
Debug.SendAnimationEvent(PlayerRef, "pipesmokingcrossleggedstartblaze") |
|
|
|
|
Debug.SendAnimationEvent(PlayerRef, "pipesmokingcrossleggedblazed") |
|
|
|
|
EndFunction |
|
|
|
@ -249,14 +261,18 @@ Function ApplySmokingSideEffects(Ingredient peaceweedIngredient, Float fReduceFe |
|
|
|
|
EndIf |
|
|
|
|
|
|
|
|
|
; Teach ambrosia effect |
|
|
|
|
Int Index = peaceweedIngredient.getNumEffects() |
|
|
|
|
While Index > 0 |
|
|
|
|
Index -= 1 |
|
|
|
|
If peaceweedIngredient.getNthEffectMagicEffect(Index) == _00E_AlchReduceArcaneFever |
|
|
|
|
peaceweedIngredient.LearnEffect(Index) |
|
|
|
|
Index = 0 ; Break |
|
|
|
|
EndIf |
|
|
|
|
EndWhile |
|
|
|
|
if bSKSE |
|
|
|
|
Int Index = peaceweedIngredient.getNumEffects() |
|
|
|
|
While Index > 0 |
|
|
|
|
Index -= 1 |
|
|
|
|
If peaceweedIngredient.getNthEffectMagicEffect(Index) == _00E_AlchReduceArcaneFever |
|
|
|
|
peaceweedIngredient.LearnEffect(Index) |
|
|
|
|
Index = 0 ; Break |
|
|
|
|
EndIf |
|
|
|
|
EndWhile |
|
|
|
|
else |
|
|
|
|
peaceweedIngredient.LearnEffect(1) |
|
|
|
|
endif |
|
|
|
|
EndFunction |
|
|
|
|
|
|
|
|
|
Function StopSmoking() |
|
|
|
@ -296,10 +312,9 @@ Function StopSmoking() |
|
|
|
|
|
|
|
|
|
_00E_TorchControl.ReequipTorches(EquippedTorches) |
|
|
|
|
|
|
|
|
|
If StoredCameraState == 0 |
|
|
|
|
If bFirstPerson |
|
|
|
|
Game.ForceFirstPerson() |
|
|
|
|
EndIf |
|
|
|
|
StoredCameraState = -1 |
|
|
|
|
|
|
|
|
|
_00E_Meditate_Allowed.SetValueInt(1) |
|
|
|
|
EndIf |
|
|
|
@ -337,14 +352,21 @@ Float fStoredOverShoulderPosZ |
|
|
|
|
Function _SetCameraPosition(Float x, Float z) |
|
|
|
|
Utility.SetINIFloat("fOverShoulderPosX:Camera", x) |
|
|
|
|
Utility.SetINIFloat("fOverShoulderPosZ:Camera", z) |
|
|
|
|
Game.UpdateThirdPerson() |
|
|
|
|
if bSKSE |
|
|
|
|
Game.UpdateThirdPerson() |
|
|
|
|
endif |
|
|
|
|
EndFunction |
|
|
|
|
|
|
|
|
|
Function _AdjustCameraPositionToSitting() |
|
|
|
|
If bStoredCameraPositions == False |
|
|
|
|
bStoredCameraPositions = True |
|
|
|
|
fStoredOverShoulderPosX = Utility.GetINIFloat("fOverShoulderPosX:Camera") |
|
|
|
|
fStoredOverShoulderPosZ = Utility.GetINIFloat("fOverShoulderPosZ:Camera") |
|
|
|
|
if bSKSE |
|
|
|
|
fStoredOverShoulderPosX = Utility.GetINIFloat("fOverShoulderPosX:Camera") |
|
|
|
|
fStoredOverShoulderPosZ = Utility.GetINIFloat("fOverShoulderPosZ:Camera") |
|
|
|
|
else |
|
|
|
|
fStoredOverShoulderPosX = 30.0 |
|
|
|
|
fStoredOverShoulderPosZ = -10.0 |
|
|
|
|
endif |
|
|
|
|
_00E_CameraControl.LockVanityCamera() |
|
|
|
|
EndIf |
|
|
|
|
|
|
|
|
|