Added fallbacks for EquipItemEx() and UnEquipItemEx()

This commit is contained in:
Eddoursul 2024-02-13 10:10:11 +01:00
parent 1b092ceb78
commit 1b91e81321
18 changed files with 160 additions and 49 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.

View File

@ -55,13 +55,19 @@ EndFunction
Function EnableInvisibleWall()
_00E_MC_CaliaREF.UnequipItem(Torch01, True)
Int iHand = 0
if PlayerREF.GetEquippedItemType(iHand) == 11
Form torch = PlayerREF.GetEquippedObject(iHand)
PlayerREF.UnequipItemEx(torch, GetHandSlotEx(iHand))
if SKSE.GetVersion()
Int iHand = 0
if PlayerREF.GetEquippedItemType(iHand) == 11
Form torch = PlayerREF.GetEquippedObject(iHand)
PlayerREF.UnequipItemEx(torch, GetHandSlotEx(iHand))
endif
else
; Does not work
PlayerREF.UnEquipItem(Torch01, false, true)
endif
_00E_MC_CaliaREF.RemoveItem(Torch01, 1, True)
;PlayerREF.UnEquipItem(Torch01, True)
CQC05_LoseGameTGBXREF.Enable()
EndFunction
@ -131,11 +137,17 @@ Function PlayKiss()
fPlayerScale = _00E_SetActorScale.Change(PlayerREF, 0.92)
EndIf
Int iHand = 0
if PlayerREF.GetEquippedItemType(iHand) == 11
Form torch = PlayerREF.GetEquippedObject(iHand)
PlayerREF.UnequipItemEx(torch, GetHandSlotEx(iHand))
if SKSE.GetVersion()
Int iHand = 0
if PlayerREF.GetEquippedItemType(iHand) == 11
Form torch = PlayerREF.GetEquippedObject(iHand)
PlayerREF.UnequipItemEx(torch, GetHandSlotEx(iHand))
endif
else
; Does not work
PlayerREF.UnEquipItem(Torch01, true, true)
endif
_00E_MC_CaliaREF.RemoveItem(Torch01, 1, True)
PlayerREF.EquipItem(_00E_InvisibleHelmet_Armor, false, true)
Utility.Wait(0.1)

View File

@ -127,7 +127,13 @@ Function SetUpQyraScene()
PlayerREF.MoveTo(FS_MQ18c_SC01_BedMarkerREF)
_00E_PlayerFunctions.GetSafeItemRemove().RemoveAllItemsSafeVersion(None)
PlayerREF.AddItem(_00E_EndreleanSublimeGarb_Blue, 1, true)
PlayerREF.EquipItemEx(_00E_EndreleanSublimeGarb_Blue, 1)
if SKSE.GetVersion()
PlayerREF.EquipItemEx(_00E_EndreleanSublimeGarb_Blue, 0, true)
else
PlayerREF.equipitem(_00E_EndreleanSublimeGarb_Blue, true, true)
endif
Game.SetPlayerAIDriven(True)
Game.DisablePlayerControls()
Weather.ReleaseOverride()

View File

@ -20,7 +20,12 @@ Function SetUpSC01()
FS_NQR02_TharaelREF.MoveTo(FS_NQR02_SC01_TharaelMarker)
FS_NQR02_TharaelREF.SetAlpha(1.0)
FS_NQR02_TharaelREF.SetOutfit(_00E_FeinlederrstungCowl)
FS_NQR02_TharaelREF.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 1, true)
if SKSE.GetVersion()
FS_NQR02_TharaelREF.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 1, true)
else
FS_NQR02_TharaelREF.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
endif
EndFunction
@ -160,7 +165,13 @@ EndFunction
Function SetUpSC06()
_00E_Func_SetNPCAsCompanion.SetNPCAsCompanion(FS_NQR02_TharaelREF, False)
FS_NQR02_TharaelREF.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 1, true)
if SKSE.GetVersion()
FS_NQR02_TharaelREF.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 1, true)
else
FS_NQR02_TharaelREF.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
endif
SetObjectiveCompleted(30)
SetObjectiveDisplayed(35)
FS_NQR02_SC06_QalianConfrontation.ForceStart()

View File

@ -235,8 +235,15 @@ Function StopSpecialAttack()
_00E_FS_NQR05_TharaelSpecialAttackOngoing.SetValueInt(0)
FS_NQR05_TharaelREF.UnequipItem(_00E_FS_NQR05_TharaelSpectralBow)
FS_NQR05_TharaelREF.RemoveItem(_00E_FS_NQR05_TharaelSpectralBow, 1)
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, False)
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 0, False)
if SKSE.GetVersion()
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, False)
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 0, False)
else
FS_NQR05_TharaelREF.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
FS_NQR05_TharaelREF.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
endif
objLight.Disable()
FS_NQR05_TharaelREF.Reset()
FS_NQR05_TharaelREF.DamageActorValue("Health", fDamageDone)

View File

