-LUA & XML Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

Status
Zamknięty.
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

Powinno trybic. Autor Limos.

[lua]local config = {
['dragon'] = {amount = 5, storage = 19000, startstorage = 5002, startvalue = 1},
['dragon lord'] = {amount = 3, storage = 19001, startstorage = 5002, startvalue = 1}
}
function onKill(cid, target)
local monster = config[getCreatureName(target):lower()]
if isPlayer(target) or not monster or isSummon(target) then
return true
end

if (getPlayerStorageValue(cid, monster.storage)+1) < monster.amount and getPlayerStorageValue(cid, monster.startstorage) >= monster.startvalue then
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Task message: '..(getPlayerStorageValue(cid, monster.storage)+1)..' of '..monster.amount..' '..getCreatureName(target)..'s killed.')
end
if (getPlayerStorageValue(cid, monster.storage)+1) == monster.amount then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Congratulations, you have killed '..(getPlayerStorageValue(cid, monster.storage)+1)..' '..getCreatureName(target)..'s and completed the '..getCreatureName(target)..'s mission.')
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
end
return true
end[/lua]

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

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

local storage = 5002

function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

if msgcontains(msg, "mission") then
if getPlayerStorageValue(cid, storage) == -1 then
selfSay("I have a mission for you to kill 5 dragons and 3 dragon lords, do you accept?", cid)
talkState[talkUser] = 1
elseif getPlayerStorageValue(cid, storage) == 1 then
selfSay("Did you kill 5 dragons and 3 dragon lords?", cid)
talkState[talkUser] = 1
else
selfSay("You already did the mission.", cid)
end
elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, storage) == -1 then
selfSay("Good, come back when you killed them.", cid)
setPlayerStorageValue(cid, storage, 1)
else
if getPlayerStorageValue(cid, 19000) == 5 and getPlayerStorageValue(cid, 19001) == 3 then
selfSay("Good job, here is your reward.", cid)
doPlayerAddItem(cid, 2160, 5)
doPlayerAddExp(cid, 50000)
setPlayerStorageValue(cid, storage, 2)
else
selfSay("You didn't kill them all.", cid)
end
end
talkState[talkUser] = 0
elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then
selfSay("Ok then.", cid)
talkState[talkUser] = 0
end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())[/lua]
 
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

Powinno trybic. Autor Limos.

[lua]local config = {
['dragon'] = {amount = 5, storage = 19000, startstorage = 5002, startvalue = 1},
['dragon lord'] = {amount = 3, storage = 19001, startstorage = 5002, startvalue = 1}
}
function onKill(cid, target)
local monster = config[getCreatureName(target):lower()]
if isPlayer(target) or not monster or isSummon(target) then
return true
end

if (getPlayerStorageValue(cid, monster.storage)+1) < monster.amount and getPlayerStorageValue(cid, monster.startstorage) >= monster.startvalue then
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Task message: '..(getPlayerStorageValue(cid, monster.storage)+1)..' of '..monster.amount..' '..getCreatureName(target)..'s killed.')
end
if (getPlayerStorageValue(cid, monster.storage)+1) == monster.amount then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Congratulations, you have killed '..(getPlayerStorageValue(cid, monster.storage)+1)..' '..getCreatureName(target)..'s and completed the '..getCreatureName(target)..'s mission.')
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
end
return true
end[/lua]

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

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

local storage = 5002

function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

if msgcontains(msg, "mission") then
if getPlayerStorageValue(cid, storage) == -1 then
selfSay("I have a mission for you to kill 5 dragons and 3 dragon lords, do you accept?", cid)
talkState[talkUser] = 1
elseif getPlayerStorageValue(cid, storage) == 1 then
selfSay("Did you kill 5 dragons and 3 dragon lords?", cid)
talkState[talkUser] = 1
else
selfSay("You already did the mission.", cid)
end
elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, storage) == -1 then
selfSay("Good, come back when you killed them.", cid)
setPlayerStorageValue(cid, storage, 1)
else
if getPlayerStorageValue(cid, 19000) == 5 and getPlayerStorageValue(cid, 19001) == 3 then
selfSay("Good job, here is your reward.", cid)
doPlayerAddItem(cid, 2160, 5)
doPlayerAddExp(cid, 50000)
setPlayerStorageValue(cid, storage, 2)
else
selfSay("You didn't kill them all.", cid)
end
end
talkState[talkUser] = 0
elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then
selfSay("Ok then.", cid)
talkState[talkUser] = 0
end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())[/lua]


Dzieki za checi ale nie dziala creaturescript. Npc normalnie odpisuje ale nie liczy zabic i nie da sie oddac taska ;x.
16:56 GOD[3446]: mission
16:56 Grizzly Adams: Did you kill 5 dragons and 3 dragon lords?
16:56 GOD[3446]: yes
16:56 Grizzly Adams: You didn't kill them all.
 
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

nie zapomniales zarejestrowac creaturescripta w login.lua?
[lua]registerCreatureEvent(cid, "task")[/lua]
[xml]<event type="kill" name="task" event="script" value="task.lua"/>[/xml]
 
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

Wiec jesli wszystko dziala to zamykam ;)
 
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

nie zapomniales zarejestrowac creaturescripta w login.lua?
[lua]registerCreatureEvent(cid, "task")[/lua]
[xml]<event type="kill" name="task" event="script" value="task.lua"/>[/xml]

dodalem to i nie dziala
 
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

?apaj moda:
[lua]<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Talkaction Task System" version="1.0" author="Oskar" contact="oskar1121@gmail.com" enabled="yes">
<config name="talkactionTask_conf"><![CDATA[
canGetOnlyOneTime = false

task = {
['potions'] = {storage = 10000, count = 10000,
potionTask = true,
rewards = {'exp', 10000, 'cash', 200000}},
['rotworm queen'] = {storage = 9999, beginStorageValue = 1, finishStorageValue = 2, count = 250,
requiedLevelToReward = 10,
rewards = {'exp', 10000, 'cash', 200000}},
['dragon'] = {storage = 9998, beginStorageValue = 3, finishStorageValue = 4, count = 2500,
requiedLevelToReward = 10,
rewards = {'exp', 1070100, 'cash', 500000, 'item', 2492, 'item', 2498}},
['dragon lord'] = {storage = 9997, beginStorageValue = 5, finishStorageValue = 6, count = 4000,
requiedLevelToReward = 10,
rewards = {'exp', 3605100, 'cash', 800000, 'item', 6132}},
['hero'] = {storage = 9996, beginStorageValue = 7, finishStorageValue = 8, count = 5000,
requiedLevelToReward = 10,
rewards = {'exp', 1070100, 'cash', 300000, 'item', 2491, 'item', 2487, 'item', 2488, 'item', 2519}},
['black knight'] = {storage = 9995, beginStorageValue = 9, finishStorageValue = 10, count = 5000,
requiedLevelToReward = 10,
rewards = {'exp', 1605100, 'cash', 800000, 'item', 2496}},
['behemoth'] = {storage = 9994, beginStorageValue = 11, finishStorageValue = 12, count = 3000,
requiedLevelToReward = 10,
rewards = {'exp', 3605100, 'cash', 800000, 'item', 6132}},
['enlightened of the cult'] = {storage = 9993, beginStorageValue = 13, finishStorageValue = 14, count = 1000,
requiedLevelToReward = 10,
rewards = {'exp', 3905900, 'cash', 500000, 'item', 9941}},
['bog raider'] = {storage = 9992, beginStorageValue = 15, finishStorageValue = 16, count = 1550,
requiedLevelToReward = 10,
rewards = {'exp', 2605100, 'cash', 450000, 'item', 2506}},
['cyclops smith'] = {storage = 9991, beginStorageValue = 17, finishStorageValue = 18, count = 150,
requiedLevelToReward = 10,
rewards = {'exp', 30000, 'cash', 100000}},
['destroyer'] = {storage = 9990, beginStorageValue = 19, finishStorageValue = 20, count = 1050,
requiedLevelToReward = 10,
rewards = {'exp', 2000000, 'cash', 150000}},
['diabolic imp'] = {storage = 9989, beginStorageValue = 21, finishStorageValue = 22, count = 11000,
requiedLevelToReward = 10,
rewards = {'exp', 9168750, 'cash', 1000000, 'item', 9933, 'smsPoints', 100}},
['old mad pumpkin'] = {storage = 9988, beginStorageValue = 23, finishStorageValue = 24, count = 1,
requiedLevelToReward = 10,
rewards = {'exp', 13000000, 'cash', 1000000, 'smsPoints', 200}},
['ferumbras'] = {storage = 9987, beginStorageValue = 25, finishStorageValue = 26, count = 6000,
requiedLevelToReward = 10,
rewards = {'exp', 3451000, 'cash', 350000, 'item', 8300}},
['fury'] = {storage = 9986, beginStorageValue = 27, finishStorageValue = 28, count = 3600,
requiedLevelToReward = 10,
rewards = {'exp', 4456000, 'cash', 250000, 'item', 11302}},
['evolution fury'] = {storage = 9985, beginStorageValue = 29, finishStorageValue = 30, count = 25,
requiedLevelToReward = 10,
rewards = {'exp', 10000000, 'cash', 1100000, 'item', 8865, 'item', 8890}},
['ghastly dragon'] = {storage = 9984, beginStorageValue = 31, finishStorageValue = 32, count = 2500,
requiedLevelToReward = 10,
rewards = {'exp', 600000, 'item', 11301, 'item', 11304}},
['grim reaper'] = {storage = 9983, beginStorageValue = 33, finishStorageValue = 34, count = 5550,
requiedLevelToReward = 10,
rewards = {'exp', 8685450, 'cash', 800000, 'item', 7958}},
['giant spider'] = {storage = 9982, beginStorageValue = 35, finishStorageValue = 36, count = 15000,
requiedLevelToReward = 10,
rewards = {'exp', 3605100, 'cash', 800000, 'item', 6132}},
['hand of cursed fate'] = {storage = 9981, beginStorageValue = 37, finishStorageValue = 38, count = 2300,
requiedLevelToReward = 10,
rewards = {'exp', 9500000, 'cash', 150000, 'item', 8266}},
['hellfire fighter'] = {storage = 9980, beginStorageValue = 39, finishStorageValue = 40, count = 5000,
requiedLevelToReward = 10,
rewards = {'exp', 7500000, 'cash', 400000, 'item', 9776}},
['hellspawn'] = {storage = 9979, beginStorageValue = 41, finishStorageValue = 42, count = 3000,
requiedLevelToReward = 10,
rewards = {'exp', 2000100, 'cash', 100000}},
['hydra'] = {storage = 9978, beginStorageValue = 43, finishStorageValue = 44, count = 9000,
requiedLevelToReward = 10,
rewards = {'exp', 5550000, 'cash', 300000, 'item', 2469, 'item', 3983}},
['ice golem'] = {storage = 9977, beginStorageValue = 45, finishStorageValue = 46, count = 1000,
requiedLevelToReward = 10,
rewards = {'exp', 3605100, 'cash', 600000, 'item', 8300}},
['infernalist'] = {storage = 9976, beginStorageValue = 47, finishStorageValue = 48, count = 2550,
requiedLevelToReward = 10,
rewards = {'exp', 6000000, 'cash', 200000, 'item', {2157,15}}},
['juggernaut'] = {storage = 9975, beginStorageValue = 49, finishStorageValue = 50, count = 500,
requiedLevelToReward = 10,
rewards = {'exp', 10000, 'cash', 20000}},
['morgaroth'] = {storage = 9974, beginStorageValue = 51, finishStorageValue = 520, count = 50,
requiedLevelToReward = 10,
rewards = {'exp', 12500000, 'cash', 900000, 'item', {8300,2}, 'item', 9777}},
['medusa'] = {storage = 9973, beginStorageValue = 53, finishStorageValue = 54, count = 7000,
requiedLevelToReward = 10,
rewards = {'exp', 5550000, 'cash', 200000, 'item', 8850}},
['pelzacz'] = {storage = 9972, beginStorageValue = 55, finishStorageValue = 56, count = 50,
requiedLevelToReward = 10,
rewards = {'exp', 14000000, 'cash', 1400000, 'item', {8300,5}, 'item', {2157,15}}},
['hellhound'] = {storage = 9971, beginStorageValue = 57, finishStorageValue = 58, count = 5500,
requiedLevelToReward = 10,
rewards = {'exp', 8000000, 'cash', 400000, 'item', 7450}},
['plaguesmith'] = {storage = 9970, beginStorageValue = 59, finishStorageValue = 60, count = 2500,
requiedLevelToReward = 10,
rewards = {'exp', 6355000, 'cash', 150000, 'item', 8925}},
['predator'] = {storage = 9969, beginStorageValue = 61, finishStorageValue = 62, count = 1,
requiedLevelToReward = 10,
rewards = {'exp', 25000000, 'cash', 1000000, 'item', {2157,25}, 'item', {8300,5}, 'item', {9941,5}}},
['rook spawn'] = {storage = 9968, beginStorageValue = 63, finishStorageValue = 64, count = 50,
requiedLevelToReward = 10,
rewards = {'exp', 11000000, 'cash', 200000, 'item', 8903, 'smsPoints', 200}},
['serpent spawn'] = {storage = 9967, beginStorageValue = 65, finishStorageValue = 66, count = 2000,
requiedLevelToReward = 10,
rewards = {'exp', 7605100, 'cash', 100000}},
['undead dragon'] = {storage = 9966, beginStorageValue = 67, finishStorageValue = 68, count = 3000,
requiedLevelToReward = 10,
rewards = {'exp', 8500000, 'cash', 750000, 'item', 6433}},
['warlock'] = {storage = 9965, beginStorageValue = 69, finishStorageValue = 70, count = 3000,
requiedLevelToReward = 10,
rewards = {'exp', 6000000, 'cash', 200000, 'item', {2157,15}}},
['demon'] = {storage = 9964, beginStorageValue = 71, finishStorageValue = 72, count = 5000,
requiedLevelToReward = 10,
rewards = {'exp', 9505100, 'cash', 800000, 'smsPoints', 200, 'item', 10518, 'item', 6529}},
['yeti'] = {storage = 9963, beginStorageValue = 73, finishStorageValue = 74, count = 2500,
requiedLevelToReward = 10,
rewards = {'exp', 11000000, 'cash', 300000, 'smsPoints', 100, 'item', 6132, 'item', 9778}},
['azerus'] = {storage = 9962, beginStorageValue = 75, finishStorageValue = 76, count = 50,
requiedLevelToReward = 10,
rewards = {'exp', 15000000, 'cash', 100000, 'item', {2157,10}, 'item', 9776, 'item', 9777, 'item', 9778}},
['wyrm'] = {storage = 9961, beginStorageValue = 77, finishStorageValue = 78, count = 3000,
requiedLevelToReward = 10,
rewards = {'exp', 3000000, 'cash', 200000, 'item', 8908}},
['defiler'] = {storage = 9960, beginStorageValue = 79, finishStorageValue = 80, count = 5550,
requiedLevelToReward = 10,
rewards = {'exp', 8000000, 'cash', 700000, 'item', {8300,2}, 'item', 8909}},
['nightmare'] = {storage = 9959, beginStorageValue = 81, finishStorageValue = 82, count = 8000,
requiedLevelToReward = 10,
rewards = {'exp', 8000000, 'cash', 350000, 'item', 6391}},
}

mainStorage = 12155

function checkInfoAboutTask(tableTask)
local message = ''
for i = 1, #tableTask/2 do
local rewardType, rewardCount = tableTask[i*2-1], tableTask[i*2]
if rewardType == 'item' and type(rewardCount) == 'table' then
for item = 1, #rewardCount, 2 do
local rewardItemId, rewardItemCount = rewardCount[item*2-1], rewardCount[item*2]
message = message .. ('* ' .. rewardItemCount .. 'x ' .. getItemNameById(rewardItemId)) .. '\n'
end
else
message = message .. ((rewardType == 'item' and '* ' .. getItemNameById(rewardCount)) or
(rewardType == 'exp' and '* ' .. rewardCount .. ' Experience ') or
(rewardType == 'cash' and '* ' .. rewardCount .. ' Money ') or
(rewardType == 'smsPoints' and '* ' .. rewardCount .. ' Sms points ')) .. '\n'
end
end
return message
end

function doAddExp(cid, amount)
return doSendAnimatedText(getThingPos(cid), amount, COLOR_WHITE) and doPlayerAddExperience(cid, amount) or false
end
]]></config>

