Pedrook
Advanced OT User
- Joined
- May 24, 2009
- Messages
- 457
- Solutions
- 3
- Reaction score
- 194
- Location
- Brazil
- GitHub
- pedrogiampietro
my task script, only reads the first name of the bixo for example
"troll" and if I want to add more than one "troll", "swamp troll", it does not count.
already tried "troll, swamp troll",
no way no one could help me?
lib/task system.
"troll" and if I want to add more than one "troll", "swamp troll", it does not count.
already tried "troll, swamp troll",
no way no one could help me?
lib/task system.
Code:
task_monsters = {
[1] = {nome = "swamp troll", nome ="troll", storage = 30000, amount = 20, exp = 5000, pointsTask = {1, 1}, items = {{id = 2157, count = 1}, {id = 2160, count = 3}}},
[2] = {nome = "minotaur" "minotaur archer" "minotaur guard" "minotaur mage", storage = 30001, amount = 10, exp = 1500, pointsTask = {1, 1}, items = {{id = 11244, count = 1}, {id = 5804, count = 1}}},
[3] = {nome = "monstro2", storage = 30002, amount = 10, exp = 18000, pointsTask = {1, 1}, items = {{id = 2195, count = 1}, {id = 2160, count = 8}}},
[4] = {nome = "monstro3", storage = 30003, amount = 10, exp = 20000, pointsTask = {1, 1}, items = {{id = 2520, count = 1}, {id = 2160, count = 10}}}
}
task_daily = {
[1] = {nome = "monstroDay1", storage = 40000, amount = 10, exp = 5000, pointsTask = {1, 1}, items = {{id = 2157, count = 1}, {id = 2160, count = 3}}},
[2] = {nome = "monstroDay2", storage = 40001, amount = 10, exp = 10000, pointsTask = {1, 1}, items = {{id = 10521, count = 1}, {id = 2160, count = 5}}},
[3] = {nome = "monstroDay3", storage = 40002, amount = 10, exp = 18000, pointsTask = {1, 1}, items = {{id = 2195, count = 1}, {id = 2160, count = 8}}},
[4] = {nome = "monstroDay4", storage = 40003, amount = 10, exp = 20000, pointsTask = {1, 1}, items = {{id = 2520, count = 1}, {id = 2160, count = 10}}}
}
task_storage = 20020 -- storage que verifica se está fazendo alguma task e ver qual task é - task normal
task_points = 20021 -- storage que retorna a quantidade de pontos task que o player tem.
task_sto_time = 20022 -- storage de delay para não poder fazer a task novamente caso ela for abandonada.
task_time = 20 -- tempo em horas em que o player ficará sem fazer a task como punição
task_rank = 20023 -- storage do rank task
taskd_storage = 20024 -- storage que verifica se está fazendo alguma task e ver qual task é - task daily
time_daySto = 20025 -- storage do tempo da task daily, no caso para verificar e add 24 horas para fazer novamente a task daily
local ranks_task = {
[{1, 20}] = "Newbie",
[{21, 50}] = "Elite",
[{51, 100}] = "Master",
[{101, 200}] = "Destroyer",
[{201, math.huge}] = "Juggernaut"
}
function getTaskInfos(uid)
return task_monsters[Player(uid):getStorageValue(task_storage)] or false
end
function getTaskDailyInfo(uid)
return task_daily[Player(uid):getStorageValue(taskd_storage)] or false
end
function taskPoints_get(uid)
if Player(uid):getStorageValue(task_points) == -1 then
return 0
end
return Player(uid):getStorageValue(task_points)
end
function taskPoints_add(uid, count)
return Player(uid):setStorageValue(task_points, taskPoints_get(uid) + count)
end
function taskPoints_remove(uid, count)
return Player(uid):setStorageValue(task_points, taskPoints_get(uid) - count)
end
function taskRank_get(uid)
if Player(uid):getStorageValue(task_rank) == -1 then
return 1
end
return Player(uid):getStorageValue(task_rank)
end
function taskRank_add(uid, count)
return Player(uid):setStorageValue(task_rank, taskRank_get(uid) + count)
end
function getRankTask(uid)
local pontos = taskRank_get(uid)
for _, z in pairs(ranks_task) do
if pontos >= _[1] and pontos <= _[2] then
return z
end
end
end
function getItemsFromTable(itemtable)
local text = ""
for v = 1, #itemtable do
count, info = itemtable[v].count, ItemType(itemtable[v].id)
local ret = ", "
if v == 1 then
ret = ""
elseif v == #itemtable then
ret = " - "
end
text = text .. ret
text = text .. (count > 1 and count or info:getArticle()).." "..(count > 1 and info:getPluralName() or info:getName())
end
return text
end