@ -632,11 +632,19 @@ Function StartSC15()
_00E_Func_SetNPCAsCompanion.SetNPCAsCompanion(FS_NQR05_ZaraahREF, False)
_00E_Func_SetNPCAsCompanion.SetNPCAsCompanion(FS_NQR05_TharaelREF, False)
FS_NQR05_ZaraahREF.BlockActivation(true)
FS_NQR05_ZaraahREF.UnequipItemEx(_00E_FS_NQR05_ZarAhSabre, 0)
FS_NQR05_ZaraahREF.UnequipItemEx(_00E_FS_NQR05_ZarAhSabre, 1)
FS_NQR05_ZaraahREF.UnequipItemEx(_00E_FS_NQR05_ZarAhSabre, 2)
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, True)
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 2, True)
if SKSE.GetVersion()
FS_NQR05_ZaraahREF.UnequipItemEx(_00E_FS_NQR05_ZarAhSabre, 0)
FS_NQR05_ZaraahREF.UnequipItemEx(_00E_FS_NQR05_ZarAhSabre, 1)
FS_NQR05_ZaraahREF.UnequipItemEx(_00E_FS_NQR05_ZarAhSabre, 2)
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, True)
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 2, True)
else
FS_NQR05_ZaraahREF.UnequipItem(_00E_FS_NQR05_ZarAhSabre, true, true)
FS_NQR05_TharaelREF.UnequipItem(_00E_FS_NQR05_Tharael_Dagger, true, true)
FS_NQR05_TharaelREF.UnequipItem(_00E_FS_NQR05_Tharael_Dagger, true, true)
endif
FS_NQR05_SC15_Temple_04.ForceStart()
EndFunction
@ -835,9 +843,15 @@ Function TharaelSwitchToWeaponSet(String sWeaponType = "Daggers")
; gets also called from other script fragments
If sWeaponType == "Bow"
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 0, True)
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, True)
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 2, True)
if SKSE.GetVersion()
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 0, True)
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, True)
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 2, True)
else
FS_NQR05_TharaelREF.UnequipItem(_00E_FS_NQR05_Tharael_Dagger, true, true)
FS_NQR05_TharaelREF.UnequipItem(_00E_FS_NQR05_Tharael_Dagger, true, true)
endif
FS_NQR05_TharaelREF.equipitem(_00E_FS_NQR_TharaelsBow, true, true)
FS_NQR05_TharaelREF.AddItem(_00E_FS_NQR_TharaelsArrows, 55, true)
@ -845,9 +859,15 @@ Function TharaelSwitchToWeaponSet(String sWeaponType = "Daggers")
FS_NQR05_TharaelREF.unequipitem(_00E_FS_NQR_TharaelsBow, true, true)
FS_NQR05_TharaelREF.RemoveItem(_00E_FS_NQR_TharaelsArrows, 55, true)
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 0, True)
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, True)
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 2, True)
if SKSE.GetVersion()
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 0, True)
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, True)
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 2, True)
else
FS_NQR05_TharaelREF.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
FS_NQR05_TharaelREF.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
endif
Else
@ -859,8 +879,13 @@ Function TharaelSwitchToWeaponSet(String sWeaponType = "Daggers")
Else
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, True)
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 2, True)
if SKSE.GetVersion()
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, True)
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 2, True)
else
FS_NQR05_TharaelREF.UnequipItem(_00E_FS_NQR05_Tharael_Dagger, true, true)
FS_NQR05_TharaelREF.UnequipItem(_00E_FS_NQR05_Tharael_Dagger, true, true)
endif
EndIf
@ -1118,10 +1143,17 @@ EndFunction
Function TharaelReequipDaggers()
;To avoid "weapons stuck"
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, True)
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 2, True)
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, True)
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 2, True)
if SKSE.GetVersion()
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, True)
FS_NQR05_TharaelREF.unequipitemex(_00E_FS_NQR05_Tharael_Dagger, 2, True)
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, True)
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 2, True)
else
FS_NQR05_TharaelREF.UnequipItem(_00E_FS_NQR05_Tharael_Dagger, true, true)
FS_NQR05_TharaelREF.UnequipItem(_00E_FS_NQR05_Tharael_Dagger, true, true)
FS_NQR05_TharaelREF.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
FS_NQR05_TharaelREF.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
endif
EndFunction
@ -1131,8 +1163,13 @@ Function TharaelEquipDaggers()
FS_NQR05_TharaelREF.additem(_00E_FS_NQR05_Tharael_Dagger, 2)
EndIf
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, True)
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 2, True)
if SKSE.GetVersion()
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 1, True)
FS_NQR05_TharaelREF.equipitemex(_00E_FS_NQR05_Tharael_Dagger, 2, True)
else
FS_NQR05_TharaelREF.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
FS_NQR05_TharaelREF.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
endif
EndFunction

View File

