Added fallback for SheatheWeapon()

This commit is contained in:
Eddoursul 2024-02-13 10:02:30 +01:00
parent c04bfd830d
commit 1b092ceb78
32 changed files with 50 additions and 68 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -6,10 +6,7 @@ Function TeleportPlayer(ObjectReference TeleportTarget)
Game.DisablePlayerControls(abCamSwitch = true)
Wait(3)
If PlayerREF.IsWeaponDrawn()
PlayerREF.SheatheWeapon()
EndIf
Wait(2)
_00E_EquipControl.SheatheWeapon(PlayerREF)
TeleportIn()
PlayerREF.MoveTo(TeleportTarget)
TeleportOut()

View File

@ -59,17 +59,10 @@ Function EnterClassMenu()
bool bDisableFighting = (SKSE.GetVersion() > 0)
DisablePlayerControls(false, bDisableFighting, true, false, true, false, false, true)
Player.ForceRefTo(PlayerREF)
Bool isFirstPerson = False
isFirstPerson = PlayerREF.GetAnimationVariableBool("IsFirstPerson")
If isFirstPerson == true
_00E_Meditate_FirstPerson.SetValueInt(1)
Else
_00E_Meditate_FirstPerson.SetValueInt(0)
EndIf
if PlayerREF.IsWeaponDrawn()
PlayerREF.SheatheWeapon()
EndIf
_00E_Meditate_FirstPerson.SetValue(PlayerREF.GetAnimationVariableBool("isFirstPerson") as float)
_00E_EquipControl.SheatheWeapon(PlayerREF)
Form[] equippedTorches = New Form[2]
_00E_TorchControl.UnequipTorches(equippedTorches)

View File

@ -66,9 +66,7 @@ Function PlayKissAnimation()
Game.SetPlayerAIDriven(True)
Game.DisablePlayerControls(true, true, true, false, true, true, true, true)
If PlayerREF.IsWeaponDrawn()
PlayerREF.SheatheWeapon()
EndIf
_00E_EquipControl.SheatheWeapon(PlayerREF)
Utility.Wait(0.5)
@ -146,9 +144,7 @@ EndFunction
Function GetIntoPosition()
If PlayerREF.IsWeaponDrawn()
PlayerREF.SheatheWeapon()
EndIf
_00E_EquipControl.SheatheWeapon(PlayerREF)
EndFunction

View File

@ -61,9 +61,7 @@ EndFunction
Function StartMemory1()
_00E_FS_NQ03_SpiritActorREF.Enable()
If PlayerREF.IsWeaponDrawn()
PlayerREF.SheatheWeapon()
EndIf
_00E_EquipControl.SheatheWeapon(PlayerREF)
OBJEyeofMagnusVanishM.Play(PlayerREF)
_00E_MQ07a_WordOfTheDeadTransformSpiritM.Play(PlayerREF)
_00E_FS_NQ03_ShockApply.Apply()
@ -224,14 +222,18 @@ EndFunction
Function PlayCommentLetter()
PlayerRef.SheatheWeapon()
wait(0.1)
_00E_EquipControl.SheatheWeapon(PlayerREF)
;_00E_FS_NQ03_ReadNoteMarker.Enable()
SetObjectiveCompleted(60)
Game.ForceThirdPerson()
Game.SetPlayerAIDriven(True)
Game.DisablePlayerControls()
PlayerREF.UnequipItem(PlayerREF.GetEquippedObject(0))
if PlayerREF.GetEquippedWeapon(true)
PlayerREF.UnequipItem(PlayerREF.GetEquippedWeapon(true))
endif
wait(0.5)
PlayerREF.PlayIdle(IdleNoteRead)
FS_NQ03_SC17_CommentLetter.ForceStart()
@ -298,7 +300,8 @@ Function PlayerSheatheWeapon()
SetObjectiveCompleted(70)
endif
PlayerRef.SheatheWeapon()
_00E_EquipControl.SheatheWeapon(PlayerREF)
Game.EnablePlayerControls()
Game.SetPlayerAIDriven(False)
SetObjectiveDisplayed(95)

View File

@ -7,7 +7,7 @@ Event OnTriggerEnter(ObjectReference akActionRef)
PlayerREF.AddItem(GasTrapDummy, 1, 1)
PlayerREF.EquipItem(GasTrapDummy, 0, 1)
Utility.Wait(1)
PlayerREF.SheatheWeapon()
_00E_EquipControl.SheatheWeapon(PlayerREF)
PlayerREF.RemoveItem(GasTrapDummy, 1, 1)
Self.Disable()
EndIf

