Scriptname _00E_FS_NQ07_DinnerControlSC extends ReferenceAlias Event OnInit() AddInventoryEventFilter(_00E_EmptyFormlist) If FS_NQ07.GetCurrentStageID() == 370 ; version update AddInventoryEventFilter(_00E_DalSarkerHoneywine) AddInventoryEventFilter(FoodChickenCooked) AddInventoryEventFilter(FoodCabbagePotatoSoup) endif FS_NQ07_HoneyWineBought.Value = PlayerREF.GetItemCount(_00E_DalSarkerHoneywine) FS_NQ07_ChickenCooked.Value = PlayerREF.GetItemCount(FoodChickenCooked) FS_NQ07_SoupBrewed.Value = PlayerREF.GetItemCount(FoodCabbagePotatoSoup) FS_NQ07.UpdateCurrentInstanceGlobal(FS_NQ07_HoneyWineBought) FS_NQ07.UpdateCurrentInstanceGlobal(FS_NQ07_ChickenCooked) FS_NQ07.UpdateCurrentInstanceGlobal(FS_NQ07_SoupBrewed) EndEvent Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If FS_NQ07.GetCurrentStageID() != 370 AddInventoryEventFilter(_00E_EmptyFormlist) ; in case clearing fails RemoveInventoryEventFilter(_00E_DalSarkerHoneywine) RemoveInventoryEventFilter(FoodChickenCooked) RemoveInventoryEventFilter(FoodCabbagePotatoSoup) Self.Clear() return endif if akBaseItem == _00E_DalSarkerHoneywine FS_NQ07.ModObjectiveGlobal(aiItemCount, FS_NQ07_HoneyWineBought, 110, 2, true, true, true) elseif akBaseItem == FoodChickenCooked FS_NQ07.ModObjectiveGlobal(aiItemCount, FS_NQ07_ChickenCooked, 120, 2, true, true, true) elseif akBaseItem == FoodCabbagePotatoSoup FS_NQ07.ModObjectiveGlobal(aiItemCount, FS_NQ07_SoupBrewed, 130, 2, true, true, true) endif EndEvent Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) If FS_NQ07.GetCurrentStageID() != 370 AddInventoryEventFilter(_00E_EmptyFormlist) ; in case clearing fails RemoveInventoryEventFilter(_00E_DalSarkerHoneywine) RemoveInventoryEventFilter(FoodChickenCooked) RemoveInventoryEventFilter(FoodCabbagePotatoSoup) Self.Clear() return endif if akBaseItem == _00E_DalSarkerHoneywine FS_NQ07_HoneyWineBought.Value = PlayerREF.GetItemCount(_00E_DalSarkerHoneywine) FS_NQ07.UpdateCurrentInstanceGlobal(FS_NQ07_HoneyWineBought) if FS_NQ07_HoneyWineBought.Value < 2 FS_NQ07.SetObjectiveCompleted(110, false) FS_NQ07.SetObjectiveDisplayed(110, true, true) elseif ! FS_NQ07.IsObjectiveCompleted(110) FS_NQ07.SetObjectiveCompleted(110, true) endif return endif if akBaseItem == FoodChickenCooked FS_NQ07_ChickenCooked.Value = PlayerREF.GetItemCount(FoodChickenCooked) FS_NQ07.UpdateCurrentInstanceGlobal(FS_NQ07_ChickenCooked) if FS_NQ07_ChickenCooked.Value < 2 FS_NQ07.SetObjectiveCompleted(120, false) FS_NQ07.SetObjectiveDisplayed(120, true, true) elseif ! FS_NQ07.IsObjectiveCompleted(120) FS_NQ07.SetObjectiveCompleted(120, true) endif return endif if akBaseItem == FoodCabbagePotatoSoup FS_NQ07_SoupBrewed.Value = PlayerREF.GetItemCount(FoodCabbagePotatoSoup) FS_NQ07.UpdateCurrentInstanceGlobal(FS_NQ07_SoupBrewed) if FS_NQ07_SoupBrewed.Value < 2 FS_NQ07.SetObjectiveCompleted(130, false) FS_NQ07.SetObjectiveDisplayed(130, true, true) elseif ! FS_NQ07.IsObjectiveCompleted(130) FS_NQ07.SetObjectiveCompleted(130, true) endif return endif EndEvent _00E_FS_NQ07_Functions Property FS_NQ07 Auto Actor Property PlayerREF Auto Potion Property _00E_DalSarkerHoneywine Auto Potion Property FoodChickenCooked Auto Potion Property FoodCabbagePotatoSoup Auto GlobalVariable Property FS_NQ07_HoneyWineBought Auto GlobalVariable Property FS_NQ07_ChickenCooked Auto GlobalVariable Property FS_NQ07_SoupBrewed Auto FormList Property _00E_EmptyFormlist Auto