[REQUEST] Problem with task system TFS 1.2

zenchu

New Member
Joined
Jan 7, 2019
Messages
6
Best answers
0
Likes
0
#1
Hello, I did import datapack from 10.30 to 10.98,

got problem with my task master.

error:

new.PNG

my lib/task
Lua:
rankStorage = 3170
 
THEHORNEDFOX = {3501, 1}
THEOLDWIDOW = {3502, 1}
BLOODWEB = {3503, 1}
ESMERALD = {3504, 1}
FLESHCRAWLER = {3505, 1}
DEMODRAS = {3506, 1}
ETHERSHRECK = {3507, 1}
FLAMEBORN = {3508, 1}
RANDOMPIRATEBOSS = {3509, 1}
TORMENTOR = {3510, 1}
THEMANY = {3511, 1}
THENOXIUSSPAWN = {3512, 1}
GORGO = {3513, 1}
LEVIATHAN = {3514, 1}
STONECRACKER = {3515, 1}
FAZZRAH = {3516, 1}
DEMONOAK = {3164, 1}
NECRO = {15500, 1}
TIQUNDA = {15501, 1}
LORDSPECTRE = {15502, 1}
ALEMANUS = {15503, 1}
VONGAR = {15504, 1}
THORGOT = {15505, 1}
 