<talkaction words="!task" event="script"><![CDATA[
domodlib('talkactionTask_conf')
function onSay(cid, words, param, channel)
if getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have a PZ! You have to get rid of it. Somehow.')
return false
end
local taskMenu, message = task[param:lower()], ''
if taskMenu and (taskMenu.potionTask and getCreatureStorage(cid, taskMenu.storage) == -1 or getCreatureStorage(cid, mainStorage) < 1) then
if(canGetOnlyOneTime and getCreatureStorage(cid, taskMenu.storage) > 0) or taskMenu.potionTask and getCreatureStorage(cid, taskMenu.storage) > taskMenu.count then
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Already you have made this task!')
end
if taskMenu.potionTask and getCreatureStorage(cid, taskMenu.storage) > -1 then
return true
else
doCreatureSetStorage(cid, mainStorage, taskMenu.beginStorageValue)
end
doCreatureSetStorage(cid, taskMenu.storage, 0)
return doPlayerPopupFYI(cid, 'The decision taken, your task is to '..(taskMenu.potionTask and 'use' or 'kill')..' - ' .. taskMenu.count.. ' ' ..param:lower().. (taskMenu.count > 1 and 's' or '') .. '\nRewards which you receive for finishing this task:\n' .. checkInfoAboutTask(taskMenu.rewards) .. (taskMenu.potionTask and '' or 'If you want to abort the current job enough that you use the command "!task cancel".\n')..'If you want to know about the current job simply use the command "!task info"\nIf you wish to receive a prize for the job simply use the command !task reward\nHave Fun ^^')
elseif isInArray({'cancel', 'delete', 'abort'}, param:lower()) and getCreatureStorage(cid, mainStorage) > 0 then
for _, v in pairs(task) do
if not v.potionTask and getCreatureStorage(cid, v.storage) >= 0 then
doCreatureSetStorage(cid, mainStorage, -1)
doCreatureSetStorage(cid, v.storage, -1)
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You canceled the current task.')
end
end
elseif isInArray({'reward', 'end', 'finish'}, param:lower()) then
local rewards, showMessage = 'Items that you got as a reward is: ', false
for _, v in pairs(task) do
if (v.potionTask and getCreatureStorage(cid, v.storage) == v.count or getCreatureStorage(cid, mainStorage) == v.finishStorageValue) then
showMessage = true
if not v.potionTask then
doCreatureSetStorage(cid, mainStorage, -1)
else
doCreatureSetStorage(cid, v.storage, v.count + 1)
end
if not v.requiedLevelToReward or v.requiedLevelToReward >= getPlayerLevel(cid) then
for i = 1, #v.rewards/2 do
local rewardType, rewardCount = v.rewards[i*2-1], v.rewards[i*2]
if rewardType == 'item' and type(rewardCount) == 'table' and #rewardCount > 1 then
for item = 1, #rewardCount / 2 do
local rewardItemId, rewardItemCount = rewardCount[item*2-1], rewardCount[item*2]
rewards = rewards .. rewardItemCount .. 'x ' .. getItemNameById(rewardItemId) .. ', '
doPlayerAddItem(cid, rewardItemId, rewardItemCount, true)
end
else
rewards = rewards .. rewardCount .. 'x ' .. (rewardType == 'item' and getItemNameById(rewardCount) or rewardType == 'exp' and 'experience' or rewardType == 'cash' and 'money' or rewardType == 'smsPoints' and 'sms points') .. ', '
if rewardType == 'item' then
doPlayerAddItem(cid, rewardCount, 1, true)
elseif rewardType == 'exp' then
doAddExp(cid, rewardCount)
elseif rewardType == 'cash' then
doPlayerAddMoney(cid, rewardCount)
elseif rewardType == 'smsPoints' then
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. rewardCount .. " WHERE `name` = '" .. getAccountByName(getCreatureName(cid)) .. "' LIMIT 1;")
end
end
end
else
rewards = 'Your experience level is too high to be able to receive the reward.'
end
end
end
return showMessage and doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string.sub(rewards, 1, string.len(rewards) - 1)..'.')
else
local message = 'List of tasks:'
for k, v in pairs(task) do
message = message .. '\n' .. (v.potionTask and 'Using any potion ' .. v.count .. ' times.' or 'Kill ' .. v.count .. ' ' .. k:lower() .. (v.count > 1 and 's' or ''))

if isInArray((v.potionTask and {'potion','potions'} or {'info', 'information', 'details'}), param:lower()) and (v.potionTask and getCreatureStorage(cid, v.storage) >= 0 or getCreatureStorage(cid, mainStorage) > 0) then
if (v.potionTask and getCreatureStorage(cid, v.storage) <= v.count or isInArray({v.finishStorageValue, v.beginStorageValue}, getCreatureStorage(cid, mainStorage))) then
return doPlayerPopupFYI(cid, 'Your current task is to '..(v.potionTask and 'use' or 'kill')..' - ' .. v.count.. ' ' ..k:lower().. (v.count > 1 and 's' or '') .. '\nYou have killed ' .. getCreatureStorage(cid, v.storage) .. ' of ' .. v.count .. ' ' .. k:lower() .. (v.count == 1 and '' or 's') .. '. You must kill ' .. v.count - getCreatureStorage(cid, v.storage) .. ' ' .. k:lower() .. (v.count == 1 and '' or 's') .. ' yet\nRewards which you receive for finishing this task:\n' .. checkInfoAboutTask(v.rewards))
end
end
end

return doPlayerPopupFYI(cid, message)
end
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Wrong command!')
end
]]></talkaction>

<event type="kill" name="talkactionTask" event="script"><![CDATA[
domodlib('talkactionTask_conf')
function onKill(cid, target)
if isPlayer(target) or getCreatureMaster(target) or isNpc(target) then
return true
end
for k, v in pairs(task) do
if k:lower() == getCreatureName(target):lower() then
if getCreatureStorage(cid, mainStorage) == v.beginStorageValue then
if getCreatureStorage(cid, v.storage) < v.count then
doCreatureSetStorage(cid, v.storage, getCreatureStorage(cid, v.storage) + 1)
s = 'You killed ' .. getCreatureStorage(cid, v.storage) .. ' of ' .. v.count .. ' ' .. k:lower() .. (v.count == 1 and '' or 's') .. '.'
if getCreatureStorage(cid, v.storage) == v.count then
doCreatureSetStorage(cid, mainStorage, v.finishStorageValue)
s = 'Congratulations! You have killed enough '.. k:lower() ..'.'
end
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, s)
end
end
end
end
return true
end
]]></event>

<event type="login" name="taskEventLogin" event="script"><![CDATA[

function onLogin(cid)
registerCreatureEvent(cid, 'talkactionTask')
return true
end
]]></event>
</mod>[/lua]
 
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

od?wie?am, bardziej mi chodzi?o o npc z taskami
 
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

REFRESH Serio nikt nie ma npc z taskami na tfs 0.4 ?
 
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

Nie wiem te? co? nie dzia?a, zabijam 1 trolla wyskakuje "15:47 Congratulations! You have killed enough troll.". Id? do npc "15:47 Grizzly Adams: Current 0 Trolls killed, you need to kill 100." wtf ?
 
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

Nie wiem te? co? nie dzia?a, zabijam 1 trolla wyskakuje "15:47 Congratulations! You have killed enough troll.". Id? do npc "15:47 Grizzly Adams: Current 0 Trolls killed, you need to kill 100." wtf ?


Masz tutaj to powinno dzia?a?:

data/npc/script/Grizzly Adams.lua :

[LUA]local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}

local data = {
[14007] = {'crocodile', 'Happy hunting, old chap! Come back to me when you are through with your task.', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u crocodiles. Come back to me when you are done.', 'Spiffing work, old chap. Now I have a special task for you. Recently several citizens of Port Hope have vanished. It is rumoured that they were killed by a crocodile. The people call it \'Snapper\'. Hunt down and kill that evil man eating beast.', 800, 1, 'Snapper', },
[14008] = {'tarantula', 'Happy hunting, old chap! Come back to me when you are through with your task.', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u tarantulas. Come back to me when you are done.', 'Nicely done! Now I shall assign you a special task. Rumour has it that there is an ancient and evil tarantula who preys on humans. She is called \'Hide\'. Track her down and kill her! Good luck, old chap.', 1500, 1, 'Hide'},
[14009] = {'carniphila', 'Good show, old chap! Speak to me again when you are done hunting.', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u carniphilas. Come back to me when you are done.', 'That took some time, huh? Good hunting though. If you\'re up for another hunting mission just ask me for a {task}.', 1500, 1},
[14010] = {'stone golem', 'Happy hunting, friend! When you have finished hunting, return here. ', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u stone golems. Come back to me when you are done.', 'Good show, old chap. If you\'re up for another hunting mission just ask me for a task.', 2000, 1},
[14011] = {'mammoth', 'Happy hunting, friend! Come back to me when you are done hunting.', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u mammoths. Come back to me when you are done.', 'Jolly good job you did there, but now I have a special task for you. The citizens of Svargrond live in fear because of a frightfully bad-tempered mammoth they call \'Blood Tusk\'. Go there and put an end to him. Happy hunting!', 'Bloodtusk', 4000, 1},
[14012] = {'ice golem', 'Happy hunting, friend! Come back to me when you are done hunting.', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u ice golems. Come back to me when you are done.', 'As i see it, you need more of a challenge! I have heard that there is an ice golem the hunters in Svargrond call \'Shardhead\'. He is an extremely dangerous example of his kind! I believe you are equal to the task, %s!', 15000, 1, 'Shardhead'},
[14013] = {'quara constrictor scout', 'Happy hunting, friend! Come back to me when you are done hunting.', 'Alright, then you should go on with your task. You have already killed %u quara scouts in total. Come back to me when you are done.', 'Jolly good show! What a hunter! If you\'re up for another hunting mission just ask me for a {task}.', 10000, 1}, -- ?
[14014] = {'quara constrictor', 'Happy hunting, friend! Come back to me when you are done hunting.', 'Alright, then you should go on with your task. You have already killed %u underwater quaras in total. Come back to me when you are done.', 'Superb work. However, there is something else I want you to do. It is said that there is a Quara general named \'Thul\' who is responsible for the attacks on Liberty Bay. Find him and kill him and bring peace to Liberty bay!', 12000, 1, 'Thul'}, -- OK
[14015] = {'water elemental', 'Happy hunting, my old mocker! Come back to me when you are done hunting. ', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u water elementals. Come back to me when you are done.', 'Fantastic! If you\'re up for another hunting mission just ask me for a {task}.', 7000, 1},
[14016] = {'earth elemental', 'Happy hunting, friend! Come back to me when you are done hunting. ', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u earth elementals. Come back to me when you are done.', 'Fantastic! If you\'re up for another hunting mission just ask me for a {task}.', 10000, 1},
[14017] = {'energy elemental', 'Happy hunting, pal! Come back to me when you are done hunting. ', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u energy elementals. Come back to me when you are done.', 'Fantastic! If you\'re up for another hunting mission just ask me for a {task}.', 10000, 1},
[14018] = {'fire elemental', 'Happy hunting, old friend! Come back to me when you are done hunting. ', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u fire elementals. Come back to me when you are done.', 'Fantastic! If you\'re up for another hunting mission just ask me for a {task}.', 7000, 1},
[14019] = {'mutated rat', 'Happy hunting, old chap! Come back to me when you are done hunting. ', 'Alright, then stop dilly dallying here and go on with your task. You have already exterminated %u mutated rats. Come back to me when you are done.', {'Very good work, old chap. Lucky you are here - I have just been told of a task which is perfect for you. ...', 'The Yalaharians are having a spot of bother with a huge mutated rat. They call it \'Esmeralda\' and you should find her somewhere in the sewers. Good hunting!'}, 10000, 1, 'Esmeralda'}, -- OK
[14020] = {'giant spider', 'Jolly good show! Come back to me when you are done hunting. ', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u giant spiders. Come back to me when you are done.', 'Well THAT was a hunt. Good job. Have you heared about \'The Old Widow\'? It must have a hideout. Try to find it and slay the beast.', 5000, 1, 'Old Widow'},
[14021] = {'hydra', 'Happy hunting, old chap! Come back to me when you are done hunting.', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u hydras. Come back to me when you are done.', {'With Nornur the God of Fate as my witness, you are truly born to hunt. If anyone can do this task, you can! Listen: ...', 'It is said that the Lizards of Chor are training hydras for attacks against us. They have already successfully bred a hydra named \'The Many\'. Find her and kill her!'}, 0, 2, 'Many'},
[14001] = {'sea serpent', 'Happy hunting, old chap! Come back to me when you are done hunting.', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u sea serpents. Come back to me when you are done.', 'Good job, old chap! Are you up for a challenge? Have you heard of the legendary sea serpent called \'The Leviathan\'? It must be somewhere near the spot you found. This is a true test of your hunting skills - find it and kill it. Good hunting!', 0, 2, 'Leviathan'},
[14022] = {'behemoth', 'Happy hunting, old chap! Come back to me when you are done hunting.', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u behemoths. Come back to me when you are done.', 'Such marvellous hunting skills! Perhaps you can help me with this one. Have you heard about \'Stonecracker\'? ...', 0, 2, 'Stonecracker'}, -- OK
[14002] = {'serpent spawn', 'Happy hunting, old chap! Come back to me when you are done hunting.', 'Alright, then return to your duties! Day light is a-wasting! You have already smashed %u serpent spawns. Come back to me when you are done.', 'My - you can be proud of yourself! However, you\'re not finished yet. There are rumours about a being called \'The Noxious Spawn\' which was seen deep down in the ruins of Banuta. Try to find its hideout.', 0, 2, 'Noxious Spawn'},
}

