• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 0.X Dynamic quest log

zexus

Member
Joined
Oct 1, 2016
Messages
133
Reaction score
18
All the quests in my server are temporary...
For now i'm using the talkaction !quests to show all the quests blocked...

But i would like to use quest log... Is it possible?

The talkaction:
Code:
mins = 60
hours = 60 * 60
days = 24 * 60 * 60
xikini_quest_list = {
    -- rook
    [8000] = { name = "Sabre Rook", item = 2385, lvl = 1, time = 15 * mins},
    [8001] = { name = "Doublet Rook", item = 2485, lvl = 2, time = 30 * mins},
    [8002] = { name = "Studded Shield Rook", item = 2526, lvl = 3, time = 50 * mins},
    [8003] = { name = "Copper Shield Rook", item = 2530, lvl = 5, time = 3 * hours},
    [8004] = { name = "Legion Helmet Rookx", item = 2480, lvl = 5, time = 5 * hours},
    [8005] = { name = "Katana Rook", item = 2412, lvl = 5, time = 10 * hours}
}

Code:
function onSay(cid, words, param, channel)
    local time = os.time()
    local final = ''
    -- We are looping from 8000 to 8005, so those are the storages that we will check.
    for q, quest in pairs(xikini_quest_list) do
        local storage = quest -- In this local we get the information, for example if q is equal to 8000 and you print storage.name you will get "Sabre Rook".
        local str = ''

        local continue = false
        -- don't show everything, only exausted one, cause there are a lot of quests
        if getPlayerStorageValue(cid, q) < 0 then
            -- str = 'You have never done '..storage.name..' quest! Time to get to it.'
            continue = true
        elseif time - getPlayerStorageValue(cid, q) >= 0 then
            -- str = 'You can now do '..storage.name..' quest again!'
            continue = true
        end

        if not continue then
            if getPlayerStorageValue(cid, q) - time > days then
                str = math.ceil(((getPlayerStorageValue(cid, q)) - time) / days) ..' days.'
            elseif getPlayerStorageValue(cid, q) - time > hours then
                str = math.ceil(((getPlayerStorageValue(cid, q)) - time) / hours) ..' hours.'
            else
                str = math.ceil(((getPlayerStorageValue(cid, q)) - time) / mins) ..' minutes.'
            end
            final = final .. "[" .. storage.name .. "]: " .. str .. "\n\n"
        end

    end
    doShowTextDialog(cid, 2175, final)
    return true
end
 
Top