Binary, as in there are only two outcomes: accept_quest and deny_quest. The third dialog option in your example doesn't count since all it amounts to is, "Could you repeat options #1 and #2?"
Anyway, here's something I whipped up:
today_date = 1
plotlines =
{
main =
{
-- run this script every 1 days
check_every = 1,
-- initialize to day zero
last_checked = 0,
do_script = function()
-- if today is day #100 or later...
if (today_date >= 100) then
plotlines.smuggler_plotline.do_script()
end
-- run the defense mission plotline every so often
if ((today_date - plotlines.defense_mission.last_checked) > plotlines.defense_mission.check_every) then
plotlines.defense_mission.do_script()
plotlines.defense_mission.last_checked = today_date
end
today_date = today_date + 1
end,
},
smuggler_plotline =
{
has_bought_contraband = false,
do_script = function()
plotlines.smuggler_plotline.has_bought_contraband = prompt("Would you like to buy contraband?")
end,
},
defense_mission =
{
check_every = 20,
last_checked = 0,
do_script = function()
if (plotlines.smuggler_plotline.has_bought_contraband == true) then
say("Sorry, I can't offer you this mission. You have purchased contraband.")
else
say("You're clean. Here's a mission for you!")
plotlines.third_plotline.do_script()
end
end,
},
third_plotline =
{
-- etc. etc. etc.
},
}
The "main" plotline is run automatically at the start (the code to actually start it is not in the example however...). It controls the other plotlines.