Optimized ingredient tracking in The Elixir

This commit is contained in:
Eddoursul 2021-12-19 23:10:53 +01:00
parent d35571ca5e
commit ccdd1b20a4
5 changed files with 29 additions and 18 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -48,6 +48,13 @@ Function UpdateGlobals()
ModObjectiveGlobal(0, _00E_FS_NQ05_MothWingMonarchCountGlobal, 38, 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
Function TestFunction() ;DELETE FOR RELEASE

View File

@ -1,10 +1,14 @@
Scriptname _00E_FS_NQ05_PlayerAlias extends ReferenceAlias
Event OnInit()
AddInventoryEventFilter(_00E_EmptyFormlist)
If FS_NQ05.GetStage() == 35 ; version update
AddInventoryEventFilter(SkeeverTail)
AddInventoryEventFilter(Garlic)
AddInventoryEventFilter(MothWingMonarch)
AddInventoryEventFilter(Vynroot)
endif
_00E_FS_NQ05_GarlicCountGlobal.Value = PlayerREF.GetItemCount(Garlic)
_00E_FS_NQ05_MothWingMonarchCountGlobal.Value = PlayerREF.GetItemCount(MothWingMonarch)
@ -20,13 +24,12 @@ EndEvent
Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
If FS_NQ05.GetStage() != 35
If FS_NQ05.GetStage() > 35
if akBaseItem != SkeeverTail ; keep the rarest item as filter
AddInventoryEventFilter(_00E_EmptyFormlist) ; in case clearing fails
RemoveInventoryEventFilter(Garlic)
RemoveInventoryEventFilter(MothWingMonarch)
RemoveInventoryEventFilter(Vynroot)
endif
endif
RemoveInventoryEventFilter(SkeeverTail)
Self.Clear()
return
endif
@ -55,13 +58,12 @@ EndEvent
Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
If FS_NQ05.GetStage() != 35
If FS_NQ05.GetStage() > 35
if akBaseItem != SkeeverTail
AddInventoryEventFilter(_00E_EmptyFormlist) ; in case clearing fails
RemoveInventoryEventFilter(Garlic)
RemoveInventoryEventFilter(MothWingMonarch)
RemoveInventoryEventFilter(Vynroot)
endif
endif
RemoveInventoryEventFilter(SkeeverTail)
Self.Clear()
return
endif
@ -132,3 +134,5 @@ GlobalVariable Property _00E_FS_NQ05_SkeeverTailCountGlobal Auto
GlobalVariable Property _00E_FS_NQ05_VynrootCountGlobal Auto
Actor Property PlayerREF Auto
FormList Property _00E_EmptyFormlist Auto