local curTask = 14500
local points = 14501
local rank = 14502
local questLog = 14503
local tiquanda = 14505
local demodras = 14506

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 greetCallback(cid)
local cur, r, msg = getPlayerStorageValue(cid, points), getPlayerStorageValue(cid, rank)
if cur >= 5 and r < 1 then
msg = 'Welcome back |PLAYERNAME|. You have completed 5 tasks for our society. Ask me for a {promotion} to advance your rank!'
elseif cur >= 10 and r < 2 then
msg = 'Good to see you again |PLAYERNAME|. You have completed 10 tasks for our society. Ask me for a {promotion} to advance your rank!'
elseif cur >= 20 and r < 3 then
msg = 'Salutations |PLAYERNAME|. You have completed 20 tasks for our society. Ask me for a {promotion} to advance your rank!'
elseif cur >= 30 and r < 4 then
msg = 'Always good to welcome you back, |PLAYERNAME|. You have completed 30 tasks for our society. Ask me for a {promotion} to advance your rank!'
elseif cur >= 50 and r < 5 then
msg = 'By the gods....50 hunting tasks....this is astounding! Ask me for a {promotion} to advance your rank! And while you are here, I also have another {special} task for you.'
else
msg = 'Welcome back |PLAYERNAME|. What brings you here this time?'
end
npcHandler:setMessage(MESSAGE_GREET, msg)
Topic[cid] = 0
return true
end

function creatureSayCallback(cid, _type, msg)
if not npcHandler:isFocused(cid) then
return false
end

