Dialogues are variables. you can pass the required dialog variable to npc with a function
so when the dialog starts you launch the variable dialog
you can call that function from anywhere you need.