@ -74,8 +74,14 @@ Function ActivateJespar()
_00E_MC_JesparRef.Enable()
_00E_MC_JesparRef.MoveTo(MQ11bJesparPortMarker)
_00E_MC_JesparRef.EquipItemEx(_01E_02Eisendolch, 1, True)
_00E_MC_JesparRef.EquipItemEx(_01E_02Eisendolch, 2, True)
if SKSE.GetVersion()
_00E_MC_JesparRef.EquipItemEx(_01E_02Eisendolch, 1, True)
_00E_MC_JesparRef.EquipItemEx(_01E_02Eisendolch, 2, True)
else
_00E_MC_JesparRef.equipitem(_01E_02Eisendolch, true, true)
_00E_MC_JesparRef.equipitem(_01E_02Eisendolch, true, true)
endif
EndFunction

View File

@ -97,12 +97,22 @@ Function Prepare()
FS_NQR01_Cinematic_Stage_01.SetValueInt(1)
_00E_NQR01_Battle05_Parent.Enable()
_00E_SC_TharaelREF.Enable()
FS_NQR01_Cinematic_Fake_Tharael_01.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 1, true)
FS_NQR01_Cinematic_Fake_Tharael_01.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 2, true)
FS_NQR01_Cinematic_Fake_Tharael_02.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 1, true)
FS_NQR01_Cinematic_Fake_Tharael_02.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 2, true)
_00E_SC_TharaelREF.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 1, true)
_00E_SC_TharaelREF.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 2, true)
if SKSE.GetVersion()
FS_NQR01_Cinematic_Fake_Tharael_01.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 1, true)
FS_NQR01_Cinematic_Fake_Tharael_01.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 2, true)
FS_NQR01_Cinematic_Fake_Tharael_02.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 1, true)
FS_NQR01_Cinematic_Fake_Tharael_02.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 2, true)
_00E_SC_TharaelREF.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 1, true)
_00E_SC_TharaelREF.EquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 2, true)
else
FS_NQR01_Cinematic_Fake_Tharael_01.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
FS_NQR01_Cinematic_Fake_Tharael_01.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
FS_NQR01_Cinematic_Fake_Tharael_02.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
FS_NQR01_Cinematic_Fake_Tharael_02.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
_00E_SC_TharaelREF.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
_00E_SC_TharaelREF.equipitem(_00E_FS_NQR05_Tharael_Dagger, true, true)
endif
FS_NQR01_Cinematic_Fake_Tharael_01.Enable()
FS_NQR01_Cinematic_Fake_Tharael_02.Enable()
@ -656,8 +666,14 @@ EndFunction
Function GiveRewardEXP(bool bDeclined)
_00E_SC_TharaelREF.UnEquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 1, true)
_00E_SC_TharaelREF.UnEquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 2, true)
if SKSE.GetVersion()
_00E_SC_TharaelREF.UnEquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 1, true)
_00E_SC_TharaelREF.UnEquipItemEx(_00E_FS_NQR05_Tharael_Dagger, 2, true)
else
_00E_SC_TharaelREF.UnequipItem(_00E_FS_NQR05_Tharael_Dagger, true, true)
_00E_SC_TharaelREF.UnequipItem(_00E_FS_NQR05_Tharael_Dagger, true, true)
endif
_00E_PlayerFunctions.GetSoundControl().RemoveSilence()
_00E_PlayerFunctions.GetSoundControl().RemoveCombatSoundtracks()
AllowIdleChatter.SetValue(1)

View File

@ -165,13 +165,21 @@ Function equipeItems()
if whatKindRight == 2
PlayerRef.EquipSpell(EquippedItemRight as Spell, 1)
elseif PlayerRef.GetItemCount(EquippedItemRight) > 0
PlayerRef.EquipItemEx(EquippedItemRight,1 )
if SKSE.GetVersion()
PlayerRef.EquipItemEx(EquippedItemRight, 1)
else
PlayerRef.equipitem(EquippedItemRight, false, true)
endif
endif
if whatKindLeft == 2
PlayerRef.EquipSpell(EquippedItemLeft as Spell, 0)
elseif PlayerRef.GetItemCount(EquippedItemLeft) > 0
PlayerRef.EquipItemEx(EquippedItemLeft,2 )
if SKSE.GetVersion()
PlayerRef.EquipItemEx(EquippedItemLeft, 2)
else
PlayerRef.equipitem(EquippedItemLeft, false, true)
endif
endif
Int index = wornArmor.length

View File

@ -76,12 +76,20 @@ Function equipeItems()
If whatKindRight == 2
PlayerRef.EquipSpell(EquippedItemRight as Spell, 1)
Else
PlayerRef.EquipItemEx(EquippedItemRight, 1, False, True)
if SKSE.GetVersion()
PlayerRef.EquipItemEx(EquippedItemRight, 1, False, True)
else
PlayerRef.EquipItem(EquippedItemRight, False, True)
endif
EndIf
If whatKindLeft == 2
PlayerRef.EquipSpell(EquippedItemLeft as Spell, 0)
Else
PlayerRef.EquipItemEx(EquippedItemLeft, 2, False, True)
if SKSE.GetVersion()
PlayerRef.EquipItemEx(EquippedItemLeft, 2, False, True)
else
PlayerRef.EquipItem(EquippedItemLeft, False, True)
endif
EndIf
If armor1
Game.GetPlayer().EquipItem(armor1 as Form, False, True)