if msgcontains(msg, 'task') then
local cur = getPlayerStorageValue(cid, curTask)
if cur < 1 or (cur ~= 14006 and getPlayerStorageValue(cid, cur) == tasks[data[cur][1]].amount + 1 and getPlayerStorageValue(cid, cur + 100) == -1) then
local v, lvl = '', getPlayerLevel(cid)
if lvl < 50 then
v, Topic[cid] = '{Crocodiles}, {tarantulas}, {carniphilas}, {stone golems} or {mammoths}', 1
elseif lvl < 90 then
v, Topic[cid] = '{Ice golems}, {Quara}, {elementals}, {mutated rats} or {giant spiders}', 2
elseif 90 <= lvl then
v, Topic[cid] = '{Hydras}, {sea serpents}, {behemoths}' .. (getPlayerStorageValue(cid, rank) == 5 and ', {serpent spawns} or {demons}' or ' or {serpent spawns}'), 3
end
selfSay('All right, what would you like to hunt? ' .. v .. '?', cid)
elseif cur == 14006 and getPlayerStorageValue(cid, cur) == tasks['demon'].amount then
selfSay({'Such derring do deserves a special reward! Take this holy icon. It neutralizes great evil and gives you access to areas which are protected by those forces. But remember ...', 'This is a one time opportunity! You won\'t get the holy icon twice.'}, cid)
doPlayerAddItem(cid, 10305, 1)
setPlayerStorageValue(cid, curTask, -1)
elseif cur ~= 14006 and getPlayerStorageValue(cid, cur) == tasks[data[cur][1]].amount and getPlayerStorageValue(cid, cur + 100) < 1 then
local tmp
if type(data[cur][4]) == 'table' then
tmp = {}
for i = 1, #data[cur][4] do
tmp = string.format(data[cur][4], getCreatureName(cid))
end
end
selfSay(tmp or string.format(data[cur][4], getCreatureName(cid)), cid)
if data[cur][5] > 0 then
doPlayerAddExp(cid, data[cur][5])
doSendAnimatedText(getThingPos(cid), data[cur][5], 215)
end
if data[cur][6] then
setPlayerStorageValue(cid, points, getPlayerStorageValue(cid, points) + 1)
end
if data[cur][7] then -- special task (he sends you to kill the boss)
setPlayerStorageValue(cid, cur + 100, 1)
end
setPlayerStorageValue(cid, cur, getPlayerStorageValue(cid, cur) + 1)
Topic[cid] = 0
elseif getPlayerStorageValue(cid, cur + 100) == 2 then
setPlayerStorageValue(cid, points, getPlayerStorageValue(cid, points) + (isInArray({14001, 14002, 14021, 14022}, cur) and 2 or 1))
selfSay('Fantastic! If you\'re up for another hunting mission just ask me for a {task}.', cid)
setPlayerStorageValue(cid, cur + 100, -1)
else
selfSay(getPlayerStorageValue(cid, cur + 100) < 1 and 'You are not done with your task yet. Come back to me when you are. Or do you want to abort your task to start a different one?' or string.format('Find %s\'s hideout. I hope for you that you are skilled enough to kill him. Or do you want to abort your task to start a different one?', data[cur][7]), cid)
Topic[cid] = 4
end
elseif msgcontains(msg, 'trade') and getPlayerStorageValue(cid, rank) >= 1 then
local items = {
{name='antlers', id=11208, sell=50},
{name='bloody pincers', id=10549, sell=50},
{name='crab pincers', id=11183, sell=35},
{name='cyclops toe', id=10573, sell=55},
{name='frosty ear of a troll', id=10564, sell=30},
{name='hydra head', id=11193, sell=600},
{name='lancer leetle shell', id=11366, sell=80},
{name='mutated bat ear', id=10578, sell=420},
{name='sabretooth', id=11222, sell=400},
{name='sandcrawler shell', id=11367, sell=20},
{name='scarab pincers', id=10547, sell=280},
{name='terramite legs', id=11365, sell=60},
{name='terramite shell', id=11363, sell=170},
{name='terrorbird beak', id=11184, sell=95},
{name='cyclops trophy', id=7398, sell=500},
{name='minotaur trophy', id=7401, sell=500},
}
if getPlayerStorageValue(cid, rank) >= 3 then
table.insert(items, {name='deer trophy', id=7397, sell=3000})
table.insert(items, {name='lion trophy', id=7400, sell=3000})
table.insert(items, {name='wolf trophy', id=7394, sell=3000})
end
if getPlayerStorageValue(cid, rank) >= 4 then
table.insert(items, {name='behemoth trophy', id=7396, sell=20000})
table.insert(items, {name='demon trophy', id=7393, sell=40000})
table.insert(items, {name='dragon lord trophy', id=7399, sell=10000})
table.insert(items, {name='demon backpack', id=10518, buy=1000})
end
openShopWindow(cid, items,
function(cid, itemid, subType, amount, ignoreCap, inBackpacks)
customCallbackOnBuy(cid, itemid, subType, amount, ignoreCap, inBackpacks, items)
end,
function(cid, itemid, subType, amount, ignoreCap, inBackpacks)
customCallbackOnSell(cid, itemid, subType, amount, ignoreCap, inBackpacks, items)
end
)
selfSay("Alright, show me what you've got.", cid)
elseif Topic[cid] == 4 then
local cur = getPlayerStorageValue(cid, curTask)
if msgcontains(msg, 'yes') or msgcontains(msg, 'abort') then
selfSay('Alright, as you wish. Ask me for a task if you are interested in a different hunting mission.', cid)
setPlayerStorageValue(cid, cur, -1)
setPlayerStorageValue(cid, curTask, -1)
if getPlayerStorageValue(cid, cur + 100) > 0 then
setPlayerStorageValue(cid, cur + 100, -1)
end
else
selfSay(cur == 14006 and string.format('Alright, then stop dilly dallying here and go on with your task. You have already exterminated %u demons. Come back to me when you are done.', getPlayerStorageValue(cid, cur)) or getPlayerStorageValue(cid, cur + 100) < 1 and string.format(data[getPlayerStorageValue(cid, curTask)][3], getPlayerStorageValue(cid, cur)) or 'Alright, then you should go on with your task.', cid)
end
Topic[cid] = 0
elseif Topic[cid] == 1 and msgcontains(msg, 'crocodile') then
local v = tasks['crocodile']
selfSay('They are a nuisance! You\'ll find them here in the jungle near the river. Hunt ' .. v.amount .. ' crocodiles and you\'ll get a nice reward. Interested?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 1 and msgcontains(msg, 'tarantula') then
local v = tasks['tarantula']
selfSay('There is a veritable plague of tarantulas living in the caves north of the river to the east. Can you squish ' .. v.amount .. ' tarantulas for the Hunting Elite. What do you say?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 1 and msgcontains(msg, 'carniphila') then
local v = tasks['carniphila']
selfSay('Damn walking weed-thingies! You\'ll find them deeper in the jungle. Weed out ' .. v.amount .. ' carniphilas for our society. Alright?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 1 and msgcontains(msg, 'golem') then
local v = tasks['stone golem']
selfSay('They can be found all over Tibia. You\'ll find them in mountain caves or rocky dungeons. Hunt ' .. v.amount .. ' of them and come back to me. Understood?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 1 and msgcontains(msg, 'mammoth') then
local v = tasks['mammoth']
selfSay('This particular species are found in Svargrond. Impressive beasts, but you wouldn\'t want one in your back garden. Hunt ' .. v.amount .. ' of them. Alright?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 2 and msgcontains(msg, 'golem') then
local v = tasks['ice golem']
selfSay('The ice golems on the glacier of Hrodmir are becoming a threat to the civilians in Svargrond. Travel to the Ice Islands and hunt ' .. v.amount .. ' Ice Golems. Do you accept this task?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 2 and msgcontains(msg, 'quara') then
selfSay('There are different types of quaras. The weaker {scouts} which can be found on Malada, one of the shattered Islands and the more skilled {underwater} kind which can be found in Calassa and some smaller colonies. Which one do you wish to hunt?', cid)
Topic[cid] = 5
elseif Topic[cid] == 5 and msgcontains(msg, 'scout') then
local v = tasks['quara constrictor scout']
selfSay('Good choice! Hunt down those Quara scouts - remember no less than ' .. v.amount .. '! Focus! Do you accept this task?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 5 and msgcontains(msg, 'underwater') then
local v = tasks['quara constrictor']
selfSay('As you wish. Seek out a Quara settlement and hunt ' .. v.amount .. ' Quaras, it doesn\'t matter which type you hunt. Alright?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 2 and msgcontains(msg, 'elemental') then
selfSay({'Since the creation of the elemental shrines and the portals, the curtain separating the worlds is thin, allowing the elementals to surge into our world. They have to be contained. ...', 'The choice as to which kind of elementals you hunt is yours, as long as they are in the lands of Tibia. Hunt 70 {earth}, {energy}, {fire} or {water} elementals. Which one do you choose?'} , cid)
Topic[cid] = 6
elseif Topic[cid] == 6 and msgcontains(msg, 'water') then
local v = tasks['water elemental']
selfSay('Alright, go hunt ' .. v.amount .. ' water elementals or massive water elementals. Don\'t forget your umbrella! Alright?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 6 and msgcontains(msg, 'earth') then
local v = tasks['earth elemental']
selfSay('Good choice! I need you to slay ' .. v.amount .. ' earth elementals or massive earth elementals. There are some in the so called Taboo-area in the eastern jungle of Tiquanda and I heard about a cave in Edron where you\'ll find them. Are you game?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 6 and msgcontains(msg, 'energy') then
local v = tasks['energy elemental']
selfSay('A brave hunter! Kill ' .. v.amount .. ' energy elementals or massive energy elementals. You\'ll find them in the mountains between Darama and Tiquanda. Are you sure you want to do this?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 6 and msgcontains(msg, 'fire') then
local v = tasks['fire elemental']
selfSay('Don\'t get burnt! Your challenge, should you choose to accept it, is to kill ' .. v.amount .. ' fire elementals or massive fire elementals. Are you ready?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 2 and msgcontains(msg, 'mutated rat') then
local v = tasks['mutated rat']
selfSay('Recently, I heard of a disturbing development in Yalahar - a plague of monstrous Mutated rats! If they were to spread to the rest of Tibia.. <shudders> My task for you is to contain their numbers in Yalahar. Hunt ' .. v.amount .. ' of them. What do you say?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 2 and msgcontains(msg, 'giant spider') then
local v = tasks['giant spider']
selfSay('Never liked spiders. Entirely too many legs. And I always find them in my bath! Those nasty creepy crawlies are a threat to the hygiene of every living being in Tibia. Hunt ' .. v.amount .. ' of them. Okay?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 3 and msgcontains(msg, 'hydra') then
local v = tasks['hydra']
selfSay('The hydras are located in the eastern jungle of Tiquanda and there are several mountain caves that are inhabited by them. Your task is to hunt a mere ' .. v.amount .. ' hydras. Are you willing to do that?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 3 and msgcontains(msg, 'sea serpent') then
local v = tasks['sea serpent']
selfSay({'The sea serpents are a threat to honest seafarers! Captain Haba knows where to find them. ...', 'Go to Svargrond and talk to him. ' .. v.amount .. ' sea serpents should be enough to reduce the threat - but not their young though! After all, they are an endangered species! Got it?'}, cid)
Topic[cid] = v.storage
elseif Topic[cid] == 3 and msgcontains(msg, 'behemoth') then
local v = tasks['behemoth']
selfSay('Behemoths must be kept away from the settlements at all costs. You\'ll find them east of here in the taboo-area or under the cyclopolis in Edron. Go there and hunt a few of them - shall we say... ' .. v.amount .. '? Are you up for that?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 3 and msgcontains(msg, 'serpent spawn') then
local v = tasks['serpent spawn']
selfSay('Very dangerous, nasty, slimey creatures. They live deep in the old ruins of Banuta. I think a mere ' .. v.amount .. ' serpent spawns should do the trick. What do you say?', cid)
Topic[cid] = v.storage
elseif Topic[cid] == 3 and getPlayerStorageValue(cid, rank) == 5 and msgcontains(msg, 'demon') and getPlayerStorageValue(cid, curTask) < 1 then
local v = tasks['demon']
selfSay('The spawn of pure evil must be erased from Tibia. You\'ll find demons lurking in the northern ruins of Edron as well as in some of other deeper dungeons of Tibia. We need to wipe them out! Slay ' .. v.amount .. ' demons for the Greater Good!', cid)
setPlayerStorageValue(cid, curTask, v.storage)
setPlayerStorageValue(cid, v.storage, 0)
Topic[cid] = 0
elseif Topic[cid] >= 14000 and msgcontains(msg, 'yes') then
selfSay(data[Topic[cid]][2], cid)
setPlayerStorageValue(cid, curTask, Topic[cid])
setPlayerStorageValue(cid, Topic[cid], 0)
if getPlayerStorageValue(cid, questLog) < 1 then
setPlayerStorageValue(cid, questLog, 1)
setPlayerStorageValue(cid, points, 0)
end
Topic[cid] = 0
elseif msgcontains(msg, 'special') and getPlayerStorageValue(cid, rank) == 5 then
local v, k = getPlayerStorageValue(cid, tiquanda), getPlayerStorageValue(cid, demodras)
if v < 1 then
if getPlayerLevel(cid) >= 90 then
setPlayerStorageValue(cid, tiquanda, 1)
selfSay({'Have you heard about {Tiquandas Revenge}? It is said that the jungle itself is alive and takes revenge for all the bad things people have done to it. ...', 'I myself believe that there is some truth in this clap trap. Something \'real\' which therefore must have a hideout somewhere. Go find it and take revenge yourself! Ask me about the {special} task when you\'re done.'}, cid)
else
selfSay('Your eagerness is commendable, and your rank within our hunting elite is great buuuut I\'m afraid you\'re a little bit too weak for the special tasks. Get more experience and the special tasks will be no match for you.', cid)
end
elseif v == 2 then
selfSay('Great achievement, old chap! You are an outstanding hunter, no doubt about it!', cid)
setPlayerStorageValue(cid, tiquanda, 3)
elseif v == 3 and k < 1 then
if getPlayerLevel(cid) >= 100 then
setPlayerStorageValue(cid, demodras, 1)
selfSay('This task is a very dangerous one. I want you to look for {Demodras}\' hideout. It might be somewhere under the {Plains of Havoc}. Good luck, old chap, come back in one piece and ask me about the {special} task when you\'re done.', cid)
else
selfSay('Your eagerness is commendable, and your rank within our hunting elite is great buuuut I\'m afraid you\'re a little bit too weak for the special tasks. Get more experience and the special tasks will be no match for you.', cid)
end
elseif k == 2 then
selfSay('Great achievement, old chap! You are an outstanding hunter, no doubt about it!', cid)
setPlayerStorageValue(cid, demodras, 3)
end
elseif msgcontains(msg, 'promotion') then
local cur, r, msg, exp, item = getPlayerStorageValue(cid, points), getPlayerStorageValue(cid, rank)
if cur >= 5 and r < 1 then
msg, exp = {'You have completed 5 tasks! Let me promote you to the first rank: Huntsman. Congratulations! ...', 'If you find any trophies that you don\'t need, feel free to ask me for a trade.'}, 5000
elseif cur >= 10 and r < 2 then
msg, exp = {'You have completed 10 hunting tasks. It\'s time for a promotion. You advance to the rank of \'Ranger\'. Congratulations! ...', 'Oh, I made a deal with Lorek. He ships Rangers from our society - and higher ranks of course - to Banuta, Chor or near the mountain pass to Darama. Just ask him for a passage.'}, 8000
elseif cur >= 20 and r < 3 then
msg, exp = {'Good show! You have completed 20 hunting tasks for the \'Paw and Fur - Hunting Elite. You have earned the right to join the ranks of those known as \'Big game hunter\'. Congratulations! ...', 'From now on I\'ll buy more trophies from you!'}, 10000
elseif cur >= 30 and r < 4 then
msg, exp, item = 'Spiffing! You have done 30 hunting tasks! From now on you can call yourself a \'Trophy hunter\'. As a reward I have this special backpack for you and in addition you can sell some more rare trophies to me.', 15000, 10518
elseif cur >= 50 and r < 5 then
msg, exp = 'Congratulations! You have made the highest rank: \'Elite hunter\'. If haven\'t yet done so ask me for the {special} task.', 30000
end
if msg then
selfSay(msg, cid)
setPlayerStorageValue(cid, rank, math.max(1, r + 1))
if exp then
doPlayerAddExp(cid, exp)
doSendAnimatedText(getThingPos(cid), exp, 215)
end
if item then
doPlayerAddItem(cid, item, 1)
end
end
end
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_FAREWELL, 'Happy hunting, old chap!')
npcHandler:setMessage(MESSAGE_WALKAWAY, 'Happy hunting, old chap!')
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())[/LUA]

i teraz data/npc zr?b plik xml o nazwie Grizzly Adams i dodaj tam to :

[XML]<?xml version="1.0" encoding="UTF-8"?>
<npc name="Grizzly Adams" script="data/npc/scripts/Grizzly Adams.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="144" head="97" body="97" legs="94" feet="97" addons="3"/>
<voices>
<voice text="Write Task to start a task with number one !" interval2="100" margin="1" yell="no"/>
</voices>
<parameters>
<parameter key="module_shop" value="1" />
<parameter key="shop_buyable" value="demon backpack,10518,1000;" />
<parameter key="shop_sellable" value="cyclops trophy,7398,500;minotaur trophy,7401,500;deer trophy,7397,3000;lion trophy,7400,3000;wolf trophy,7394,3000;behemoth trophy,7396,20000;demon trophy,7393,40000;dragon lord trophy,7399,10000;i,11208,50;i,10549,100;i,11183,35;i,10573,55;i,10564,30;i,11193,600;i,11366,80;i,10578,420;i,11222,400;i,11367,20;i,10547,280;i,11365,60;i,11363,170;i,11184,95" />
<parameter key="message_greet" value="Be greeted, noble |PLAYERNAME| and welcome to my hut."/>
<parameter key="message_farewell" value="Come back soon, noble |PLAYERNAME|."/>
<parameter key="message_walkaway" value="Come back soon, noble." />
<parameter key="message_sendtrade" value="Let's see what you got there." />
</parameters>

</npc>
[/XML]

A jak to nie b?dzie dzia?a? lub nie b?dzie Ci si? podoba? bo to jest npc bardziej pod real to masz tu jeszcze jednego:

data/npc tworzymy plik xml o nazwie Tasker albo jak tam chcesz :P i wklej :

[XML]<?xml version="1.0" encoding="UTF-8"?>

<npc name="Tasker" script="data/npc/scripts/tasker.lua" access="3" walkinterval="2000" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="144" head="97" body="97" legs="94" feet="97" addons="3"/>
</npc>[/XML]

teraz data/npc/script tworzymy plik lua o nazwie takiej samej u mnie tasker i wklejamy to :

[LUA]local tasks =
{
[27] = {questStarted = 1510, questStorage = 65000, killsRequired = 100, raceName = "Trolls", rewards = {first = {enable = true, type = "exp", values = 200}, second = {enable = true, type = "money", values = 200}, third = {enable = false, type = nil, values = {nil, nil}}}},

[28] = {questStarted = 1511, questStorage = 65001, killsRequired = 150, raceName = "Goblins", rewards = {first = {enable = true, type = "exp", values = 300}, second = {enable = true, type = "money", values = 250}, third = {enable = false, type = nil, values = {nil, nil}}}},

[3] = {questStarted = 1512, questStorage = 65002, killsRequired = 300, raceName = "Rotworms", rewards = {first = {enable = true, type = "exp", values = 1000}, second = {enable = true, type = "money", values = 400}, third = {enable = false, type = nil, values = {nil, nil}}}},

[4] = {questStarted = 1513, questStorage = 65003, killsRequired = 500, raceName = "Cyclops", rewards = {first = {enable = true, type = "exp", values = 3000}, second = {enable = true, type = "money", values = 800}, third = {enable = false, type = nil, values = {nil, nil}}}},

[5] = {questStarted = 1514, questStorage = 65004, killsRequired = 300, raceName = "Crocodiles", rewards = {first = {enable = true, type = "exp", values = 800}, second = {enable = true, type = "boss", values = THESNAPPER_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[6] = {questStarted = 1515, questStorage = 65005, killsRequired = 300, raceName = "Tarantulas", rewards = {first = {enable = true, type = "exp", values = 1500}, second = {enable = true, type = "boss", values = HIDE_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[7] = {questStarted = 1516, questStorage = 65006, killsRequired = 150, raceName = "Carniphilas", rewards = {first = {enable = true, type = "exp", values = 1500}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[8] = {questStarted = 1517, questStorage = 65007, killsRequired = 200, raceName = "Stone Golems", rewards = {first = {enable = true, type = "exp", values = 2000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[9] = {questStarted = 1518, questStorage = 65008, killsRequired = 300, raceName = "Mammoths", rewards = {first = {enable = true, type = "exp", values = 4000}, second = {enable = true, type = "boss", values = THEBLOODTUSK_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[10] = {questStarted = 1519, questStorage = 65009, killsRequired = 300, raceName = "Ice Golems", rewards = {first = {enable = true, type = "exp", values = 15000}, second = {enable = true, type = "boss", values = SHARDHEAD_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[11] = {questStarted = 1520, questStorage = 65010, killsRequired = 300, raceName = "Quaras Scout", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[12] = {questStarted = 1521, questStorage = 65011, killsRequired = 300, raceName = "Quaras", rewards = {first = {enable = true, type = "exp", values = 12000}, second = {enable = true, type = "boss", values = THUL_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[13] = {questStarted = 1522, questStorage = 65012, killsRequired = 70, raceName = "Water Elementals", rewards = {first = {enable = true, type = "exp", values = 7000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[14] = {questStarted = 1523, questStorage = 65013, killsRequired = 70, raceName = "Earth Elementals", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[15] = {questStarted = 1524, questStorage = 65014, killsRequired = 70, raceName = "Energy Elementals", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[16] = {questStarted = 1525, questStorage = 65015, killsRequired = 70, raceName = "Fire Elementals", rewards = {first = {enable = true, type = "exp", values = 7000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[17] = {questStarted = 1526, questStorage = 65016, killsRequired = 200, raceName = "Mutated Rats", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "boss", values = ESMERALDA_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[18] = {questStarted = 1527, questStorage = 65017, killsRequired = 500, raceName = "Giant Spiders", rewards = {first = {enable = true, type = "exp", values = 5000}, second = {enable = true, type = "boss", values = THEOLDWIDOW_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[19] = {questStarted = 1528, questStorage = 65018, killsRequired = 2000, raceName = "Hydras", rewards = {first = {enable = true, type = "boss", values = THEMANY_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[20] = {questStarted = 1529, questStorage = 65019, killsRequired = 2000, raceName = "Sea Serpents", rewards = {first = {enable = true, type = "boss", values = LEVIATHAN_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[21] = {questStarted = 1530, questStorage = 65020, killsRequired = 2000, raceName = "Behemoths", rewards = {first = {enable = true, type = "boss", values = STONECRACKER_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[22] = {questStarted = 1531, questStorage = 65021, killsRequired = 1500, raceName = "Serpents Spawn", rewards = {first = {enable = true, type = "teleport", values = THENOXIUSSPAWN_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[23] = {questStarted = 1532, questStorage = 65022, killsRequired = 500, raceName = "Green Djinns", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = MERIKHTHESLAUGHTERER_POSITION}}},

[24] = {questStarted = 1533, questStorage = 65023, killsRequired = 500, raceName = "Blue Djinns", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = FAHIMTHEWISE_POSITION}}},

[25] = {questStarted = 1534, questStorage = 65024, killsRequired = 3000, raceName = "Pirates", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = RANDOMPIRATEBOSS_POSITION}}},

[26]= {questStarted = 1535, questStorage = 65025, killsRequired = 3000, raceName = "Pirates", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = false, type = nil, values = {nil, nil}}}},

[1] = {questStarted = 1536, questStorage = 65026, killsRequired = 5000, raceName = "Minotaurs", rewards = {first = {enable = true, type = "boss", values = {x = 32359, y = 31789, z = 7), second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[5] = {questStarted = 1537, questStorage = 65027, killsRequired = 4000, raceName = "Magicians", rewards = {first = {enable = true, type = "boss", values = {x = 32613, y = 32791, z = 8}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[29] = {questStarted = 1538, questStorage = 65028, killsRequired = 1000, raceName = "Magicians", rewards = {first = {enable = true, type = "exp", values = 40000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[30] = {questStarted = 1539, questStorage = 65029, killsRequired = 6666, raceName = "Demons", rewards = {first = {enable = true, type = "storage", values = {65535, 1}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}}
}

local storage = 64521

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

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)

local s = getPlayerStorageValue(cid, storage)

if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
if msgcontains(msg, 'task') then

if(s < 1) then
doPlayerSetStorageValue(cid, storage, 1)
end

if tasks then
if(getPlayerStorageValue(cid, tasks.questStarted) < 1) then
if(getPlayerStorageValue(cid, tasks.creatureStorage) < 0) then
doPlayerSetStorageValue(cid, tasks.creatureStorage, 0)
end

if(getPlayerStorageValue(cid, tasks.questStorage) < 0) then
doPlayerSetStorageValue(cid, tasks.questStorage, 0)
end

doPlayerSetStorageValue(cid, tasks.questStarted, 1)
selfSay('You have started the task number ' .. getPlayerStorageValue(cid, storage) .. ', in this task you need to kill ' .. tasks.killsRequired .. ' ' .. tasks.raceName .. '.', cid)
else
selfSay('You are currently making task about ' .. tasks.raceName .. '.', cid)
end
else
print("[Warning - Error::Killing in the name of::Tasks config] Something is wrong.")
end

elseif msgcontains(msg, 'report') then
if tasks and tasks.questStarted > 0 then
if(getPlayerStorageValue(cid, tasks.creatureStorage) < 0) then
doPlayerSetStorageValue(cid, tasks.creatureStorage, 0)
end

if(getPlayerStorageValue(cid, tasks.questStorage) < 0) then
doPlayerSetStorageValue(cid, tasks.questStorage, 0)
end

if(getPlayerStorageValue(cid, tasks.questStorage) >= tasks.killsRequired) then
selfSay('Great!... you have finished the task number ' .. s .. '. Good job.', cid)
doPlayerSetStorageValue(cid, storage, s + 1)
if(tasks.rewards.first.enable) then
if(tasks.rewards.first.type == "boss") then
doTeleportThing(cid, tasks.rewards.first.values)
elseif(tasks.rewards.first.type == "exp") then
doPlayerAddExperience(cid, tasks.rewards.first.values)
elseif(tasks.rewards.first.type == "item") then
doPlayerAddItem(cid, tasks.rewards.first.values[1], tasks.rewards.first.values[2])
elseif(tasks.rewards.first.type == "money") then
doPlayerAddMoney(cid, tasks.rewards.first.values)
elseif(tasks.rewards.first.type == "storage") then
doPlayerSetStorageValue(cid, tasks.rewards.first.values[1], tasks.rewards.first.values[2])
end
end
if(tasks.rewards.second.enable) then
if(tasks.rewards.second.type == "boss") then
doTeleportThing(cid, tasks.rewards.second.values)
elseif(tasks.rewards.second.type == "exp") then
doPlayerAddExperience(cid, tasks.rewards.second.values)
elseif(tasks.rewards.second.type == "item") then
doPlayerAddItem(cid, tasks.rewards.second.values[1], tasks.rewards.second.values[2])
elseif(tasks.rewards.second.type == "money") then
doPlayerAddMoney(cid, tasks.rewards.second.values)
elseif(tasks.rewards.second.type == "storage") then
doPlayerSetStorageValue(cid, tasks.rewards.second.values[1], tasks.rewards.second.values[2])
end
end
if(tasks.rewards.third.enable) then
if(tasks.rewards.third.type == "boss") then
doTeleportThing(cid, tasks.rewards.third.values)
elseif(tasks.rewards.third.type == "exp") then
doPlayerAddExperience(cid, tasks.rewards.third.values)
elseif(tasks.rewards.third.type == "item") then
doPlayerAddItem(cid, tasks.rewards.third.values[1], tasks.rewards.third.values[2])
elseif(tasks.rewards.third.type == "money") then
doPlayerAddMoney(cid, tasks.rewards.third.values)
elseif(tasks.rewards.third.type == "storage") then
doPlayerSetStorageValue(cid, tasks.rewards.third.values[1], tasks.rewards.third.values[2])
end
end
else
selfSay('Current ' .. getPlayerStorageValue(cid, tasks.questStorage) .. ' ' .. tasks.raceName .. ' killed, you need to kill ' .. tasks.killsRequired .. '.', cid)
end
else
selfSay('You do not have started any task.', cid)
end
end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())[/LUA]

Musi dzia?a?. Pozdro :)
 
Ostatnia edycja:
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

W pierwszym skrypcie nie mog? wzi?? taska, npc nie odpisuj?.

14:43 tak [15]: hi
14:43 Grizzly Adams: Welcome back rudy. What brings you here this time?
14:43 tak [15]: task
14:43 Grizzly Adams: All right, what would you like to hunt? Crocodiles, tarantulas, carniphilas, stone golems or mammoths?
14:43 tak [15]: Crocodiles
14:43 tak [15]: Crocodile

w konsoli wyskakuje takie co?:
HRhcIri.jpg

Drugiego w og?le nie mo?na postawi? takie co? wyskakuje w konsoli:
Brc6xiN.jpg
 
Ostatnia edycja:
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

wklej to do taskera tego 2 co nie mo?na go wczyta? :

[LUA] local tasks =
{
[27] = {questStarted = 1510, questStorage = 65000, killsRequired = 100, raceName = "Trolls", rewards = {first = {enable = true, type = "exp", values = 200}, second = {enable = true, type = "money", values = 200}, third = {enable = false, type = nil, values = {nil, nil}}}},

[28] = {questStarted = 1511, questStorage = 65001, killsRequired = 150, raceName = "Goblins", rewards = {first = {enable = true, type = "exp", values = 300}, second = {enable = true, type = "money", values = 250}, third = {enable = false, type = nil, values = {nil, nil}}}},

[3] = {questStarted = 1512, questStorage = 65002, killsRequired = 300, raceName = "Rotworms", rewards = {first = {enable = true, type = "exp", values = 1000}, second = {enable = true, type = "money", values = 400}, third = {enable = false, type = nil, values = {nil, nil}}}},

[4] = {questStarted = 1513, questStorage = 65003, killsRequired = 500, raceName = "Cyclops", rewards = {first = {enable = true, type = "exp", values = 3000}, second = {enable = true, type = "money", values = 800}, third = {enable = false, type = nil, values = {nil, nil}}}},

[5] = {questStarted = 1514, questStorage = 65004, killsRequired = 300, raceName = "Crocodiles", rewards = {first = {enable = true, type = "exp", values = 800}, second = {enable = true, type = "boss", values = THESNAPPER_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[6] = {questStarted = 1515, questStorage = 65005, killsRequired = 300, raceName = "Tarantulas", rewards = {first = {enable = true, type = "exp", values = 1500}, second = {enable = true, type = "boss", values = HIDE_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[7] = {questStarted = 1516, questStorage = 65006, killsRequired = 150, raceName = "Carniphilas", rewards = {first = {enable = true, type = "exp", values = 1500}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[8] = {questStarted = 1517, questStorage = 65007, killsRequired = 200, raceName = "Stone Golems", rewards = {first = {enable = true, type = "exp", values = 2000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[9] = {questStarted = 1518, questStorage = 65008, killsRequired = 300, raceName = "Mammoths", rewards = {first = {enable = true, type = "exp", values = 4000}, second = {enable = true, type = "boss", values = THEBLOODTUSK_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[10] = {questStarted = 1519, questStorage = 65009, killsRequired = 300, raceName = "Ice Golems", rewards = {first = {enable = true, type = "exp", values = 15000}, second = {enable = true, type = "boss", values = SHARDHEAD_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[11] = {questStarted = 1520, questStorage = 65010, killsRequired = 300, raceName = "Quaras Scout", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[12] = {questStarted = 1521, questStorage = 65011, killsRequired = 300, raceName = "Quaras", rewards = {first = {enable = true, type = "exp", values = 12000}, second = {enable = true, type = "boss", values = THUL_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[13] = {questStarted = 1522, questStorage = 65012, killsRequired = 70, raceName = "Water Elementals", rewards = {first = {enable = true, type = "exp", values = 7000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[14] = {questStarted = 1523, questStorage = 65013, killsRequired = 70, raceName = "Earth Elementals", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[15] = {questStarted = 1524, questStorage = 65014, killsRequired = 70, raceName = "Energy Elementals", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[16] = {questStarted = 1525, questStorage = 65015, killsRequired = 70, raceName = "Fire Elementals", rewards = {first = {enable = true, type = "exp", values = 7000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[17] = {questStarted = 1526, questStorage = 65016, killsRequired = 200, raceName = "Mutated Rats", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "boss", values = ESMERALDA_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[18] = {questStarted = 1527, questStorage = 65017, killsRequired = 500, raceName = "Giant Spiders", rewards = {first = {enable = true, type = "exp", values = 5000}, second = {enable = true, type = "boss", values = THEOLDWIDOW_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[19] = {questStarted = 1528, questStorage = 65018, killsRequired = 2000, raceName = "Hydras", rewards = {first = {enable = true, type = "boss", values = THEMANY_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[20] = {questStarted = 1529, questStorage = 65019, killsRequired = 2000, raceName = "Sea Serpents", rewards = {first = {enable = true, type = "boss", values = LEVIATHAN_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[21] = {questStarted = 1530, questStorage = 65020, killsRequired = 2000, raceName = "Behemoths", rewards = {first = {enable = true, type = "boss", values = STONECRACKER_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[22] = {questStarted = 1531, questStorage = 65021, killsRequired = 1500, raceName = "Serpents Spawn", rewards = {first = {enable = true, type = "teleport", values = THENOXIUSSPAWN_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[23] = {questStarted = 1532, questStorage = 65022, killsRequired = 500, raceName = "Green Djinns", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = MERIKHTHESLAUGHTERER_POSITION}}},

[24] = {questStarted = 1533, questStorage = 65023, killsRequired = 500, raceName = "Blue Djinns", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = FAHIMTHEWISE_POSITION}}},

[25] = {questStarted = 1534, questStorage = 65024, killsRequired = 3000, raceName = "Pirates", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = RANDOMPIRATEBOSS_POSITION}}},

[26] = {questStarted = 1535, questStorage = 65025, killsRequired = 3000, raceName = "Pirates", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = false, type = nil, values = {nil, nil}}}},

[1] = {questStarted = 1536, questStorage = 65026, killsRequired = 5000, raceName = "Minotaurs", rewards = {first = {enable = true, type = "exp", values = 10000), second = {enable = true, type = "money", values = 5000}, third = {enable = false, type = nil, values = {nil, nil}}}},

[5] = {questStarted = 1537, questStorage = 65027, killsRequired = 4000, raceName = "Magicians", rewards = {first = {enable = true, type = "exp", values = 40000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[29] = {questStarted = 1538, questStorage = 65028, killsRequired = 1000, raceName = "Magicians", rewards = {first = {enable = true, type = "exp", values = 40000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[30] = {questStarted = 1539, questStorage = 65029, killsRequired = 6666, raceName = "Demons", rewards = {first = {enable = true, type = "storage", values = {65535, 1}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}}
}

local storage = 64521

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

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)

local s = getPlayerStorageValue(cid, storage)

if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
if msgcontains(msg, 'task') then

if(s < 1) then
doPlayerSetStorageValue(cid, storage, 1)
end

if tasks then
if(getPlayerStorageValue(cid, tasks.questStarted) < 1) then
if(getPlayerStorageValue(cid, tasks.creatureStorage) < 0) then
doPlayerSetStorageValue(cid, tasks.creatureStorage, 0)
end

if(getPlayerStorageValue(cid, tasks.questStorage) < 0) then
doPlayerSetStorageValue(cid, tasks.questStorage, 0)
end

doPlayerSetStorageValue(cid, tasks.questStarted, 1)
selfSay('You have started the task number ' .. getPlayerStorageValue(cid, storage) .. ', in this task you need to kill ' .. tasks.killsRequired .. ' ' .. tasks.raceName .. '.', cid)
else
selfSay('You are currently making task about ' .. tasks.raceName .. '.', cid)
end
else
print("[Warning - Error::Killing in the name of::Tasks config] Something is wrong.")
end

elseif msgcontains(msg, 'report') then
if tasks and tasks.questStarted > 0 then
if(getPlayerStorageValue(cid, tasks.creatureStorage) < 0) then
doPlayerSetStorageValue(cid, tasks.creatureStorage, 0)
end

if(getPlayerStorageValue(cid, tasks.questStorage) < 0) then
doPlayerSetStorageValue(cid, tasks.questStorage, 0)
end

if(getPlayerStorageValue(cid, tasks.questStorage) >= tasks.killsRequired) then
selfSay('Great!... you have finished the task number ' .. s .. '. Good job.', cid)
doPlayerSetStorageValue(cid, storage, s + 1)
if(tasks.rewards.first.enable) then
if(tasks.rewards.first.type == "boss") then
doTeleportThing(cid, tasks.rewards.first.values)
elseif(tasks.rewards.first.type == "exp") then
doPlayerAddExperience(cid, tasks.rewards.first.values)
elseif(tasks.rewards.first.type == "item") then
doPlayerAddItem(cid, tasks.rewards.first.values[1], tasks.rewards.first.values[2])
elseif(tasks.rewards.first.type == "money") then
doPlayerAddMoney(cid, tasks.rewards.first.values)
elseif(tasks.rewards.first.type == "storage") then
doPlayerSetStorageValue(cid, tasks.rewards.first.values[1], tasks.rewards.first.values[2])
end
end
if(tasks.rewards.second.enable) then
if(tasks.rewards.second.type == "boss") then
doTeleportThing(cid, tasks.rewards.second.values)
elseif(tasks.rewards.second.type == "exp") then
doPlayerAddExperience(cid, tasks.rewards.second.values)
elseif(tasks.rewards.second.type == "item") then
doPlayerAddItem(cid, tasks.rewards.second.values[1], tasks.rewards.second.values[2])
elseif(tasks.rewards.second.type == "money") then
doPlayerAddMoney(cid, tasks.rewards.second.values)
elseif(tasks.rewards.second.type == "storage") then
doPlayerSetStorageValue(cid, tasks.rewards.second.values[1], tasks.rewards.second.values[2])
end
end
if(tasks.rewards.third.enable) then
if(tasks.rewards.third.type == "boss") then
doTeleportThing(cid, tasks.rewards.third.values)
elseif(tasks.rewards.third.type == "exp") then
doPlayerAddExperience(cid, tasks.rewards.third.values)
elseif(tasks.rewards.third.type == "item") then
doPlayerAddItem(cid, tasks.rewards.third.values[1], tasks.rewards.third.values[2])
elseif(tasks.rewards.third.type == "money") then
doPlayerAddMoney(cid, tasks.rewards.third.values)
elseif(tasks.rewards.third.type == "storage") then
doPlayerSetStorageValue(cid, tasks.rewards.third.values[1], tasks.rewards.third.values[2])
end
end
else
selfSay('Current ' .. getPlayerStorageValue(cid, tasks.questStorage) .. ' ' .. tasks.raceName .. ' killed, you need to kill ' .. tasks.killsRequired .. '.', cid)
end
else
selfSay('You do not have started any task.', cid)
end
end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())[/LUA]


jak to nic nie da to poszukaj nie dodanej spacji gdzie? bo taki jest b??d gdzie? nie jest dodana spacja ja znalaz?em ale nie wiem czy to jest to. Pozdro.
 
Ostatnia edycja:
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

wklej to do taskera tego 2 co nie mo?na go wczyta? :

[LUA] local tasks =
{
[27] = {questStarted = 1510, questStorage = 65000, killsRequired = 100, raceName = "Trolls", rewards = {first = {enable = true, type = "exp", values = 200}, second = {enable = true, type = "money", values = 200}, third = {enable = false, type = nil, values = {nil, nil}}}},

[28] = {questStarted = 1511, questStorage = 65001, killsRequired = 150, raceName = "Goblins", rewards = {first = {enable = true, type = "exp", values = 300}, second = {enable = true, type = "money", values = 250}, third = {enable = false, type = nil, values = {nil, nil}}}},

[3] = {questStarted = 1512, questStorage = 65002, killsRequired = 300, raceName = "Rotworms", rewards = {first = {enable = true, type = "exp", values = 1000}, second = {enable = true, type = "money", values = 400}, third = {enable = false, type = nil, values = {nil, nil}}}},

[4] = {questStarted = 1513, questStorage = 65003, killsRequired = 500, raceName = "Cyclops", rewards = {first = {enable = true, type = "exp", values = 3000}, second = {enable = true, type = "money", values = 800}, third = {enable = false, type = nil, values = {nil, nil}}}},

[5] = {questStarted = 1514, questStorage = 65004, killsRequired = 300, raceName = "Crocodiles", rewards = {first = {enable = true, type = "exp", values = 800}, second = {enable = true, type = "boss", values = THESNAPPER_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[6] = {questStarted = 1515, questStorage = 65005, killsRequired = 300, raceName = "Tarantulas", rewards = {first = {enable = true, type = "exp", values = 1500}, second = {enable = true, type = "boss", values = HIDE_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[7] = {questStarted = 1516, questStorage = 65006, killsRequired = 150, raceName = "Carniphilas", rewards = {first = {enable = true, type = "exp", values = 1500}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[8] = {questStarted = 1517, questStorage = 65007, killsRequired = 200, raceName = "Stone Golems", rewards = {first = {enable = true, type = "exp", values = 2000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[9] = {questStarted = 1518, questStorage = 65008, killsRequired = 300, raceName = "Mammoths", rewards = {first = {enable = true, type = "exp", values = 4000}, second = {enable = true, type = "boss", values = THEBLOODTUSK_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[10] = {questStarted = 1519, questStorage = 65009, killsRequired = 300, raceName = "Ice Golems", rewards = {first = {enable = true, type = "exp", values = 15000}, second = {enable = true, type = "boss", values = SHARDHEAD_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[11] = {questStarted = 1520, questStorage = 65010, killsRequired = 300, raceName = "Quaras Scout", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[12] = {questStarted = 1521, questStorage = 65011, killsRequired = 300, raceName = "Quaras", rewards = {first = {enable = true, type = "exp", values = 12000}, second = {enable = true, type = "boss", values = THUL_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[13] = {questStarted = 1522, questStorage = 65012, killsRequired = 70, raceName = "Water Elementals", rewards = {first = {enable = true, type = "exp", values = 7000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[14] = {questStarted = 1523, questStorage = 65013, killsRequired = 70, raceName = "Earth Elementals", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[15] = {questStarted = 1524, questStorage = 65014, killsRequired = 70, raceName = "Energy Elementals", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[16] = {questStarted = 1525, questStorage = 65015, killsRequired = 70, raceName = "Fire Elementals", rewards = {first = {enable = true, type = "exp", values = 7000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[17] = {questStarted = 1526, questStorage = 65016, killsRequired = 200, raceName = "Mutated Rats", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "boss", values = ESMERALDA_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[18] = {questStarted = 1527, questStorage = 65017, killsRequired = 500, raceName = "Giant Spiders", rewards = {first = {enable = true, type = "exp", values = 5000}, second = {enable = true, type = "boss", values = THEOLDWIDOW_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},

[19] = {questStarted = 1528, questStorage = 65018, killsRequired = 2000, raceName = "Hydras", rewards = {first = {enable = true, type = "boss", values = THEMANY_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[20] = {questStarted = 1529, questStorage = 65019, killsRequired = 2000, raceName = "Sea Serpents", rewards = {first = {enable = true, type = "boss", values = LEVIATHAN_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[21] = {questStarted = 1530, questStorage = 65020, killsRequired = 2000, raceName = "Behemoths", rewards = {first = {enable = true, type = "boss", values = STONECRACKER_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[22] = {questStarted = 1531, questStorage = 65021, killsRequired = 1500, raceName = "Serpents Spawn", rewards = {first = {enable = true, type = "teleport", values = THENOXIUSSPAWN_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[23] = {questStarted = 1532, questStorage = 65022, killsRequired = 500, raceName = "Green Djinns", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = MERIKHTHESLAUGHTERER_POSITION}}},

[24] = {questStarted = 1533, questStorage = 65023, killsRequired = 500, raceName = "Blue Djinns", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = FAHIMTHEWISE_POSITION}}},

[25] = {questStarted = 1534, questStorage = 65024, killsRequired = 3000, raceName = "Pirates", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = RANDOMPIRATEBOSS_POSITION}}},

[26] = {questStarted = 1535, questStorage = 65025, killsRequired = 3000, raceName = "Pirates", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = false, type = nil, values = {nil, nil}}}},

[1] = {questStarted = 1536, questStorage = 65026, killsRequired = 5000, raceName = "Minotaurs", rewards = {first = {enable = true, type = "exp", values = 10000), second = {enable = true, type = "money", values = 5000}, third = {enable = false, type = nil, values = {nil, nil}}}},

[5] = {questStarted = 1537, questStorage = 65027, killsRequired = 4000, raceName = "Magicians", rewards = {first = {enable = true, type = "exp", values = 40000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[29] = {questStarted = 1538, questStorage = 65028, killsRequired = 1000, raceName = "Magicians", rewards = {first = {enable = true, type = "exp", values = 40000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},

[30] = {questStarted = 1539, questStorage = 65029, killsRequired = 6666, raceName = "Demons", rewards = {first = {enable = true, type = "storage", values = {65535, 1}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}}
}

local storage = 64521

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

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)

local s = getPlayerStorageValue(cid, storage)

if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
if msgcontains(msg, 'task') then

if(s < 1) then
doPlayerSetStorageValue(cid, storage, 1)
end

if tasks then
if(getPlayerStorageValue(cid, tasks.questStarted) < 1) then
if(getPlayerStorageValue(cid, tasks.creatureStorage) < 0) then
doPlayerSetStorageValue(cid, tasks.creatureStorage, 0)
end

if(getPlayerStorageValue(cid, tasks.questStorage) < 0) then
doPlayerSetStorageValue(cid, tasks.questStorage, 0)
end

doPlayerSetStorageValue(cid, tasks.questStarted, 1)
selfSay('You have started the task number ' .. getPlayerStorageValue(cid, storage) .. ', in this task you need to kill ' .. tasks.killsRequired .. ' ' .. tasks.raceName .. '.', cid)
else
selfSay('You are currently making task about ' .. tasks.raceName .. '.', cid)
end
else
print("[Warning - Error::Killing in the name of::Tasks config] Something is wrong.")
end

elseif msgcontains(msg, 'report') then
if tasks and tasks.questStarted > 0 then
if(getPlayerStorageValue(cid, tasks.creatureStorage) < 0) then
doPlayerSetStorageValue(cid, tasks.creatureStorage, 0)
end

if(getPlayerStorageValue(cid, tasks.questStorage) < 0) then
doPlayerSetStorageValue(cid, tasks.questStorage, 0)
end

if(getPlayerStorageValue(cid, tasks.questStorage) >= tasks.killsRequired) then
selfSay('Great!... you have finished the task number ' .. s .. '. Good job.', cid)
doPlayerSetStorageValue(cid, storage, s + 1)
if(tasks.rewards.first.enable) then
if(tasks.rewards.first.type == "boss") then
doTeleportThing(cid, tasks.rewards.first.values)
elseif(tasks.rewards.first.type == "exp") then
doPlayerAddExperience(cid, tasks.rewards.first.values)
elseif(tasks.rewards.first.type == "item") then
doPlayerAddItem(cid, tasks.rewards.first.values[1], tasks.rewards.first.values[2])
elseif(tasks.rewards.first.type == "money") then
doPlayerAddMoney(cid, tasks.rewards.first.values)
elseif(tasks.rewards.first.type == "storage") then
doPlayerSetStorageValue(cid, tasks.rewards.first.values[1], tasks.rewards.first.values[2])
end
end
if(tasks.rewards.second.enable) then
if(tasks.rewards.second.type == "boss") then
doTeleportThing(cid, tasks.rewards.second.values)
elseif(tasks.rewards.second.type == "exp") then
doPlayerAddExperience(cid, tasks.rewards.second.values)
elseif(tasks.rewards.second.type == "item") then
doPlayerAddItem(cid, tasks.rewards.second.values[1], tasks.rewards.second.values[2])
elseif(tasks.rewards.second.type == "money") then
doPlayerAddMoney(cid, tasks.rewards.second.values)
elseif(tasks.rewards.second.type == "storage") then
doPlayerSetStorageValue(cid, tasks.rewards.second.values[1], tasks.rewards.second.values[2])
end
end
if(tasks.rewards.third.enable) then
if(tasks.rewards.third.type == "boss") then
doTeleportThing(cid, tasks.rewards.third.values)
elseif(tasks.rewards.third.type == "exp") then
doPlayerAddExperience(cid, tasks.rewards.third.values)
elseif(tasks.rewards.third.type == "item") then
doPlayerAddItem(cid, tasks.rewards.third.values[1], tasks.rewards.third.values[2])
elseif(tasks.rewards.third.type == "money") then
doPlayerAddMoney(cid, tasks.rewards.third.values)
elseif(tasks.rewards.third.type == "storage") then
doPlayerSetStorageValue(cid, tasks.rewards.third.values[1], tasks.rewards.third.values[2])
end
end
else
selfSay('Current ' .. getPlayerStorageValue(cid, tasks.questStorage) .. ' ' .. tasks.raceName .. ' killed, you need to kill ' .. tasks.killsRequired .. '.', cid)
end
else
selfSay('You do not have started any task.', cid)
end
end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())[/LUA]


jak to nic nie da to poszukaj nie dodanej spacji gdzie? bo taki jest b??d gdzie? nie jest dodana spacja ja znalaz?em ale nie wiem czy to jest to. Pozdro.


Dalej jest taki sam b??d w 55 linijce ;x
 
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

Kod:
        local tasks =
        {
                [1] = {questStarted = 1510, questStorage = 65000, killsRequired = 100, raceName = "Trolls", rewards = {first = {enable = true, type = "exp", values = 200}, second = {enable = true, type = "money", values = 200}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [2] = {questStarted = 1511, questStorage = 65001, killsRequired = 150, raceName = "Goblins", rewards = {first = {enable = true, type = "exp", values = 300}, second = {enable = true, type = "money", values = 250}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [3] = {questStarted = 1512, questStorage = 65002, killsRequired = 300, raceName = "Rotworms", rewards = {first = {enable = true, type = "exp", values = 1000}, second = {enable = true, type = "money", values = 400}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [4] = {questStarted = 1513, questStorage = 65003, killsRequired = 500, raceName = "Cyclops", rewards = {first = {enable = true, type = "exp", values = 3000}, second = {enable = true, type = "money", values = 800}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [5] = {questStarted = 1514, questStorage = 65004, killsRequired = 300, raceName = "Crocodiles", rewards = {first = {enable = true, type = "exp", values = 800}, second = {enable = true, type = "boss", values = THESNAPPER_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [6] = {questStarted = 1515, questStorage = 65005, killsRequired = 300, raceName = "Tarantulas", rewards = {first = {enable = true, type = "exp", values = 1500}, second = {enable = true, type = "boss", values = HIDE_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [7] = {questStarted = 1516, questStorage = 65006, killsRequired = 150, raceName = "Carniphilas", rewards = {first = {enable = true, type = "exp", values = 1500}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [8] = {questStarted = 1517, questStorage = 65007, killsRequired = 200, raceName = "Stone Golems", rewards = {first = {enable = true, type = "exp", values = 2000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [9] = {questStarted = 1518, questStorage = 65008, killsRequired = 300, raceName = "Mammoths", rewards = {first = {enable = true, type = "exp", values = 4000}, second = {enable = true, type = "boss", values = THEBLOODTUSK_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [10] = {questStarted = 1519, questStorage = 65009, killsRequired = 300, raceName = "Ice Golems", rewards = {first = {enable = true, type = "exp", values = 15000}, second = {enable = true, type = "boss", values = SHARDHEAD_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [11] = {questStarted = 1520, questStorage = 65010, killsRequired = 300, raceName = "Quaras Scout", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [12] = {questStarted = 1521, questStorage = 65011, killsRequired = 300, raceName = "Quaras", rewards = {first = {enable = true, type = "exp", values = 12000}, second = {enable = true, type = "boss", values = THUL_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [13] = {questStarted = 1522, questStorage = 65012, killsRequired = 70, raceName = "Water Elementals", rewards = {first = {enable = true, type = "exp", values = 7000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [14] = {questStarted = 1523, questStorage = 65013, killsRequired = 70, raceName = "Earth Elementals", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [15] = {questStarted = 1524, questStorage = 65014, killsRequired = 70, raceName = "Energy Elementals", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [16] = {questStarted = 1525, questStorage = 65015, killsRequired = 70, raceName = "Fire Elementals", rewards = {first = {enable = true, type = "exp", values = 7000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [17] = {questStarted = 1526, questStorage = 65016, killsRequired = 200, raceName = "Mutated Rats", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "boss", values = ESMERALDA_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [18] = {questStarted = 1527, questStorage = 65017, killsRequired = 500, raceName = "Giant Spiders", rewards = {first = {enable = true, type = "exp", values = 5000}, second = {enable = true, type = "boss", values = THEOLDWIDOW_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [19] = {questStarted = 1528, questStorage = 65018, killsRequired = 2000, raceName = "Hydras", rewards = {first = {enable = true, type = "boss", values = THEMANY_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [20] = {questStarted = 1529, questStorage = 65019, killsRequired = 2000, raceName = "Sea Serpents", rewards = {first = {enable = true, type = "boss", values = LEVIATHAN_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [21] = {questStarted = 1530, questStorage = 65020, killsRequired = 2000, raceName = "Behemoths", rewards = {first = {enable = true, type = "boss", values = STONECRACKER_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [22] = {questStarted = 1531, questStorage = 65021, killsRequired = 1500, raceName = "Serpents Spawn", rewards = {first = {enable = true, type = "teleport", values = THENOXIUSSPAWN_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [23] = {questStarted = 1532, questStorage = 65022, killsRequired = 500, raceName = "Green Djinns", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = MERIKHTHESLAUGHTERER_POSITION}}},
     
                [24] = {questStarted = 1533, questStorage = 65023, killsRequired = 500, raceName = "Blue Djinns", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = FAHIMTHEWISE_POSITION}}},
     
                [25] = {questStarted = 1534, questStorage = 65024, killsRequired = 3000, raceName = "Pirates", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = RANDOMPIRATEBOSS_POSITION}}},
     
                [26] = {questStarted = 1535, questStorage = 65025, killsRequired = 3000, raceName = "Pirates", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [27] = {questStarted = 1536, questStorage = 65026, killsRequired = 5000, raceName = "Minotaurs", rewards = {first = {enable = true, type = "exp", values = 10000), second = {enable = true, type = "money", values = 5000}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [28] = {questStarted = 1537, questStorage = 65027, killsRequired = 4000, raceName = "Magicians", rewards = {first = {enable = true, type = "exp", values = 40000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [29] = {questStarted = 1538, questStorage = 65028, killsRequired = 1000, raceName = "Magicians", rewards = {first = {enable = true, type = "exp", values = 40000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [30] = {questStarted = 1539, questStorage = 65029, killsRequired = 6666, raceName = "Demons", rewards = {first = {enable = true, type = "storage", values = {65535, 1}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}}
        }
     
        local storage = 64521
     
        local keywordHandler = KeywordHandler:new()
        local npcHandler = NpcHandler:new(keywordHandler)
        NpcSystem.parseParameters(npcHandler)
        local talkState = {}
        local voc = {}
     
        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)
     
                local s = getPlayerStorageValue(cid, storage)
     
                if(not npcHandler:isFocused(cid)) then
                        return false
                end
                local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
                if msgcontains(msg, 'task') then
     
                        if(s < 1) then
                                doPlayerSetStorageValue(cid, storage, 1)
                        end
     
                        if tasks[s] then
                                if(getPlayerStorageValue(cid, tasks[s].questStarted) < 1) then
                                        if(getPlayerStorageValue(cid, tasks[s].creatureStorage) < 0) then
                                                doPlayerSetStorageValue(cid, tasks[s].creatureStorage, 0)
                                        end
     
                                        if(getPlayerStorageValue(cid, tasks[s].questStorage) < 0) then
                                                doPlayerSetStorageValue(cid, tasks[s].questStorage, 0)
                                        end
     
                                        doPlayerSetStorageValue(cid, tasks[s].questStarted, 1)
                                        selfSay('You have started the task number ' .. getPlayerStorageValue(cid, storage) .. ', in this task you need to kill ' .. tasks[s].killsRequired .. ' ' .. tasks[s].raceName .. '.', cid)
                                else
                                        selfSay('You are currently making task about ' .. tasks[s].raceName .. '.', cid)
                                end
                        else
                                print("[Warning - Error::Killing in the name of::Tasks config] Something is wrong.")
                        end
     
                elseif msgcontains(msg, 'report') then
                        if tasks[s] and tasks[s].questStarted > 0 then
                                if(getPlayerStorageValue(cid, tasks[s].creatureStorage) < 0) then
                                        doPlayerSetStorageValue(cid, tasks[s].creatureStorage, 0)
                                end
     
                                if(getPlayerStorageValue(cid, tasks[s].questStorage) < 0) then
                                        doPlayerSetStorageValue(cid, tasks[s].questStorage, 0)
                                end
     
                                if(getPlayerStorageValue(cid, tasks[s].questStorage) >= tasks[s].killsRequired) then
                                        selfSay('Great!... you have finished the task number ' .. s .. '. Good job.', cid)
                                        doPlayerSetStorageValue(cid, storage, s + 1)
                                        if(tasks[s].rewards.first.enable) then
                                                if(tasks[s].rewards.first.type == "boss") then
                                                        doTeleportThing(cid, tasks[s].rewards.first.values)
                                                elseif(tasks[s].rewards.first.type == "exp") then
                                                        doPlayerAddExperience(cid, tasks[s].rewards.first.values)
                                                elseif(tasks[s].rewards.first.type == "item") then
                                                        doPlayerAddItem(cid, tasks[s].rewards.first.values[1], tasks[s].rewards.first.values[2])
                                                elseif(tasks[s].rewards.first.type == "money") then
                                                        doPlayerAddMoney(cid, tasks[s].rewards.first.values)
                                                elseif(tasks[s].rewards.first.type == "storage") then
                                                        doPlayerSetStorageValue(cid, tasks[s].rewards.first.values[1], tasks[s].rewards.first.values[2])
                                                end
                                        end
                                        if(tasks[s].rewards.second.enable) then
                                                if(tasks[s].rewards.second.type == "boss") then
                                                        doTeleportThing(cid, tasks[s].rewards.second.values)
                                                elseif(tasks[s].rewards.second.type == "exp") then
                                                        doPlayerAddExperience(cid, tasks[s].rewards.second.values)
                                                elseif(tasks[s].rewards.second.type == "item") then
                                                        doPlayerAddItem(cid, tasks[s].rewards.second.values[1], tasks[s].rewards.second.values[2])
                                                elseif(tasks[s].rewards.second.type == "money") then
                                                        doPlayerAddMoney(cid, tasks[s].rewards.second.values)
                                                elseif(tasks[s].rewards.second.type == "storage") then
                                                        doPlayerSetStorageValue(cid, tasks[s].rewards.second.values[1], tasks[s].rewards.second.values[2])
                                                end
                                        end
                                        if(tasks[s].rewards.third.enable) then
                                                if(tasks[s].rewards.third.type == "boss") then
                                                        doTeleportThing(cid, tasks[s].rewards.third.values)
                                                elseif(tasks[s].rewards.third.type == "exp") then
                                                        doPlayerAddExperience(cid, tasks[s].rewards.third.values)
                                                elseif(tasks[s].rewards.third.type == "item") then
                                                        doPlayerAddItem(cid, tasks[s].rewards.third.values[1], tasks[s].rewards.third.values[2])
                                                elseif(tasks[s].rewards.third.type == "money") then
                                                        doPlayerAddMoney(cid, tasks[s].rewards.third.values)
                                                elseif(tasks[s].rewards.third.type == "storage") then
                                                        doPlayerSetStorageValue(cid, tasks[s].rewards.third.values[1], tasks[s].rewards.third.values[2])
                                                end
                                        end                           
                                else
                                        selfSay('Current ' .. getPlayerStorageValue(cid, tasks[s].questStorage) .. ' ' .. tasks[s].raceName .. ' killed, you need to kill ' .. tasks[s].killsRequired .. '.', cid)
                                end
                        else
                                selfSay('You do not have started any task.', cid)
                        end
                end
                return true
        end
     
        npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
        npcHandler:addModule(FocusModule:new())
 
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

Kod:
        local tasks =
        {
                [1] = {questStarted = 1510, questStorage = 65000, killsRequired = 100, raceName = "Trolls", rewards = {first = {enable = true, type = "exp", values = 200}, second = {enable = true, type = "money", values = 200}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [2] = {questStarted = 1511, questStorage = 65001, killsRequired = 150, raceName = "Goblins", rewards = {first = {enable = true, type = "exp", values = 300}, second = {enable = true, type = "money", values = 250}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [3] = {questStarted = 1512, questStorage = 65002, killsRequired = 300, raceName = "Rotworms", rewards = {first = {enable = true, type = "exp", values = 1000}, second = {enable = true, type = "money", values = 400}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [4] = {questStarted = 1513, questStorage = 65003, killsRequired = 500, raceName = "Cyclops", rewards = {first = {enable = true, type = "exp", values = 3000}, second = {enable = true, type = "money", values = 800}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [5] = {questStarted = 1514, questStorage = 65004, killsRequired = 300, raceName = "Crocodiles", rewards = {first = {enable = true, type = "exp", values = 800}, second = {enable = true, type = "boss", values = THESNAPPER_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [6] = {questStarted = 1515, questStorage = 65005, killsRequired = 300, raceName = "Tarantulas", rewards = {first = {enable = true, type = "exp", values = 1500}, second = {enable = true, type = "boss", values = HIDE_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [7] = {questStarted = 1516, questStorage = 65006, killsRequired = 150, raceName = "Carniphilas", rewards = {first = {enable = true, type = "exp", values = 1500}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [8] = {questStarted = 1517, questStorage = 65007, killsRequired = 200, raceName = "Stone Golems", rewards = {first = {enable = true, type = "exp", values = 2000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [9] = {questStarted = 1518, questStorage = 65008, killsRequired = 300, raceName = "Mammoths", rewards = {first = {enable = true, type = "exp", values = 4000}, second = {enable = true, type = "boss", values = THEBLOODTUSK_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [10] = {questStarted = 1519, questStorage = 65009, killsRequired = 300, raceName = "Ice Golems", rewards = {first = {enable = true, type = "exp", values = 15000}, second = {enable = true, type = "boss", values = SHARDHEAD_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [11] = {questStarted = 1520, questStorage = 65010, killsRequired = 300, raceName = "Quaras Scout", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [12] = {questStarted = 1521, questStorage = 65011, killsRequired = 300, raceName = "Quaras", rewards = {first = {enable = true, type = "exp", values = 12000}, second = {enable = true, type = "boss", values = THUL_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [13] = {questStarted = 1522, questStorage = 65012, killsRequired = 70, raceName = "Water Elementals", rewards = {first = {enable = true, type = "exp", values = 7000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [14] = {questStarted = 1523, questStorage = 65013, killsRequired = 70, raceName = "Earth Elementals", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [15] = {questStarted = 1524, questStorage = 65014, killsRequired = 70, raceName = "Energy Elementals", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [16] = {questStarted = 1525, questStorage = 65015, killsRequired = 70, raceName = "Fire Elementals", rewards = {first = {enable = true, type = "exp", values = 7000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [17] = {questStarted = 1526, questStorage = 65016, killsRequired = 200, raceName = "Mutated Rats", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "boss", values = ESMERALDA_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [18] = {questStarted = 1527, questStorage = 65017, killsRequired = 500, raceName = "Giant Spiders", rewards = {first = {enable = true, type = "exp", values = 5000}, second = {enable = true, type = "boss", values = THEOLDWIDOW_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [19] = {questStarted = 1528, questStorage = 65018, killsRequired = 2000, raceName = "Hydras", rewards = {first = {enable = true, type = "boss", values = THEMANY_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [20] = {questStarted = 1529, questStorage = 65019, killsRequired = 2000, raceName = "Sea Serpents", rewards = {first = {enable = true, type = "boss", values = LEVIATHAN_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [21] = {questStarted = 1530, questStorage = 65020, killsRequired = 2000, raceName = "Behemoths", rewards = {first = {enable = true, type = "boss", values = STONECRACKER_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [22] = {questStarted = 1531, questStorage = 65021, killsRequired = 1500, raceName = "Serpents Spawn", rewards = {first = {enable = true, type = "teleport", values = THENOXIUSSPAWN_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [23] = {questStarted = 1532, questStorage = 65022, killsRequired = 500, raceName = "Green Djinns", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = MERIKHTHESLAUGHTERER_POSITION}}},
     
                [24] = {questStarted = 1533, questStorage = 65023, killsRequired = 500, raceName = "Blue Djinns", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = FAHIMTHEWISE_POSITION}}},
     
                [25] = {questStarted = 1534, questStorage = 65024, killsRequired = 3000, raceName = "Pirates", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = RANDOMPIRATEBOSS_POSITION}}},
     
                [26] = {questStarted = 1535, questStorage = 65025, killsRequired = 3000, raceName = "Pirates", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [27] = {questStarted = 1536, questStorage = 65026, killsRequired = 5000, raceName = "Minotaurs", rewards = {first = {enable = true, type = "exp", values = 10000), second = {enable = true, type = "money", values = 5000}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [28] = {questStarted = 1537, questStorage = 65027, killsRequired = 4000, raceName = "Magicians", rewards = {first = {enable = true, type = "exp", values = 40000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [29] = {questStarted = 1538, questStorage = 65028, killsRequired = 1000, raceName = "Magicians", rewards = {first = {enable = true, type = "exp", values = 40000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [30] = {questStarted = 1539, questStorage = 65029, killsRequired = 6666, raceName = "Demons", rewards = {first = {enable = true, type = "storage", values = {65535, 1}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}}
        }
     
        local storage = 64521
     
        local keywordHandler = KeywordHandler:new()
        local npcHandler = NpcHandler:new(keywordHandler)
        NpcSystem.parseParameters(npcHandler)
        local talkState = {}
        local voc = {}
     
        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)
     
                local s = getPlayerStorageValue(cid, storage)
     
                if(not npcHandler:isFocused(cid)) then
                        return false
                end
                local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
                if msgcontains(msg, 'task') then
     
                        if(s < 1) then
                                doPlayerSetStorageValue(cid, storage, 1)
                        end
     
                        if tasks[s] then
                                if(getPlayerStorageValue(cid, tasks[s].questStarted) < 1) then
                                        if(getPlayerStorageValue(cid, tasks[s].creatureStorage) < 0) then
                                                doPlayerSetStorageValue(cid, tasks[s].creatureStorage, 0)
                                        end
     
                                        if(getPlayerStorageValue(cid, tasks[s].questStorage) < 0) then
                                                doPlayerSetStorageValue(cid, tasks[s].questStorage, 0)
                                        end
     
                                        doPlayerSetStorageValue(cid, tasks[s].questStarted, 1)
                                        selfSay('You have started the task number ' .. getPlayerStorageValue(cid, storage) .. ', in this task you need to kill ' .. tasks[s].killsRequired .. ' ' .. tasks[s].raceName .. '.', cid)
                                else
                                        selfSay('You are currently making task about ' .. tasks[s].raceName .. '.', cid)
                                end
                        else
                                print("[Warning - Error::Killing in the name of::Tasks config] Something is wrong.")
                        end
     
                elseif msgcontains(msg, 'report') then
                        if tasks[s] and tasks[s].questStarted > 0 then
                                if(getPlayerStorageValue(cid, tasks[s].creatureStorage) < 0) then
                                        doPlayerSetStorageValue(cid, tasks[s].creatureStorage, 0)
                                end
     
                                if(getPlayerStorageValue(cid, tasks[s].questStorage) < 0) then
                                        doPlayerSetStorageValue(cid, tasks[s].questStorage, 0)
                                end
     
                                if(getPlayerStorageValue(cid, tasks[s].questStorage) >= tasks[s].killsRequired) then
                                        selfSay('Great!... you have finished the task number ' .. s .. '. Good job.', cid)
                                        doPlayerSetStorageValue(cid, storage, s + 1)
                                        if(tasks[s].rewards.first.enable) then
                                                if(tasks[s].rewards.first.type == "boss") then
                                                        doTeleportThing(cid, tasks[s].rewards.first.values)
                                                elseif(tasks[s].rewards.first.type == "exp") then
                                                        doPlayerAddExperience(cid, tasks[s].rewards.first.values)
                                                elseif(tasks[s].rewards.first.type == "item") then
                                                        doPlayerAddItem(cid, tasks[s].rewards.first.values[1], tasks[s].rewards.first.values[2])
                                                elseif(tasks[s].rewards.first.type == "money") then
                                                        doPlayerAddMoney(cid, tasks[s].rewards.first.values)
                                                elseif(tasks[s].rewards.first.type == "storage") then
                                                        doPlayerSetStorageValue(cid, tasks[s].rewards.first.values[1], tasks[s].rewards.first.values[2])
                                                end
                                        end
                                        if(tasks[s].rewards.second.enable) then
                                                if(tasks[s].rewards.second.type == "boss") then
                                                        doTeleportThing(cid, tasks[s].rewards.second.values)
                                                elseif(tasks[s].rewards.second.type == "exp") then
                                                        doPlayerAddExperience(cid, tasks[s].rewards.second.values)
                                                elseif(tasks[s].rewards.second.type == "item") then
                                                        doPlayerAddItem(cid, tasks[s].rewards.second.values[1], tasks[s].rewards.second.values[2])
                                                elseif(tasks[s].rewards.second.type == "money") then
                                                        doPlayerAddMoney(cid, tasks[s].rewards.second.values)
                                                elseif(tasks[s].rewards.second.type == "storage") then
                                                        doPlayerSetStorageValue(cid, tasks[s].rewards.second.values[1], tasks[s].rewards.second.values[2])
                                                end
                                        end
                                        if(tasks[s].rewards.third.enable) then
                                                if(tasks[s].rewards.third.type == "boss") then
                                                        doTeleportThing(cid, tasks[s].rewards.third.values)
                                                elseif(tasks[s].rewards.third.type == "exp") then
                                                        doPlayerAddExperience(cid, tasks[s].rewards.third.values)
                                                elseif(tasks[s].rewards.third.type == "item") then
                                                        doPlayerAddItem(cid, tasks[s].rewards.third.values[1], tasks[s].rewards.third.values[2])
                                                elseif(tasks[s].rewards.third.type == "money") then
                                                        doPlayerAddMoney(cid, tasks[s].rewards.third.values)
                                                elseif(tasks[s].rewards.third.type == "storage") then
                                                        doPlayerSetStorageValue(cid, tasks[s].rewards.third.values[1], tasks[s].rewards.third.values[2])
                                                end
                                        end                           
                                else
                                        selfSay('Current ' .. getPlayerStorageValue(cid, tasks[s].questStorage) .. ' ' .. tasks[s].raceName .. ' killed, you need to kill ' .. tasks[s].killsRequired .. '.', cid)
                                end
                        else
                                selfSay('You do not have started any task.', cid)
                        end
                end
                return true
        end
     
        npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
        npcHandler:addModule(FocusModule:new())



Nie wiem o co chodzi ale taki sam b??d jest jak wczesniej
Brc6xiN.jpg
 
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

Kod:
        local tasks =
        {
                [1] = {questStarted = 1510, questStorage = 65000, killsRequired = 100, raceName = "Trolls", rewards = {first = {enable = true, type = "exp", values = 200}, second = {enable = true, type = "money", values = 200}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [2] = {questStarted = 1511, questStorage = 65001, killsRequired = 150, raceName = "Goblins", rewards = {first = {enable = true, type = "exp", values = 300}, second = {enable = true, type = "money", values = 250}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [3] = {questStarted = 1512, questStorage = 65002, killsRequired = 300, raceName = "Rotworms", rewards = {first = {enable = true, type = "exp", values = 1000}, second = {enable = true, type = "money", values = 400}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [4] = {questStarted = 1513, questStorage = 65003, killsRequired = 500, raceName = "Cyclops", rewards = {first = {enable = true, type = "exp", values = 3000}, second = {enable = true, type = "money", values = 800}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [5] = {questStarted = 1514, questStorage = 65004, killsRequired = 300, raceName = "Crocodiles", rewards = {first = {enable = true, type = "exp", values = 800}, second = {enable = true, type = "boss", values = THESNAPPER_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [6] = {questStarted = 1515, questStorage = 65005, killsRequired = 300, raceName = "Tarantulas", rewards = {first = {enable = true, type = "exp", values = 1500}, second = {enable = true, type = "boss", values = HIDE_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [7] = {questStarted = 1516, questStorage = 65006, killsRequired = 150, raceName = "Carniphilas", rewards = {first = {enable = true, type = "exp", values = 1500}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [8] = {questStarted = 1517, questStorage = 65007, killsRequired = 200, raceName = "Stone Golems", rewards = {first = {enable = true, type = "exp", values = 2000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [9] = {questStarted = 1518, questStorage = 65008, killsRequired = 300, raceName = "Mammoths", rewards = {first = {enable = true, type = "exp", values = 4000}, second = {enable = true, type = "boss", values = THEBLOODTUSK_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [10] = {questStarted = 1519, questStorage = 65009, killsRequired = 300, raceName = "Ice Golems", rewards = {first = {enable = true, type = "exp", values = 15000}, second = {enable = true, type = "boss", values = SHARDHEAD_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [11] = {questStarted = 1520, questStorage = 65010, killsRequired = 300, raceName = "Quaras Scout", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [12] = {questStarted = 1521, questStorage = 65011, killsRequired = 300, raceName = "Quaras", rewards = {first = {enable = true, type = "exp", values = 12000}, second = {enable = true, type = "boss", values = THUL_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [13] = {questStarted = 1522, questStorage = 65012, killsRequired = 70, raceName = "Water Elementals", rewards = {first = {enable = true, type = "exp", values = 7000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [14] = {questStarted = 1523, questStorage = 65013, killsRequired = 70, raceName = "Earth Elementals", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [15] = {questStarted = 1524, questStorage = 65014, killsRequired = 70, raceName = "Energy Elementals", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [16] = {questStarted = 1525, questStorage = 65015, killsRequired = 70, raceName = "Fire Elementals", rewards = {first = {enable = true, type = "exp", values = 7000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [17] = {questStarted = 1526, questStorage = 65016, killsRequired = 200, raceName = "Mutated Rats", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "boss", values = ESMERALDA_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [18] = {questStarted = 1527, questStorage = 65017, killsRequired = 500, raceName = "Giant Spiders", rewards = {first = {enable = true, type = "exp", values = 5000}, second = {enable = true, type = "boss", values = THEOLDWIDOW_POSITION}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [19] = {questStarted = 1528, questStorage = 65018, killsRequired = 2000, raceName = "Hydras", rewards = {first = {enable = true, type = "boss", values = THEMANY_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [20] = {questStarted = 1529, questStorage = 65019, killsRequired = 2000, raceName = "Sea Serpents", rewards = {first = {enable = true, type = "boss", values = LEVIATHAN_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [21] = {questStarted = 1530, questStorage = 65020, killsRequired = 2000, raceName = "Behemoths", rewards = {first = {enable = true, type = "boss", values = STONECRACKER_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [22] = {questStarted = 1531, questStorage = 65021, killsRequired = 1500, raceName = "Serpents Spawn", rewards = {first = {enable = true, type = "teleport", values = THENOXIUSSPAWN_POSITION}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [23] = {questStarted = 1532, questStorage = 65022, killsRequired = 500, raceName = "Green Djinns", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = MERIKHTHESLAUGHTERER_POSITION}}},
     
                [24] = {questStarted = 1533, questStorage = 65023, killsRequired = 500, raceName = "Blue Djinns", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = FAHIMTHEWISE_POSITION}}},
     
                [25] = {questStarted = 1534, questStorage = 65024, killsRequired = 3000, raceName = "Pirates", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = true, type = "boss", values = RANDOMPIRATEBOSS_POSITION}}},
     
                [26] = {questStarted = 1535, questStorage = 65025, killsRequired = 3000, raceName = "Pirates", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [27] = {questStarted = 1536, questStorage = 65026, killsRequired = 5000, raceName = "Minotaurs", rewards = {first = {enable = true, type = "exp", values = 10000}, second = {enable = true, type = "money", values = 5000}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [28] = {questStarted = 1537, questStorage = 65027, killsRequired = 4000, raceName = "Magicians", rewards = {first = {enable = true, type = "exp", values = 40000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [29] = {questStarted = 1538, questStorage = 65028, killsRequired = 1000, raceName = "Magicians", rewards = {first = {enable = true, type = "exp", values = 40000}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}},
     
                [30] = {questStarted = 1539, questStorage = 65029, killsRequired = 6666, raceName = "Demons", rewards = {first = {enable = true, type = "storage", values = {65535, 1}}, second = {enable = false, type = nil, values = {nil, nil}}, third = {enable = false, type = nil, values = {nil, nil}}}}
        }
     
        local storage = 64521
     
        local keywordHandler = KeywordHandler:new()
        local npcHandler = NpcHandler:new(keywordHandler)
        NpcSystem.parseParameters(npcHandler)
        local talkState = {}
        local voc = {}
     
        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)
     
                local s = getPlayerStorageValue(cid, storage)
     
                if(not npcHandler:isFocused(cid)) then
                        return false
                end
                local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
                if msgcontains(msg, 'task') then
     
                        if(s < 1) then
                                doPlayerSetStorageValue(cid, storage, 1)
                        end
     
                        if tasks[s] then
                                if(getPlayerStorageValue(cid, tasks[s].questStarted) < 1) then
                                        if(getPlayerStorageValue(cid, tasks[s].creatureStorage) < 0) then
                                                doPlayerSetStorageValue(cid, tasks[s].creatureStorage, 0)
                                        end
     
                                        if(getPlayerStorageValue(cid, tasks[s].questStorage) < 0) then
                                                doPlayerSetStorageValue(cid, tasks[s].questStorage, 0)
                                        end
     
                                        doPlayerSetStorageValue(cid, tasks[s].questStarted, 1)
                                        selfSay('You have started the task number ' .. getPlayerStorageValue(cid, storage) .. ', in this task you need to kill ' .. tasks[s].killsRequired .. ' ' .. tasks[s].raceName .. '.', cid)
                                else
                                        selfSay('You are currently making task about ' .. tasks[s].raceName .. '.', cid)
                                end
                        else
                                print("[Warning - Error::Killing in the name of::Tasks config] Something is wrong.")
                        end
     
                elseif msgcontains(msg, 'report') then
                        if tasks[s] and tasks[s].questStarted > 0 then
                                if(getPlayerStorageValue(cid, tasks[s].creatureStorage) < 0) then
                                        doPlayerSetStorageValue(cid, tasks[s].creatureStorage, 0)
                                end
     
                                if(getPlayerStorageValue(cid, tasks[s].questStorage) < 0) then
                                        doPlayerSetStorageValue(cid, tasks[s].questStorage, 0)
                                end
     
                                if(getPlayerStorageValue(cid, tasks[s].questStorage) >= tasks[s].killsRequired) then
                                        selfSay('Great!... you have finished the task number ' .. s .. '. Good job.', cid)
                                        doPlayerSetStorageValue(cid, storage, s + 1)
                                        if(tasks[s].rewards.first.enable) then
                                                if(tasks[s].rewards.first.type == "boss") then
                                                        doTeleportThing(cid, tasks[s].rewards.first.values)
                                                elseif(tasks[s].rewards.first.type == "exp") then
                                                        doPlayerAddExperience(cid, tasks[s].rewards.first.values)
                                                elseif(tasks[s].rewards.first.type == "item") then
                                                        doPlayerAddItem(cid, tasks[s].rewards.first.values[1], tasks[s].rewards.first.values[2])
                                                elseif(tasks[s].rewards.first.type == "money") then
                                                        doPlayerAddMoney(cid, tasks[s].rewards.first.values)
                                                elseif(tasks[s].rewards.first.type == "storage") then
                                                        doPlayerSetStorageValue(cid, tasks[s].rewards.first.values[1], tasks[s].rewards.first.values[2])
                                                end
                                        end
                                        if(tasks[s].rewards.second.enable) then
                                                if(tasks[s].rewards.second.type == "boss") then
                                                        doTeleportThing(cid, tasks[s].rewards.second.values)
                                                elseif(tasks[s].rewards.second.type == "exp") then
                                                        doPlayerAddExperience(cid, tasks[s].rewards.second.values)
                                                elseif(tasks[s].rewards.second.type == "item") then
                                                        doPlayerAddItem(cid, tasks[s].rewards.second.values[1], tasks[s].rewards.second.values[2])
                                                elseif(tasks[s].rewards.second.type == "money") then
                                                        doPlayerAddMoney(cid, tasks[s].rewards.second.values)
                                                elseif(tasks[s].rewards.second.type == "storage") then
                                                        doPlayerSetStorageValue(cid, tasks[s].rewards.second.values[1], tasks[s].rewards.second.values[2])
                                                end
                                        end
                                        if(tasks[s].rewards.third.enable) then
                                                if(tasks[s].rewards.third.type == "boss") then
                                                        doTeleportThing(cid, tasks[s].rewards.third.values)
                                                elseif(tasks[s].rewards.third.type == "exp") then
                                                        doPlayerAddExperience(cid, tasks[s].rewards.third.values)
                                                elseif(tasks[s].rewards.third.type == "item") then
                                                        doPlayerAddItem(cid, tasks[s].rewards.third.values[1], tasks[s].rewards.third.values[2])
                                                elseif(tasks[s].rewards.third.type == "money") then
                                                        doPlayerAddMoney(cid, tasks[s].rewards.third.values)
                                                elseif(tasks[s].rewards.third.type == "storage") then
                                                        doPlayerSetStorageValue(cid, tasks[s].rewards.third.values[1], tasks[s].rewards.third.values[2])
                                                end
                                        end                           
                                else
                                        selfSay('Current ' .. getPlayerStorageValue(cid, tasks[s].questStorage) .. ' ' .. tasks[s].raceName .. ' killed, you need to kill ' .. tasks[s].killsRequired .. '.', cid)
                                end
                        else
                                selfSay('You do not have started any task.', cid)
                        end
                end
                return true
        end
     
        npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
        npcHandler:addModule(FocusModule:new())
 
Ostatnia edycja:
Odp: Szukam dzia?aj?cych task?w do tfs 0.4 tibia 8.6

Teraz dzia?a npc, ale nie liczy zabi?.
18:19 Tasker: Current 0 Trolls killed, you need to kill 100.
 
Status
Zamknięty.
Back
Do góry