diff --git a/Removed scripts from FS_NQ5 ingredients, added playerevents.esp b/Removed scripts from FS_NQ5 ingredients, added playerevents.esp index f60c8ac7..9d4f4b70 100644 Binary files a/Removed scripts from FS_NQ5 ingredients, added playerevents.esp and b/Removed scripts from FS_NQ5 ingredients, added playerevents.esp differ diff --git a/scripts/_00e_fs_nq05_functions.pex b/scripts/_00e_fs_nq05_functions.pex index e73bf492..2912944a 100644 Binary files a/scripts/_00e_fs_nq05_functions.pex and b/scripts/_00e_fs_nq05_functions.pex differ diff --git a/scripts/_00e_fs_nq05_playeralias.pex b/scripts/_00e_fs_nq05_playeralias.pex index 72623948..b13ed596 100644 Binary files a/scripts/_00e_fs_nq05_playeralias.pex and b/scripts/_00e_fs_nq05_playeralias.pex differ diff --git a/source/scripts/_00e_fs_nq05_functions.psc b/source/scripts/_00e_fs_nq05_functions.psc index 0ede7ba8..8df7da06 100644 --- a/source/scripts/_00e_fs_nq05_functions.psc +++ b/source/scripts/_00e_fs_nq05_functions.psc @@ -22,22 +22,31 @@ EndFunction Function UpdateGlobals() - _00E_FS_NQ05_VynrootCountGlobal.SetValue(0) - _00E_FS_NQ05_SkeeverTailCountGlobal.SetValue(0) - _00E_FS_NQ05_MothWingMonarchCountGlobal.SetValue(0) - _00E_FS_NQ05_GarlicCountGlobal.SetValue(0) + _00E_FS_NQ05_GarlicCountGlobal.Value = PlayerREF.GetItemCount(Garlic) + _00E_FS_NQ05_MothWingMonarchCountGlobal.Value = PlayerREF.GetItemCount(MothWingMonarch) + _00E_FS_NQ05_SkeeverTailCountGlobal.Value = PlayerREF.GetItemCount(SkeeverTail) + _00E_FS_NQ05_VynrootCountGlobal.Value = PlayerREF.GetItemCount(Vynroot) + + wait(0.5) + + UpdateCurrentInstanceGlobal(_00E_FS_NQ05_VynrootCountGlobal) + UpdateCurrentInstanceGlobal(_00E_FS_NQ05_SkeeverTailCountGlobal) + UpdateCurrentInstanceGlobal(_00E_FS_NQ05_MothWingMonarchCountGlobal) + UpdateCurrentInstanceGlobal(_00E_FS_NQ05_GarlicCountGlobal) + + Wait(0.5) SetObjectiveDisplayed(36) SetObjectiveDisplayed(37) SetObjectiveDisplayed(38) SetObjectiveDisplayed(39) - Wait(1.5) + wait(1.5) - ModObjectiveGlobal(PlayerREF.GetItemCount(SkeeverTail), _00E_FS_NQ05_SkeeverTailCountGlobal, 36, 1, true, true, true) - ModObjectiveGlobal(PlayerREF.GetItemCount(Garlic), _00E_FS_NQ05_GarlicCountGlobal, 37, 1, true, true, true) - ModObjectiveGlobal(PlayerREF.GetItemCount(MothWingMonarch), _00E_FS_NQ05_MothWingMonarchCountGlobal, 38, 1, true, true, true) - ModObjectiveGlobal(PlayerREF.GetItemCount(Vynroot), _00E_FS_NQ05_VynrootCountGlobal, 39, 1, true, true, true) + ModObjectiveGlobal(0, _00E_FS_NQ05_SkeeverTailCountGlobal, 36, 1, true, true, false) + ModObjectiveGlobal(0, _00E_FS_NQ05_GarlicCountGlobal, 37, 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) EndFunction diff --git a/source/scripts/_00e_fs_nq05_playeralias.psc b/source/scripts/_00e_fs_nq05_playeralias.psc index 698fac3f..d29758e3 100644 --- a/source/scripts/_00e_fs_nq05_playeralias.psc +++ b/source/scripts/_00e_fs_nq05_playeralias.psc @@ -5,6 +5,16 @@ Event OnInit() AddInventoryEventFilter(Garlic) AddInventoryEventFilter(MothWingMonarch) AddInventoryEventFilter(Vynroot) + + _00E_FS_NQ05_GarlicCountGlobal.Value = PlayerREF.GetItemCount(Garlic) + _00E_FS_NQ05_MothWingMonarchCountGlobal.Value = PlayerREF.GetItemCount(MothWingMonarch) + _00E_FS_NQ05_SkeeverTailCountGlobal.Value = PlayerREF.GetItemCount(SkeeverTail) + _00E_FS_NQ05_VynrootCountGlobal.Value = PlayerREF.GetItemCount(Vynroot) + + FS_NQ05.UpdateCurrentInstanceGlobal(_00E_FS_NQ05_GarlicCountGlobal) + FS_NQ05.UpdateCurrentInstanceGlobal(_00E_FS_NQ05_MothWingMonarchCountGlobal) + FS_NQ05.UpdateCurrentInstanceGlobal(_00E_FS_NQ05_SkeeverTailCountGlobal) + FS_NQ05.UpdateCurrentInstanceGlobal(_00E_FS_NQ05_VynrootCountGlobal) EndEvent Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) @@ -56,22 +66,54 @@ Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemRefe endif if akBaseItem == Garlic - FS_NQ05.ModObjectiveGlobal(0 - aiItemCount, _00E_FS_NQ05_GarlicCountGlobal, 37, 1, true, true, true) + bool bNotify = (_00E_FS_NQ05_GarlicCountGlobal.Value > 0) + _00E_FS_NQ05_GarlicCountGlobal.Value = PlayerREF.GetItemCount(Garlic) + FS_NQ05.UpdateCurrentInstanceGlobal(_00E_FS_NQ05_GarlicCountGlobal) + if bNotify && (_00E_FS_NQ05_GarlicCountGlobal.Value == 0) && FS_NQ05.IsObjectiveCompleted(37) + FS_NQ05.SetObjectiveCompleted(37, false) + FS_NQ05.SetObjectiveDisplayed(37, true, true) + elseif (_00E_FS_NQ05_GarlicCountGlobal.Value > 0) && ! FS_NQ05.IsObjectiveCompleted(37) + FS_NQ05.SetObjectiveCompleted(37, true) + endif return endif if akBaseItem == MothWingMonarch - FS_NQ05.ModObjectiveGlobal(0 - aiItemCount, _00E_FS_NQ05_MothWingMonarchCountGlobal, 38, 1, true, true, true) + bool bNotify = (_00E_FS_NQ05_MothWingMonarchCountGlobal.Value > 0) + _00E_FS_NQ05_MothWingMonarchCountGlobal.Value = PlayerREF.GetItemCount(MothWingMonarch) + FS_NQ05.UpdateCurrentInstanceGlobal(_00E_FS_NQ05_MothWingMonarchCountGlobal) + if bNotify && (_00E_FS_NQ05_MothWingMonarchCountGlobal.Value == 0) && FS_NQ05.IsObjectiveCompleted(38) + FS_NQ05.SetObjectiveCompleted(38, false) + FS_NQ05.SetObjectiveDisplayed(38, true, true) + elseif (_00E_FS_NQ05_MothWingMonarchCountGlobal.Value > 0) && ! FS_NQ05.IsObjectiveCompleted(38) + FS_NQ05.SetObjectiveCompleted(38, true) + endif return endif if akBaseItem == SkeeverTail - FS_NQ05.ModObjectiveGlobal(0 - aiItemCount, _00E_FS_NQ05_SkeeverTailCountGlobal, 36, 1, true, true, true) + bool bNotify = (_00E_FS_NQ05_SkeeverTailCountGlobal.Value > 0) + _00E_FS_NQ05_SkeeverTailCountGlobal.Value = PlayerREF.GetItemCount(SkeeverTail) + FS_NQ05.UpdateCurrentInstanceGlobal(_00E_FS_NQ05_SkeeverTailCountGlobal) + if bNotify && (_00E_FS_NQ05_SkeeverTailCountGlobal.Value == 0) && FS_NQ05.IsObjectiveCompleted(36) + FS_NQ05.SetObjectiveCompleted(36, false) + FS_NQ05.SetObjectiveDisplayed(36, true, true) + elseif (_00E_FS_NQ05_SkeeverTailCountGlobal.Value > 0) && ! FS_NQ05.IsObjectiveCompleted(36) + FS_NQ05.SetObjectiveCompleted(36, true) + endif return endif if akBaseItem == Vynroot - FS_NQ05.ModObjectiveGlobal(0 - aiItemCount, _00E_FS_NQ05_VynrootCountGlobal, 39, 1, true, true, true) + bool bNotify = (_00E_FS_NQ05_VynrootCountGlobal.Value > 0) + _00E_FS_NQ05_VynrootCountGlobal.Value = PlayerREF.GetItemCount(Vynroot) + FS_NQ05.UpdateCurrentInstanceGlobal(_00E_FS_NQ05_VynrootCountGlobal) + if bNotify && (_00E_FS_NQ05_VynrootCountGlobal.Value == 0) && FS_NQ05.IsObjectiveCompleted(39) + FS_NQ05.SetObjectiveCompleted(39, false) + FS_NQ05.SetObjectiveDisplayed(39, true, true) + elseif (_00E_FS_NQ05_VynrootCountGlobal.Value > 0) && ! FS_NQ05.IsObjectiveCompleted(39) + FS_NQ05.SetObjectiveCompleted(39, true) + endif return endif @@ -88,3 +130,5 @@ GlobalVariable Property _00E_FS_NQ05_GarlicCountGlobal Auto GlobalVariable Property _00E_FS_NQ05_MothWingMonarchCountGlobal Auto GlobalVariable Property _00E_FS_NQ05_SkeeverTailCountGlobal Auto GlobalVariable Property _00E_FS_NQ05_VynrootCountGlobal Auto + +Actor Property PlayerREF Auto