local D = {}

function D.getId ()
	return "tavernkeeper1"
end

function D.isAvailable ()
	return Town.getCurrentTownIndex() + 1 == Towns.Reval
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()) and QuestManager.questCompleted({id="spicerun"}) then
		table.insert(topics, "ask_provisioner")
	end

	return topics

end

function D.getTopicTitle (topicKey)
	return nil
end

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