Optimized ingredient tracking in The Elixir
This commit is contained in:
parent
d35571ca5e
commit
ccdd1b20a4
BIN
OnItemAdded Optimization.esp
Normal file
BIN
OnItemAdded Optimization.esp
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -48,6 +48,13 @@ Function UpdateGlobals()
|
|||||||
ModObjectiveGlobal(0, _00E_FS_NQ05_MothWingMonarchCountGlobal, 38, 1, true, true, false)
|
ModObjectiveGlobal(0, _00E_FS_NQ05_MothWingMonarchCountGlobal, 38, 1, true, true, false)
|
||||||
ModObjectiveGlobal(0, _00E_FS_NQ05_VynrootCountGlobal, 39, 1, true, true, false)
|
ModObjectiveGlobal(0, _00E_FS_NQ05_VynrootCountGlobal, 39, 1, true, true, false)
|
||||||
|
|
||||||
|
ReferenceAlias PlayerAlias = Self.GetAlias(6) as ReferenceAlias
|
||||||
|
PlayerAlias.ForceRefTo(PlayerREF)
|
||||||
|
PlayerAlias.AddInventoryEventFilter(SkeeverTail)
|
||||||
|
PlayerAlias.AddInventoryEventFilter(Garlic)
|
||||||
|
PlayerAlias.AddInventoryEventFilter(MothWingMonarch)
|
||||||
|
PlayerAlias.AddInventoryEventFilter(Vynroot)
|
||||||
|
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
Function TestFunction() ;DELETE FOR RELEASE
|
Function TestFunction() ;DELETE FOR RELEASE
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
Scriptname _00E_FS_NQ05_PlayerAlias extends ReferenceAlias
|
Scriptname _00E_FS_NQ05_PlayerAlias extends ReferenceAlias
|
||||||
|
|
||||||
Event OnInit()
|
Event OnInit()
|
||||||
|
AddInventoryEventFilter(_00E_EmptyFormlist)
|
||||||
|
|
||||||
|
If FS_NQ05.GetStage() == 35 ; version update
|
||||||
AddInventoryEventFilter(SkeeverTail)
|
AddInventoryEventFilter(SkeeverTail)
|
||||||
AddInventoryEventFilter(Garlic)
|
AddInventoryEventFilter(Garlic)
|
||||||
AddInventoryEventFilter(MothWingMonarch)
|
AddInventoryEventFilter(MothWingMonarch)
|
||||||
AddInventoryEventFilter(Vynroot)
|
AddInventoryEventFilter(Vynroot)
|
||||||
|
endif
|
||||||
|
|
||||||
_00E_FS_NQ05_GarlicCountGlobal.Value = PlayerREF.GetItemCount(Garlic)
|
_00E_FS_NQ05_GarlicCountGlobal.Value = PlayerREF.GetItemCount(Garlic)
|
||||||
_00E_FS_NQ05_MothWingMonarchCountGlobal.Value = PlayerREF.GetItemCount(MothWingMonarch)
|
_00E_FS_NQ05_MothWingMonarchCountGlobal.Value = PlayerREF.GetItemCount(MothWingMonarch)
|
||||||
@ -20,13 +24,12 @@ EndEvent
|
|||||||
Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
|
Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
|
||||||
|
|
||||||
If FS_NQ05.GetStage() != 35
|
If FS_NQ05.GetStage() != 35
|
||||||
If FS_NQ05.GetStage() > 35
|
AddInventoryEventFilter(_00E_EmptyFormlist) ; in case clearing fails
|
||||||
if akBaseItem != SkeeverTail ; keep the rarest item as filter
|
|
||||||
RemoveInventoryEventFilter(Garlic)
|
RemoveInventoryEventFilter(Garlic)
|
||||||
RemoveInventoryEventFilter(MothWingMonarch)
|
RemoveInventoryEventFilter(MothWingMonarch)
|
||||||
RemoveInventoryEventFilter(Vynroot)
|
RemoveInventoryEventFilter(Vynroot)
|
||||||
endif
|
RemoveInventoryEventFilter(SkeeverTail)
|
||||||
endif
|
Self.Clear()
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -55,13 +58,12 @@ EndEvent
|
|||||||
Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
|
Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
|
||||||
|
|
||||||
If FS_NQ05.GetStage() != 35
|
If FS_NQ05.GetStage() != 35
|
||||||
If FS_NQ05.GetStage() > 35
|
AddInventoryEventFilter(_00E_EmptyFormlist) ; in case clearing fails
|
||||||
if akBaseItem != SkeeverTail
|
|
||||||
RemoveInventoryEventFilter(Garlic)
|
RemoveInventoryEventFilter(Garlic)
|
||||||
RemoveInventoryEventFilter(MothWingMonarch)
|
RemoveInventoryEventFilter(MothWingMonarch)
|
||||||
RemoveInventoryEventFilter(Vynroot)
|
RemoveInventoryEventFilter(Vynroot)
|
||||||
endif
|
RemoveInventoryEventFilter(SkeeverTail)
|
||||||
endif
|
Self.Clear()
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -132,3 +134,5 @@ GlobalVariable Property _00E_FS_NQ05_SkeeverTailCountGlobal Auto
|
|||||||
GlobalVariable Property _00E_FS_NQ05_VynrootCountGlobal Auto
|
GlobalVariable Property _00E_FS_NQ05_VynrootCountGlobal Auto
|
||||||
|
|
||||||
Actor Property PlayerREF Auto
|
Actor Property PlayerREF Auto
|
||||||
|
|
||||||
|
FormList Property _00E_EmptyFormlist Auto
|
||||||
|
Loading…
Reference in New Issue
Block a user