tasks =
{
[1] = {questStarted = 3175, questStorage = 3300, killsRequired = 150, raceName = "Goblins", repeatable = true, rewards = {{enable = true, type = "exp", values = 15000}, {enable = true, type = "money", values = 1500}}},
[2] = {questStarted = 3176, questStorage = 3301, killsRequired = 350, raceName = "Rotworms", repeatable = true, rewards = {{enable = true, type = "exp", values = 50000}, {enable = true, type = "money", values = 3500}}},
[3] = {questStarted = 3177, questStorage = 3302, killsRequired = 350, raceName = "Smugglers", repeatable = true, rewards = {{enable = true, type = "exp", values = 50000}, {enable = true, type = "money", values = 3500}}},
[4] = {questStarted = 3178, questStorage = 3303, killsRequired = 300, raceName = "Amazons", repeatable = true, rewards = {{enable = true, type = "exp", values = 50000}, {enable = true, type = "money", values = 3000}}},
[5] = {questStarted = 3179, questStorage = 3304, killsRequired = 350, raceName = "Ghouls", repeatable = true, rewards = {{enable = true, type = "exp", values = 100000}, {enable = true, type = "money", values = 5000}}},
[6] = {questStarted = 3180, questStorage = 3305, killsRequired = 500, raceName = "Dwarfs", repeatable = true, rewards = {{enable = true, type = "exp", values = 100000}, {enable = true, type = "money", values = 5000}}},
[7] = {questStarted = 3181, questStorage = 3306, killsRequired = 5000, raceName = "Minotaurs", repeatable = true, rewards = {{enable = true, type = "exp", values = 500000}, {enable = true, type = "storage", values = THEHORNEDFOX}}},
[8] = {questStarted = 3182, questStorage = 3307, killsRequired = 200, raceName = "Elf Arcanist", repeatable = true, rewards = {{enable = true, type = "exp", values = 100000}, {enable = true, type = "money", values = 5000}}},
[9] = {questStarted = 3183, questStorage = 3308, killsRequired = 400, raceName = "Cyclops", repeatable = true, rewards = {{enable = true, type = "exp", values = 140000}, {enable = true, type = "money", values = 7000}}},
[10] = {questStarted = 3184, questStorage = 3309, killsRequired = 100, raceName = "Bonelords", repeatable = true, rewards = {{enable = true, type = "exp", values = 70000}, {enable = true, type = "money", values = 4000}}},
[11] = {questStarted = 3185, questStorage = 3310, killsRequired = 300, raceName = "Vampires", repeatable = true, rewards = {{enable = true, type = "exp", values = 100000}, {enable = true, type = "money", values = 4000}}},
[12] = {questStarted = 3186, questStorage = 3311, killsRequired = 5000, raceName = "Pirates", repeatable = true, rewards = {{enable = true, type = "exp", values = 500000}, {enable = true, type = "storage", values = RANDOMPIRATEBOSS}}},
[13] = {questStarted = 3187, questStorage = 3312, killsRequired = 300, raceName = "Wyvern", repeatable = true, rewards = {{enable = true, type = "exp", values = 150000}, {enable = true, type = "money", values = 7000}}},
[14] = {questStarted = 3200, questStorage = 3325, killsRequired = 1000, raceName = "Necromancers", repeatable = true, rewards = {{enable = true, type = "exp", values = 500000}, {enable = true, type = "storage", values = NECRO}}},
[15] = {questStarted = 3188, questStorage = 3313, killsRequired = 500, raceName = "Crystal Spiders", repeatable = true, rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "storage", values = BLOODWEB}}},
[16] = {questStarted = 3189, questStorage = 3314, killsRequired = 700, raceName = "Giant Spiders", repeatable = true, rewards = {enable = true, type = "storage", values = THEOLDWIDOW}},
[17] = {questStarted = 3190, questStorage = 3315, killsRequired = 500, raceName = "Mutated Humans", repeatable = true, rewards = {{enable = true, type = "exp", values = 150000}, {enable = true, type = "money", values = 8000}}},
[18] = {questStarted = 3191, questStorage = 3316, killsRequired = 500, raceName = "Mutated Rats", repeatable = true, rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "storage", values = ESMERALD}}},
[19] = {questStarted = 3192, questStorage = 3317, killsRequired = 500, raceName = "Bog Raiders", repeatable = true, rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "money", values = 15000}}},
[20] = {questStarted = 3193, questStorage = 3318, killsRequired = 500, raceName = "Worker Golems", repeatable = true, rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "money", values = 10000}}},
[21] = {questStarted = 3194, questStorage = 3319, killsRequired = 500, raceName = "Ancient Scarabs", repeatable = true, rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "storage", values = FLESHCRAWLER}}},
[22] = {questStarted = 3195, questStorage = 3320, killsRequired = 500, raceName = "Hero", repeatable = true, rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "money", values = 20000}}},
[23] = {questStarted = 3196, questStorage = 3321, killsRequired = 1000, raceName = "Askaraks", repeatable = true, rewards = {{enable = true, type = "exp", values = 300000}, {enable = true, type = "money", values = 20000}}},
[24] = {questStarted = 3197, questStorage = 3322, killsRequired = 1000, raceName = "Shaburaks", repeatable = true, rewards = {{enable = true, type = "exp", values = 350000}, {enable = true, type = "money", values = 30000}}},
[25] = {questStarted = 3198, questStorage = 3323, killsRequired = 500, raceName = "Wyrms", repeatable = true, rewards = {{enable = true, type = "exp", values = 350000}, {enable = true, type = "money", values = 30000}}},
[26] = {questStarted = 3199, questStorage = 3324, killsRequired = 5000, raceName = "Dragon Lords", repeatable = true, rewards = {{enable = true, type = "exp", values = 2000000}, {enable = true, type = "storage", values = DEMODRAS}}},
[27] = {questStarted = 3201, questStorage = 3326, killsRequired = 1000, raceName = "Frost Dragons", repeatable = true, rewards = {{enable = true, type = "exp", values = 400000}, {enable = true, type = "money", values = 30000}}},
[28] = {questStarted = 3202, questStorage = 3327, killsRequired = 1000, raceName = "Ghastly Dragons", repeatable = true, rewards = {{enable = true, type = "exp", values = 1000000}, {enable = true, type = "storage", values = ETHERSHRECK}}},
[29] = {questStarted = 3203, questStorage = 3328, killsRequired = 500, raceName = "Hellspawns", repeatable = true, rewards = {{enable = true, type = "exp", values = 400000}, {enable = true, type = "storage", values = FLAMEBORN}}},
[30] = {questStarted = 3204, questStorage = 3329, killsRequired = 1000, raceName = "Nightmares", repeatable = true, rewards = {{enable = true, type = "exp", values = 400000}, {enable = true, type = "storage", values = TORMENTOR}}},
[31] = {questStarted = 3205, questStorage = 3330, killsRequired = 500, raceName = "Hydras", repeatable = true, rewards = {{enable = true, type = "exp", values = 400000}, {enable = true, type = "storage", values = THEMANY}}},
[32] = {questStarted = 3206, questStorage = 3331, killsRequired = 500, raceName = "Serpent Spawns", repeatable = true, rewards = {{enable = true, type = "exp", values = 400000}, {enable = true, type = "storage", values = THENOXIUSSPAWN}}},
[33] = {questStarted = 3207, questStorage = 3332, killsRequired = 1000, raceName = "Medusa", repeatable = true, rewards = {{enable = true, type = "exp", values = 1000000}, {enable = true, type = "storage", values = GORGO}}},
[34] = {questStarted = 3208, questStorage = 3333, killsRequired = 500, raceName = "Sea Serpents", repeatable = true, rewards = {{enable = true, type = "exp", values = 500000}, {enable = true, type = "storage", values = LEVIATHAN}}},
[35] = {questStarted = 3209, questStorage = 3334, killsRequired = 1000, raceName = "War Golems", repeatable = true, rewards = {{enable = true, type = "exp", values = 500000}, {enable = true, type = "money", values = 35000}}},
[36] = {questStarted = 3210, questStorage = 3335, killsRequired = 1000, raceName = "Grim Reaper", repeatable = true, rewards = {{enable = true, type = "exp", values = 5000000}, {enable = true, type = "money", values = 50000}}},
[37] = {questStarted = 3211, questStorage = 3336, killsRequired = 1000, raceName = "Behemoth", repeatable = true, rewards = {{enable = true, type = "exp", values = 5000000},  {enable = true, type = "storage", values = STONECRACKER}}},
[38] = {questStarted = 3212, questStorage = 3337, killsRequired = 1000, raceName = "Undead Dragons", repeatable = true, rewards = {{enable = true, type = "exp", values = 1000000},  {enable = true, type = "storage", values = ZANAKEPH}}},
[39] = {questStarted = 3213, questStorage = 3338, killsRequired = 1000, raceName = "Lizard high class", repeatable = true, rewards = {{enable = true, type = "exp", values = 300000},  {enable = true, type = "storage", values = FAZZRAH}}},
[40] = {questStarted = 3214, questStorage = 3339, killsRequired = 1000, raceName = "Lizard Chosen", repeatable = true, rewards = {{enable = true, type = "exp", values = 500000},  {enable = true, type = "money", values = 30000}}},
[41] = {questStarted = 3215, questStorage = 3340, killsRequired = 1000, raceName = "Draken", repeatable = true, rewards = {{enable = true, type = "exp", values = 1000000},  {enable = true, type = "money", values = 50000}}},
[42] = {questStarted = 3216, questStorage = 3341, killsRequired = 6666, raceName = "Demons", repeatable = false, rewards = {{enable = true, type = "exp", values = 2000000}, {enable = true, type = "storage", values = DEMONOAK}}},
[43] = {questStarted = 8210, questStorage = 8310, killsRequired = 1000, raceName = "Spectre", repeatable = true, rewards = {{enable = true, type = "exp", values = 300000}, {enable = true, type = "storage", values = LORDSPECTRE}}},
[44] = {questStarted = 8211, questStorage = 8311, killsRequired = 1000, raceName = "Warlock", repeatable = true, rewards = {{enable = true, type = "exp", values = 500000}, {enable = true, type = "money", values = 30000}}},
[45] = {questStarted = 8212, questStorage = 8312, killsRequired = 1500, raceName = "Fury", repeatable = true, rewards = {{enable = true, type = "exp", values = 800000}, {enable = true, type = "money", values = 50000}}},
[46] = {questStarted = 8213, questStorage = 8313, killsRequired = 1000, raceName = "Lost", repeatable = true, rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "money", values = 10000}}},
[47] = {questStarted = 8214, questStorage = 8314, killsRequired = 1000, raceName = "Hellhound", repeatable = true, rewards = {{enable = true, type = "exp", values = 500000}, {enable = true, type = "money", values = 40000}}},
[48] = {questStarted = 8215, questStorage = 8315, killsRequired = 1000, raceName = "Diabolic Imp", repeatable = true, rewards = {{enable = true, type = "exp", values = 300000}, {enable = true, type = "money", values = 30000}}},
[49] = {questStarted = 8216, questStorage = 8316, killsRequired = 1000, raceName = "Deepling", repeatable = true, rewards = {{enable = true, type = "exp", values = 400000}, {enable = true, type = "money", values = 30000}}},
[50] = {questStarted = 8217, questStorage = 8317, killsRequired = 500, raceName = "Spidris", repeatable = true, rewards = {{enable = true, type = "exp", values = 150000}, {enable = true, type = "money", values = 10000}}},
[51] = {questStarted = 8258, questStorage = 8259, killsRequired = 250, raceName = "Carniphila", repeatable = true, rewards = {{enable = true, type = "exp", values = 50000},  {enable = true, type = "money", values = 6000}, {enable = true, type = "storage", values = TIQUNDA}}},
[52] = {questStarted = 8280, questStorage = 8281, killsRequired = 2000, raceName = "Alemanus", repeatable = true, rewards = {{enable = true, type = "exp", values = 150000},  {enable = true, type = "money", values = 16000}, {enable = true, type = "storage", values = ALEMANUS}}},
[53] = {questStarted = 8285, questStorage = 8286, killsRequired = 2000, raceName = "Vongar", repeatable = true, rewards = {{enable = true, type = "exp", values = 150000},  {enable = true, type = "money", values = 16000}, {enable = true, type = "storage", values = VONGAR}}},
[54] = {questStarted = 8290, questStorage = 8291, killsRequired = 2000, raceName = "Thorgot", repeatable = true, rewards = {{enable = true, type = "exp", values = 150000},  {enable = true, type = "money", values = 16000}, {enable = true, type = "storage", values = THORGOT}}}
}
 
