<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Simple Task" version="4.0" author="Vodkart" contact="tibiaking.com" enabled="yes">
<config name="task_func"><![CDATA[
task_sys = {
[1] = {name = "Cyclops", start = 176201, monsters_list = {"Cyclops","Cyclops Smith"}, level = 8, count = 1, points = 1, items = {}, reward = {}, exp = 7000000, money = 50000000},
[2] = {name = "Dragon", start = 176202, monsters_list = {"Dragon","Dragon Lord","Donate Dragon Lord","Dragon Lord Vip III","Castle Dragon Lord","Wyrm","Undead Dragon"}, level = 100, count = 1, points = 2, items = {}, reward = {{7440,1}}, exp = 8000000, money = 60000000},
[3] = {name = "Hydra", start = 176203, monsters_list = {"Hydra","Hydra Vip","Hydra Vip II"}, level = 150, count = 800, points = 2, items = {}, reward = {{7440,1}}, exp = 8000000, money = 60000000},
[4] = {name = "Frost Dragon", start = 176204, monsters_list = {"Frost Dragon","Frost Dragon Hatchling","Frost Dragon Vip","Donate Frost Dragon","Castle Frost Dragon"}, level = 150, count = 1, points = 2, items = {}, reward = {{7440,1}}, exp = 8000000, money = 70000000},
[5] = {name = "Behemoth", start = 176205, monsters_list = {"Behemoth","Hellspawn"}, level = 150, count = 500, points = 2, items = {}, reward = {{7440,1}}, exp = 8000000, money = 70000000},
[6] = {name = "Demon", start = 176206, monsters_list = {"Demon","Demon Vip","Demon Vip III","Donate Demon","Castle Demon"}, level = 200, count = 1, points = 3, items = {}, reward = {{7440,1}}, exp = 9000000, money = 90000000},
[7] = {name = "Grim Reaper", start = 176207, monsters_list = {"Castle Grim Reaper","Grim Reaper","Grim Reaper Vip III","Donate Grim Reaper"}, level = 200, count = 1, points = 3, items = {}, reward = {{7440,1}}, exp = 9000000, money = 80000000},
[8] = {name = "Warlock", start = 176208, monsters_list = {"Warlock","Warlock Vip","Donate Warlock","Castle Warlock"}, level = 200, count = 1, points = 3, items = {}, reward = {{7440,1}}, exp = 9000000, money = 80000000},
[9] = {name = "Hero", start = 176209, monsters_list = {"Hero"}, level = 200, count = 1, points = 3, items = {}, reward = {{7440,1}}, exp = 9000000, money = 80000000},
[10] = {name = "Fury", start = 176210, monsters_list = {"Fury","Infernalist"}, level = 200, count = 1, points = 3, items = {}, reward = {{7440,1}}, exp = 9000000, money = 80000000},
[11] = {name = "Medusa", start = 176211, monsters_list = {"Medusa","Medusa Vip"}, level = 250, count = 1, points = 3, items = {}, reward = {{7440,1}}, exp = 9000000, money = 80000000},
[12] = {name = "Lizard Dragon Priest", start = 176212, monsters_list = {"Serpent Spawn","Lizard Dragon Priest"}, level = 200, count = 1, points = 3, items = {}, reward = {{7440,1}} exp = 9000000, money = 80000000},
[13] = {name = "Nightmare" ,start = 176213, monsters_list = {"Nightmare","Lost Soul","Mr. Punish"}, level = 200, count = 1, points = 3, items = {}, reward = {{7440,1}}, exp = 9000000, money = 80000000},
[14] = {name = "Juggernaut" ,start = 176214, monsters_list = {"Juggernaut","Massacre"}, level = 200, count = 1, points = 3, items = {}, reward = {{7440,1}}, exp = 9000000, money = 80000000},
[15] = {name = "Ferumbras" ,start = 176215, monsters_list = {"Ferumbras"}, level = 200, count = 1, points = 3, items = {}, reward = {{7440,1}}, exp = 9000000, money = 80000000},
[16] = {name = "Defiler" ,start = 176216, monsters_list = {"Defiler"}, level = 250, count = 1, points = 3, items = {}, reward = {{7440,1}}, exp = 9000000, money = 80000000},
[17] = {name = "Fluffy" ,start = 176217, monsters_list = {"Fluffy","Hellhound"}, level = 250, count = 1, points = 3, items = {}, reward = {{7440,1}}, exp = 9000000, money = 90000000},
[18] = {name = "Hellfire Fighter" ,start = 176218, monsters_list = {"Hellfire Fighter"}, level = 300, count = 1, points = 4, items = {}, reward = {{7440,1}}, exp = 90000000, money = 300000000},
[19] = {name = "Dark Torturer" ,start = 176219, monsters_list = {"Dark Torturer","Betrayed Wraith"}, level = 250, count = 1, points = 3, items = {}, reward = {{7440,1}}, exp = 20000000, money = 300000000},
[20] = {name = "Nomad" ,start = 176220, monsters_list = {"Nomad"}, level = 250, count = 1, points = 4, items = {}, reward = {{7440,1}}, exp = 90000000, money = 300000000},
[21] = {name = "Lethal Lissy" ,start = 176221, monsters_list = {"Lethal Lissy"}, level = 250, count = 1, points = 4, items = {}, reward = {{7440,1}}, exp = 90000000, money = 300000000},
[22] = {name = "Storm Wolf" ,start = 176222, monsters_list = {"Storm Wolf"}, level = 250, count = 1, points = 5, items = {}, reward = {{7440,1}}, exp = 90000000, money = 400000000},
[23] = {name = "Deadeye Devious" ,start = 176223, monsters_list = {"Deadeye Devious"}, level = 250, count = 1, points = 5, items = {}, reward = {{7440,1}}, exp = 90000000, money = 500000000},
[24] = {name = "Gang Member" ,start = 176224, monsters_list = {"Gang Member"}, level = 250, count = 1, points = 5, items = {}, reward = {{7440,1}}, exp = 90000000, money = 600000000},
[25] = {name = "Draken Abomination" ,start = 176225, monsters_list = {"Draken Abomination"}, level = 250, count = 1, points = 5, items = {}, reward = {{7440,1}}, exp = 90000000, money = 700000000}
}
daily_task = {
[1] = {name = "Ghastly Dragon" ,monsters_list = {"Ghastly Dragon"}, count = 1, points = 2, reward = {{7440,1}}, exp = 90000000, money = 700000000},
[2] = {name = "Werewolf" ,monsters_list = {"Werewolf"}, count = 1, points = 2, reward = {{7440,1}}, exp = 90000000, money = 700000000},
[3] = {name = "Draken Elite" ,monsters_list = {"Draken Elite"}, count = 1, points = 2, reward = {{7440,1}}, exp = 90000000, money = 700000000},
[4] = {name = "Eternal Guardian" ,monsters_list = {"Eternal Guardian"}, count = 1, points = 3, reward = {{7440,1}}, exp = 90000000, money = 700000000},
[5] = {name = "Draken Warmaster" ,monsters_list = {"Draken Warmaster"}, count = 1, points = 3, reward = {{7440,1}}, exp = 90000000, money = 700000000},
[6] = {name = "Morgaroth" ,monsters_list = {"Morgaroth"}, count = 1, points = 3, reward = {{7440,1}}, exp = 90000000, money = 700000000},
[7] = {name = "Annihilon" ,monsters_list = {"Annihilon"}, count = 1, points = 3, reward = {{7440,1}}, exp = 90000000, money = 700000000},
[8] = {name = "Ghazbaran" ,monsters_list = {"Ghazbaran"}, count = 1, points = 3, reward = {{7440,1}}, exp = 90000000, money = 700000000},
[9] = {name = "Dragon" ,monsters_list = {"Dragon","Dragon Lord","Donate Dragon Lord","Dragon Lord Vip III","Castle Dragon Lord","Wyrm","Undead Dragon"}, count = 1, points = 3, reward = {{7440,1}}, exp = 90000000, money = 700000000},
[10] = {name = "Frost Dragon" ,monsters_list = {"Frost Dragon","Frost Dragon Hatchling","Frost Dragon Vip","Donate Frost Dragon","Castle Frost Dragon"}, count = 1, points = 4, reward = {{12505,1}}, exp = 90000000, money = 700000000},
[11] = {name = "Grim Reaper" ,monsters_list = {"Castle Grim Reaper","Grim Reaper","Grim Reaper Vip III","Donate Grim Reaper"}, count = 1, points = 4, reward = {{12505,1}}, exp = 90000000, money = 700000000},
[12] = {name = "Demon" ,monsters_list = {"Demon","Demon Vip","Demon Vip III","Donate Demon","Castle Demon"}, count = 1, points = 4, reward = {{12505,1}}, exp = 90000000, money = 700000000}
}
task_sys_storages = {176601, 176602, 176603, 176604, 176605, 176606, 176607, 176608} -- task, points, count, daily task, daily count, daily time , daily start, contador
function getTaskMission(cid)
return getPlayerStorageValue(cid,task_sys_storages[1]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[1])
end
function getDailyTaskMission(cid)
return getPlayerStorageValue(cid,task_sys_storages[4]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[4])
end
function getTaskPoints(cid)
return getPlayerStorageValue(cid,task_sys_storages[2]) < 0 and 0 or getPlayerStorageValue(cid,task_sys_storages[2])
end
function doRandomDailyTask(cid)
local t = {
[{150,200}] = {1,3},
[{201,350}] = {4,6},
[{351,500}] = {7,9},
[{501,math.huge}] = {10,12}
}
for a , b in pairs(t) do
if getPlayerLevel(cid) >= a[1] and getPlayerLevel(cid) <= a[2] then
return math.random(b[1], b[2])
end
end
return 0
end
function GetRankTask(cid)
local ranks = {
[{1, 20}] = "Bronze",
[{21, 50}] = "Prata",
[{51, 100}] = "Ouro",
[{101, 200}] = "Platina",
[{201, 250}] = "Diamante",
[{251, 300}] = "Mestre",
[{301, math.huge}] = "Challenger"
}
for v , r in pairs(ranks) do
if getTaskPoints(cid) >= v[1] and getTaskPoints(cid) <= v[2] then
return r
end
end
return 0
end
function getItemsFromList(items)
local str = ''
if table.maxn(items) > 0 then
for i = 1, table.maxn(items) do
str = str .. items[2] .. ' ' .. getItemNameById(items[1])
if i ~= table.maxn(items) then str = str .. ', '
end
end
end
return str
end
function doRemoveItemsFromList(cid,items)
local count = 0
if table.maxn(items) > 0 then
for i = 1, table.maxn(items) do
if getPlayerItemCount(cid,items[1]) >= items[2] then
count = count + 1 end
end
end
if count == table.maxn(items) then
for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[1],items[2]) end
else
return false
end
return true
end
function getMonsterFromList(monster)
local str = ''
if #monster > 0 then
for i = 1, #monster do
str = str .. monster
if i ~= #monster then str = str .. ', ' end
end
end
return str
end
function GiveRewardsTask(cid, items)
local backpack = doPlayerAddItem(cid, 1999, 1) -- backpackID
for _, i_i in ipairs(items) do
local item, amount = i_i[1],i_i[2]
if isItemStackable(item) or amount == 1 then
doAddContainerItem(backpack, item, amount)
else
for i = 1, amount do
doAddContainerItem(backpack, item, 1)
end
end
end
end
function isSummon(cid)
if(not isCreature(cid)) then
return false
end
return getCreatureMaster(cid) ~= cid
end
]]></config>
<event type="login" name="TaskLogin" event="script"><![CDATA[
function onLogin(cid)
registerCreatureEvent(cid, "KillTask")
registerCreatureEvent(cid, "TaskLook")
return true
end]]></event>
<talkaction words="/task;!task" event="buffer"><![CDATA[
domodlib('task_func')
param,task,daily = param:lower(), getTaskMission(cid), getDailyTaskMission(cid)
if isInArray({"counter","contador"},param) then
setPlayerStorageValue(cid, task_sys_storages[8], getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and 1 or 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] O contador foi "..(getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and "ativado" or "desativado")..".") return true
elseif isInArray({"daily","diaria"},param) then
if not daily_task[daily] or getPlayerStorageValue(cid, task_sys_storages[7]) <= 0 then
doPlayerSendCancel(cid, "Desculpe, Mas voce nao esta em nenhuma Daily Task.") return true
elseif getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily_task[daily].count then
doPlayerSendCancel(cid,"Desculpe, Mas Voce nao terminou a Daily Task a tempo! Por favor volte ao npc e comece uma nova Daily Task!") return true
end
return doShowTextDialog(cid, 8983, "[->] CURRENT DAILY TASK INFO [<-]\n\nNome: "..daily_task[daily].name.."\nProgresso: ["..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[5])).."/"..daily_task[daily].count.."]\nPrazo para entrega: "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).."\nMonstros para caçar: "..getMonsterFromList(daily_task[daily].monsters_list).."\n\n[->] CURRENT TASK REWARDS [<-]\n\nMoney: "..(daily_task[daily].money > 0 and daily_task[daily].money or 0).."\nExperiencia: "..(daily_task[daily].exp > 0 and daily_task[daily].exp or 0).."\nTask Points: "..daily_task[daily].points.."\nItems: "..(#daily_task[daily].reward > 0 and getItemsFromList(daily_task[daily].reward) or "Nenhum item de recompensa")..".")
end
if not task_sys[task] or getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
doPlayerSendCancel(cid, "voce nao esta em nenhuma task.") return true
end
return doShowTextDialog(cid, 8983, "-> CURRENT TASK ["..getTaskMission(cid).."/"..#task_sys.."] <-\n\nTask Name: "..task_sys[task].name.."\nTask Level: "..task_sys[task].level.."\nTask Progress: ["..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[3])).."/"..task_sys[task].count.."]\nMonster To Hunt: "..getMonsterFromList(task_sys[task].monsters_list)..".\nItens Para Entrega: "..(#task_sys[task].items > 0 and getItemsFromList(task_sys[task].items) or "Nenhum")..".\n\n[->] CURRENT TASK REWARDS [<-]\n\nReward Money: "..(task_sys[task].money > 0 and task_sys[task].money or 0).."\nReward Experiencia: "..(task_sys[task].exp > 0 and task_sys[task].exp or 0).."\nReward Points: "..task_sys[task].points.."\nRedward Items: "..(#task_sys[task].reward > 0 and getItemsFromList(task_sys[task].reward) or "Nenhum item de recompensa")..".")
]]></talkaction>
<event type="look" name="TaskLook" event="script"><![CDATA[
domodlib('task_func')
function onLook(cid, thing, position, lookDistance)
if isPlayer(thing.uid) and getTaskPoints(thing.uid) > 0 then
doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").. " is a "..GetRankTask(thing.uid))
end
return true
end]]></event>
<event type="kill" name="KillTask" event="script"><![CDATA[
domodlib('task_func')
function onKill(cid, target)
if isPlayer(cid) and isMonster(target) then
local t,daily = task_sys[getTaskMission(cid)], daily_task[getDailyTaskMission(cid)]
if t and getPlayerStorageValue(cid, t.start) > 0 and isInArray(t.monsters_list, getCreatureName(target):lower()) and getPlayerStorageValue(cid, task_sys_storages[3]) < t.count then
setPlayerStorageValue(cid, task_sys_storages[3], getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 1 or (getPlayerStorageValue(cid, task_sys_storages[3])+1))
if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and getPlayerStorageValue(cid, task_sys_storages[3]) < t.count then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] defeated Total [" .. getPlayerStorageValue(cid, task_sys_storages[3]) .. "/" .. t.count .. "] da Task do " .. t.name .. ".")
end
if getPlayerStorageValue(cid, task_sys_storages[3]) >= t.count then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] Parabens! Voce terminou a Task do "..t.name..", volte ao npc parece receber sua recompensa.")
end
end
if daily and getPlayerStorageValue(cid, task_sys_storages[7]) > 0 and getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() >= 0 and isInArray(daily.monsters_list, getCreatureName(target):lower()) and getPlayerStorageValue(cid, task_sys_storages[5]) < daily.count then
setPlayerStorageValue(cid, task_sys_storages[5], getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 1 or (getPlayerStorageValue(cid, task_sys_storages[5])+1))
if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily.count then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Daily Task System] defeated Total [" .. getPlayerStorageValue(cid, task_sys_storages[5]) .. "/" .. daily.count .. "] da Task do " .. daily.name .. ".")
end
if getPlayerStorageValue(cid, task_sys_storages[5]) >= daily.count then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Daily Task System] Parabens! Voce terminou a Task do "..daily.name..", volte ao npc parece receber sua recompensa.")
end
end
end
return true
end]]></event>
<action actionid="65521;65522;65523;65524;65525;65526;65527;65528;65529;65530;65531;65532;65533;65534" event="script"><![CDATA[
domodlib('task_func')
function onUse(cid, item, frompos, item2, topos)
local t = {[65521] = 50, [65522] = 80, [65523] = 90, [65524] = 100, [65525] = 110, [65526] = 120, [65527] = 130, [65528] = 140, [65529] = 150, [65530] = 160, [65531] = 170, [65532] = 180, [65533] = 190, [65534] = 200}
if not t[item.actionid] then return true end
if getTaskPoints(cid) < t[item.actionid] then
return doPlayerSendTextMessage(cid,22,"Você só pode passar se tiver " .. t[item.actionid] .. " Task Points.")
end
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, topos, true)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Welcome, Task Hunter!")
return true
end]]></action>
</mod>
tbm esta dando um erro no final do mods em action que vc falow que coloca em portas vo te mandar o erro
[3/4/2018 15:32:11] [Error - Test Interface]
[3/4/2018 15:32:11] domodlib('task_func')
[3/4/2018 15:32:11] function onUse(cid, item, frompos, item2, topos)
[3/4/2018 15:32:11] local t = {[65521] = 50, [65522] = 80, [65523] = 90, [65524] = 100, [65525] = 110, [65526] = 120, [65527] = 130, [65528] = 140, [65529] = 150, [65530] = 160, [65531] = 170, [65532] = 180, [65533] = 190, [65534] = 200}
[3/4/2018 15:32:11] if not t[item.actionid] then return true end
[3/4/2018 15:32:11] if getTaskPoints(cid) < t[item.actionid] then
[3/4/2018 15:32:11] return doPlayerSendTextMessage(cid,22,"Você só pode passar se tiver " .. t[item.actionid] .. " Task Points.")
[3/4/2018 15:32:11] end
[3/4/2018 15:32:11] doTransformItem(item.uid, item.itemid + 1)
[3/4/2018 15:32:11] doTeleportThing(cid, topos, true)
[3/4/2018 15:32:11] doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Welcome, Task Hunter!")
[3/4/2018 15:32:11] return true
[3/4/2018 15:32:11] end
[3/4/2018 15:32:11] Description:
[3/4/2018 15:32:11] [string "task_sys = {..."]:13: '}' expected near 'exp'
esta dando o mesmo erro ainda apos eu ter colocado como vc falow
[3/4/2018 15:41:3] [Error - NpcScript Interface]
[3/4/2018 15:41:3] data/npc/scripts/simple_task.lua:onCreatureSay
[3/4/2018 15:41:3] Description:
[3/4/2018 15:41:3] [string "task_sys = {..."]:122: attempt to index local 'i_i' (a number value)
[3/4/2018 15:41:3] stack traceback:
[3/4/2018 15:41:3] [string "task_sys = {..."]:122: in function 'GiveRewardsTask'
[3/4/2018 15:41:3] data/npc/scripts/simple_task.lua:58: in function 'callback'
[3/4/2018 15:41:3] data/npc/lib/npcsystem/npchandler.lua:456: in function 'onCreatureSay'
[3/4/2018 15:41:3] data/npc/scripts/simple_task.lua:8: in function <data/npc/scripts/simple_task.lua:8>