-- if task storage is not equal to task_complete_value, will show in book available
local tasks = {
-- {storage, task_complete_value, "task description"}
{11111, 3, "rotworms"},
{11111, 3, "hydras"},
{11111, 3, "cyclops"}
}
local function showTasks(cid)
local text = "Available Tasks:\n"
local counter = 0
for i = 1, #tasks do
if getCreatureStorage(cid, tasks[i][1]) ~= tasks[i][2] then
text = text .. "\n" .. tasks[i][3] .. ""
counter = counter + 1
end
end
if counter == 0 then
text = text .. "\nNone."
end
counter = 0
text = text .. "\n\nCompleted Tasks:\n"
for i = 1, #tasks do
if getCreatureStorage(cid, tasks[i][1]) == tasks[i][2] then
text = text .. "\n" .. tasks[i][3] .. ""
counter = counter + 1
end
end
if counter == 0 then
text = text .. "\nNone."
end
doShowTextDialog(cid, 11134, text)
return true
end