local D = {}

function D.getId ()
	return "merchant2"
end

function D.isAvailable ()
	return (DialogManager.isDialogAvailable(D.getId()) and Town.getCurrentTownIndex() + 1 == Towns.Oldden)
end

function D.getName ()
	return DialogManager.translate("title", D.getId())
end

function D.getTopics ()

	local topics = {}

	table.insert(topics, "greet")

	if DialogManager.isDialogTreeOpened("greet", D.getId()) then
		table.insert(topics, "ask_about_closed_store")
	end

	return topics

end

function D.getTopicTitle (topicKey)
	return nil
end

-- Register globally
DialogManager.Dialogs[D.getId()] = D
