Advice for making a 2D Dialogue System?

So I’ve already followed some tutorials about a basic dialogue system that types out the words with the UI when you interact with an NPC, and all that stuff. But what would be the best way for making certain lines of dialogue unavailable until you meet the conditions like completing a quest, or giving the player an item or adding health after a specific line of dialogue/conversation?

Vide dialogue is free and is pretty nice. It gave me a quick start to my dialogue system. You can change the “assigned dialogue” attribute in the VIDE assign script and a different dialogue will be selected.

I came up with scriptable objects that are the dialogues holding an array of dialogue parts that again hold text and reference to the talking npc. In my dialogue manager I than check for the parts until i reach the end and exit. You could essily check for answers instead and hold those answers in the items. This is still quite linear. If I need a more dynamic system I would come up with a custom node editor to draw the dialogues