function getTasksStarted(cid)
local tmp = {}
for k, v in pairs(tasks) do
if getCreatureStorage(cid, v.questStarted) == 1 then
table.insert(tmp, k)
end
end
return tmp
end
 
function getTaskByName(name)
for k, v in pairs(tasks) do
if v.raceName:lower() == name:lower() then
return k
end
end
return false
end
 
function sendTaskWindow(cid)
taskWindow = ModalWindow(1900, "Mission Management", "Select a task:")
local task_status = {}
 
if taskWindow:getId() == 1900 then
    taskWindow:addButton(1, "Select")
    taskWindow:addButton(2, "Cancel")
    for i = 1, #tasks do
        if getCreatureStorage(cid, tasks[i].questStarted) == 2 then
            task_status[i] = "[completed]"
        else
            if getCreatureStorage(cid, tasks[i].questStarted) == 1 then
                task_status[i] = "[" .. getCreatureStorage(cid, tasks[i].questStorage) .. "/" .. tasks[i].killsRequired .. "]"
            else
                if getCreatureStorage(cid, tasks[i].questStarted) < 1 then
                    task_status[i] = tasks[i].killsRequired
                else
                    task_status[i] = tasks[i].killsRequired .. " [unknown]"
                end
            end
        end
      
        if getCreatureStorage(cid, tasks[i].questStarted) == 1 and getCreatureStorage(cid, tasks[i].questStorage) >= tasks[i].killsRequired then
            taskWindow:addChoice(i, tasks[i].raceName .. " [click for reward]")
        else
            taskWindow:addChoice(i, tasks[i].raceName .. ", " .. task_status[i])
        end
    end
end
taskWindow:sendToPlayer(cid)
return true
end
my npc/scripts/task

Lua:
local choose = {}

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local talk_state = {}

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)

if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
if isInArray({"task", "tasks"}, msg:lower()) then
selfSay("Here.", cid)
taskNPCuid = getNpcCid()
if getPlayerStorageValue(cid, 3170) < 0 then setPlayerStorageValue(cid, 3170, 0) end
return sendTaskWindow(cid)
end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Could anyone help me? :D
 
Top