View File

@ -81,7 +81,7 @@ Function CastSpecialAttack()
FS_NQR05_TharaelREF.Say(FS_NQR05_D99_TharaelLaunch_BossfightTopic)
FS_NQR05_FatherREF.SetGhost(True)
_00E_FS_NQR05_TharaelSpecialAttackOngoing.SetValueInt(1)
FS_NQR05_FatherREF.SheatheWeapon()
_00E_EquipControl.SheatheWeapon(FS_NQR05_FatherREF)
FS_NQR05_FatherREF.StopCombat()
FS_NQR05_FatherREF.StopCombatAlarm()
FS_NQR05_FatherREF.EvaluatePackage()

View File

@ -48,10 +48,7 @@ EndFunction
function EndHeadache()
If PlayerREF.IsWeaponDrawn()
PlayerREF.SheatheWeapon()
Utility.Wait(3)
EndIf
_00E_EquipControl.SheatheWeapon(PlayerREF)
PlayerREF.RestoreActorValue("Health", PlayerREF.GetActorValue("Health"))
_00E_NPCUncorkPotionAndDrinkM.Play(PlayerREF)

View File

@ -302,10 +302,8 @@ EndFunction
Function StartMemory()
If PlayerREF.IsWeaponDrawn()
PlayerREF.SheatheWeapon()
EndIf
_00E_EquipControl.SheatheWeapon(PlayerREF)
OBJEyeofMagnusVanishM.Play(PlayerREF)
_00E_MQ07a_WordOfTheDeadTransformSpiritM.Play(PlayerREF)
_00E_MQ07a_WordOfTheDeadTransformIMOD.Apply()
@ -630,7 +628,7 @@ Function EndDream()
MQ07a_ZuraREF.Kill(MQ07a_ZuraREF)
PlayerREF.DispelSpell(_00E_MQ07a_MageIceSpike)
PlayerREF.DispelSpell(_00E_MQ07a_MageIceSTorm)
PlayerREF.SheatheWeapon() ; Needed for the player to lay down in the bed in SC11
_00E_EquipControl.SheatheWeapon(PlayerREF) ; Needed for the player to lay down in the bed in SC11
weap = PlayerREF.GetEquippedWeapon(0)
If weap
PlayerREF.UnEquipItem(weap, abSilent = True)

View File

@ -7,7 +7,7 @@ Event OnTriggerEnter(ObjectReference akActionRef)
PlayerREF.AddItem(GasTrapDummy, 1, 1)
PlayerREF.EquipItem(GasTrapDummy, 0, 1)
Utility.Wait(1)
PlayerREF.SheatheWeapon()
_00E_EquipControl.SheatheWeapon(PlayerREF)
PlayerREF.RemoveItem(GasTrapDummy, 1, 1)
Self.Disable()
EndIf

View File

@ -234,7 +234,8 @@ Function StartSC04()
MQ13c_SC03_SteelbirdREF.StopCombat()
akCompanionRomance.StopCombat()
akCompanionRomance.StopCombatAlarm()
akCompanionRomance.SheatheWeapon()
_00E_EquipControl.SheatheWeapon(akCompanionRomance)
if akCompanionRomance.GetDistance(PlayerREF) >= 200
akCompanionRomance.MoveTo(MQ13c_SC04_CompMarker)

View File

@ -263,7 +263,7 @@ EndFunction
Function TealorSheatheWeapon()
akTealor.SheatheWeapon()
_00E_EquipControl.SheatheWeapon(akTealor)
EndFunction

View File

@ -4,10 +4,9 @@ Event OnActivate(ObjectReference akActionRef)
if MQ17.GetCurrentStageID() == 55
if Game.GetPlayer().IsWeaponDrawn()
Game.GetPlayer().SheatheWeapon()
Utility.Wait(4)
EndIf
if _00E_EquipControl.SheatheWeapon(Game.GetPlayer())
Utility.Wait(2.5)
endif
QSTOculoryRingM.Play(Self)
MQ17.SetCurrentStageID(60)

View File

