58 lines
1.4 KiB
Plaintext
58 lines
1.4 KiB
Plaintext
ScriptName _00E_QuickLootPatch Extends ReferenceAlias
|
|
|
|
; 2.1.4 Eddoursul: QuickLoot RE, EE, and IE compatibility
|
|
|
|
Event OnInit()
|
|
If SKSE.GetVersion() <= 0
|
|
return
|
|
EndIf
|
|
If Game.GetLightModByName("Enderal QuickLoot Patch.esp") < 65535
|
|
UnregisterForMenu("LootMenu")
|
|
return
|
|
EndIf
|
|
RegisterForMenu("LootMenu")
|
|
EndEvent
|
|
|
|
Event OnPlayerLoadGame()
|
|
OnInit()
|
|
EndEvent
|
|
|
|
Function OnMenuOpen(String MenuName)
|
|
|
|
ObjectReference lootMenuRef = Game.GetCurrentCrosshairRef()
|
|
|
|
If ! lootMenuRef
|
|
Return
|
|
EndIf
|
|
|
|
Container baseContainer = lootMenuRef.GetBaseObject() as Container
|
|
|
|
If ! baseContainer || lootMenuRef.GetActorOwner() == Player
|
|
Return
|
|
EndIf
|
|
|
|
Bool bHasSlot = _00E_ChestsWithHiddenSlots.ToArray().Find(baseContainer) >= 0
|
|
|
|
If bHasSlot || lootMenuRef.GetItemCount(Gold001) >= 5
|
|
If lootMenuRef == Game.GetCurrentCrosshairRef() && ! lootMenuRef.GetItemCount(_00E_HiddenSlotChecked) && UI.IsMenuOpen("LootMenu")
|
|
lootMenuRef.AddItem(_00E_HiddenSlotChecked, 1, True)
|
|
|
|
If bHasSlot
|
|
ContainerBonusControl.OpenHiddenSlot(lootMenuRef, True)
|
|
Else
|
|
ContainerBonusControl.IncrementGold(lootMenuRef)
|
|
EndIf
|
|
EndIf
|
|
EndIf
|
|
|
|
EndFunction
|
|
|
|
ActorBase Property Player Auto
|
|
|
|
FormList Property _00E_ChestsWithHiddenSlots Auto
|
|
|
|
MiscObject Property _00E_HiddenSlotChecked Auto
|
|
MiscObject Property Gold001 Auto
|
|
|
|
_00E_ContainerBonusControl Property ContainerBonusControl Auto
|