@ -234,10 +234,7 @@ EndFunction
Function TrapPlayer()
If PlayerREF.IsWeaponDrawn()
PlayerREF.SheatheWeapon()
EndIf
_00E_EquipControl.SheatheWeapon(PlayerREF)
_00E_Func_AIWalk.PlayerAIWalk(False)
Game.ForceThirdPerson()
Game.DisablePlayerControls(True, True, True, True, True, True, True)
@ -353,7 +350,7 @@ Function StartFight()
Game.SetHudCartMode(False)
MQ17_Generator_Left_REF003.SetMotionType(4)
MQ17_Generator_Right_REF003.SetMotionType(4)
akCompanion.SheatheWeapon()
_00E_EquipControl.SheatheWeapon(akCompanion)
akCompanion.UnequipItem(_02E_11Eichenbogen)
akCompanion.RemoveItem(_02E_11Eichenbogen)
akCompanion.RemoveItem(_00E_MQ11a_SC12_FireArrows)
@ -492,9 +489,7 @@ EndFunction
Function PlayKiss()
If PlayerREF.IsWeaponDrawn()
PlayerREF.SheatheWeapon()
EndIf
_00E_EquipControl.SheatheWeapon(PlayerREF)
PlayerREF.UnequipItem(PlayerREF.GetEquippedShield())

View File

@ -127,10 +127,10 @@ endfunction
Function CallFlightAnimation(Actor akMyrad)
FadeToBlackAndBackQuick.Apply()
If (PlayerREF as Actor).IsWeaponDrawn()
(PlayerREF as Actor).SheatheWeapon()
EndIf
_00E_EquipControl.SheatheWeapon(PlayerREF as Actor)
Wait(0.75)
ObjectReference objTakeOffMarker = akMyrad.GetLinkedRef(_00E_FS_MyradTakeOffMarker)
akMyrad.MoveTo(objTakeOffMarker)
akMyrad.SetScale(1)

View File

@ -223,9 +223,7 @@ Function RemovePotion()
_00E_SC_Mael.StopCombatAlarm()
_00E_SC_Mael.SetCrimeFaction(A_CrimeFaction)
PlayerREF.RemoveItem(_00E_NQ_G_07_PetrifiedPotion, 1)
If PlayerREF.IsWeaponDrawn()
PlayerREF.SheatheWeapon()
EndIf
_00E_EquipControl.SheatheWeapon(PlayerREF)
EndFunction
@ -1057,14 +1055,22 @@ Function RemoveFromFactions()
_00E_SC_DijaamOnelys.RemoveFromAllFactions()
_00E_SC_Mael.RemoveFromAllFactions()
If _00E_SC_DijaamOnelys.GetEquippedObject(0) != NONE
_00E_SC_DijaamOnelys.UnequipItem(_00E_SC_DijaamOnelys.GetEquippedObject(0))
If _00E_SC_DijaamOnelys.GetEquippedWeapon(true)
_00E_SC_DijaamOnelys.UnequipItem(_00E_SC_DijaamOnelys.GetEquippedWeapon(true))
EndIf
If _00E_SC_DijaamOnelys.GetEquippedObject(1) != NONE
_00E_SC_DijaamOnelys.UnequipItem(_00E_SC_DijaamOnelys.GetEquippedObject(1))
If _00E_SC_DijaamOnelys.GetEquippedWeapon(false)
_00E_SC_DijaamOnelys.UnequipItem(_00E_SC_DijaamOnelys.GetEquippedWeapon(false))
EndIf
If _00E_SC_DijaamOnelys.GetEquippedSpell(0)
_00E_SC_DijaamOnelys.UnequipSpell(_00E_SC_DijaamOnelys.GetEquippedSpell(0), 0)
EndIf
If _00E_SC_DijaamOnelys.GetEquippedSpell(1)
_00E_SC_DijaamOnelys.UnequipSpell(_00E_SC_DijaamOnelys.GetEquippedSpell(1), 1)
EndIf
EndFunction
Function CleanSounds()
@ -1531,9 +1537,7 @@ Function SetupAndStartSC07D()
_00E_SC_DijaamOnelys.RemoveItem(_00e_Calia_Necklace, 1)
_00E_SC_DijaamOnelys.MoveTo(_00E_NQ_G_07Dijaam_DijaamSitMarker)
PlayerREF.MoveTo(_00E_NQ_G_07Dijaam_PlayerHideoutStandMarker)
If PlayerREF.IsWeaponDrawn()
PlayerREF.SheatheWeapon()
EndIf
_00E_EquipControl.SheatheWeapon(PlayerREF)
_00E_NQ_G_07Dijaam_ScarabREF.SetMotionType(4)
EndFunction

View File

@ -165,8 +165,7 @@ Function _TryStartSmoking()
If PlayerRef.IsWeaponDrawn()
_UnlockSmokingStage()
PlayerRef.SheatheWeapon()
Utility.Wait(2.0)
_00E_EquipControl.SheatheWeapon(PlayerREF)
_LockSmokingStage()
If SmokingStage != SMOKING_STAGE_PREPARING ; The smoking was cancelled while we were waiting
Return