Ir para conteúdo
  • Cadastre-se

Sistema [8.6] Task System 4.0! (Task system + Daily Task System)


Posts Recomendados

Em algum momento o script adiciona um string no contador 176603, varios caracteres estranhos, e logo depois disso os monstros não morrem por quem tem esse bug, eles ficam vivos e sem vida.

Link para o post
Compartilhar em outros sites
  • 2 weeks later...
  • Respostas 298
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Removido:   *Boss Room *Rank Task *Prêmios para os 10 primeiros a terminar todas as tasks   Adicionado:   *Daily Task System (Sistema exclusivo de Task diario,

tenta deixar essa linha: if isPlayer(cid) and isMonster(target) and not isSummon(target) then assim if isPlayer(cid) and isMonster(target) then   e testa

gostei dessa ideia, então estou num projeto e estou meio sem tempo, já passei parto do simple task pra tfs 1.2 e tal. terminando esse projeto e de passar o sistema pra tfs 1.2 eu começo a editar o sis

Posted Images

1 hora atrás, Saymon Kopolsky disse:

Testei aqui, o contador não tá funcionando. :(

 

Eu também tive esse problema, ele ensinou como resolver...

troca essa linha

if isPlayer(cid) and isMonster(target) and not isSummon(target) then

por essa

if isPlayer(cid) and isMonster(target) then

Que funciona, aqui pegou direitinho.

Link para o post
Compartilhar em outros sites
1 hora atrás, Skipper disse:

 

Eu também tive esse problema, ele ensinou como resolver...

troca essa linha


if isPlayer(cid) and isMonster(target) and not isSummon(target) then

por essa


if isPlayer(cid) and isMonster(target) then

Que funciona, aqui pegou direitinho.

Funfou, valeu. :D

https://www.youtube.com/SaymonKopolsky

 

589f09a9e1af9_SemTtulo-1.png.ddf1b437984d72bd5d4124b7e90762fa.png

https://www.youtube.com/SaymonKopolsky

 

 

 

Easy Mapper Map Editor 8.60: Clique aqui

[8.60] BeastXHunter: Clique aqui

 

5494899_orig.gif

Link para o post
Compartilhar em outros sites
  • 1 month later...

Testei aqui e não foi, Bugou tudo... OTX 2.1 Quando coloquei o mod e configurei os e bixo e ta, quando matava 1 monstro eles não sumia ... e no npc tbm não dava pra pegar a Task, VodKart Chamei vc no Skype.... de todas as formas muito obrigado pelo belo trabalho ;D

Link para o post
Compartilhar em outros sites
20 horas atrás, Adriano TibiaPronto disse:

Testei aqui e não foi, Bugou tudo... OTX 2.1 Quando coloquei o mod e configurei os e bixo e ta, quando matava 1 monstro eles não sumia ... e no npc tbm não dava pra pegar a Task, VodKart Chamei vc no Skype.... de todas as formas muito obrigado pelo belo trabalho ;D

 

Foi o erro que eu disse, em algum momento, o script adiciona um string no contador cheia de caracteres estranhos, a partir dai, os monstros nao morrem, ficam parados sem vida.

Link para o post
Compartilhar em outros sites

Não está funcionando o contador no OTX :( VERSION: 2.52 - 1557

 

Simplesmente não conta os monstros nem avança a task o de resto, NPC e tudo mais funfa só não ta contando quando mata

Link para o post
Compartilhar em outros sites
Em 11/01/2017 ás 20:28, Vodkart disse:

 

baixei um outro serve e testei, funcionou!

 

20:26 [Task System] defeated Total [1/40] da Task do Trolls.

 

 

 

Baiak Tyranno V2 VIP4 ! (8.6)

 

qual o servidor que vc baixou pra eu testar aqui?

 

Desculpa reviver o Topico,mas quando vou testar as "Task" com a ADM nao conta nada

O rei de seu proprio destino é aquele que luta pela gloria do amanhã!
Discord : ZoR#9373


 

Link para o post
Compartilhar em outros sites
  • 2 weeks later...

Não esta funcionando o contador de monstros, e o npc não esta reconhecendo as criaturas na hr de entregar, help!

 

tfs 0.4

Em 22/06/2017 em 14:25, Skipper disse:

 

Eu também tive esse problema, ele ensinou como resolver...

troca essa linha


if isPlayer(cid) and isMonster(target) and not isSummon(target) then

por essa


if isPlayer(cid) and isMonster(target) then

Que funciona, aqui pegou direitinho.

 

Problema resolvido, obrigado !

Editado por JcA (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 1 month later...
Em 08/01/2017 em 22:08, Vodkart disse:

Removido:

 

*Boss Room

*Rank Task

*Prêmios para os 10 primeiros a terminar todas as tasks

 

Adicionado:

 

*Daily Task System (Sistema exclusivo de Task diario, podendo pegar 1x a cada 24 hrs, irei explicar mais depois.)

*Task agora é por progresso, você não pode sair e voltar, terá que terminar a task 1 para avançar para a task  2, assim sucessivamente.

*Task Points

*Level para realizar a task

*Nova talkaction que mostra uma janela de informações sobre o level da task, premios que irá receber, progresso, etc...

*Items para entrega(Se o jogador deverá levar algum item junto com a quantidade de monstro morta) para finalizar a task

*Sistema de look Task (Varia de acordo com a sua quantidade de Task Points, podendo ficar por exemplo como "Huntsman", "Ranger", etc...(alterável)

*Mods e npc mais "clean", várias linhas removidas e o sistema está mais rápido

*Vou Adicionar "scripts extras" Como:

--> Tile que só passa quem tiver permissão depois de finalizar determinada quest

 --> Npc de Boss Room para entrar e enfrentar o monstro quem fez determinada quest

 

 

[+] Resumo do Task system + Daily Task System [+]

 

Task System: É o sistema de task "original", onde consiste em matar determinada quantidade de monstros(E entregar certo itens <- é configurável), para receber recompensas como Exp, Money e Items.

 

Algumas mudanças do simple task 3.0 para o 4.0 foram:

 

[+] O sistema agora é por progresso, isso quer dizer que você terá que ir terminando a quest para avançar para a seguinte.

[+] O sistema Também recebeu uma alteração, fazendo com que as Tasks precisem que o jogador tenha um level determinado

[+] A tabela para edição está mais fácil, fazendo com que você adicione ou remova monstros com mais tranquilidade, inclusive alterações das Rewards da Task.

 

Daily Task System: É um sistema que desenvolvi para que os jogadores sempre estejam se comunicando com o npc de Task, no caso da Task Diaria, vária de acordo com o level do jogador, por exemplo:

 

Jogadores entre level 6 ao 49 poderá cair em uma dessas 3 Task Diarias: Orcs, Tarantulas ou Wyverns

Jogadores entre level 50 ao 79 poderá cair em uma dessas 3 Task Diarias: Dragons, Wailing Widows ou Ancient Scarabs

 

E por ai vai, claro que você poderá aumentar as Task Diarias dependendo do level, eu fiz 3 para cada level que é pra postar, mas tudo isso você pode aumentar! Dependendo do seu servidor.

 

E sim, você pode fazer a TASK "ORIGINAL" e a TASK "DIARIA" ao mesmo tempo! Ambas são distintas e possuem Rewards diferenciadas!

 

No caso da Task diaria, levando em conta que você começou a fazer ela no dia 08/01 ás 20:00 Hrs, você tem até o dia 09/01 ás 20:00Hrs para termina-la e receber a recompensa, caso termine antes, a Task diaria só irá ficar disponível para repetição a partir desta mesma data 09/01 20:00 Hrs;

 

[+] Caso você não termine a tempo, não tem problema, basta esperar este horário e começar uma nova Task.

[+] Caso você começou a Daily Task e terminou antes desta data. mas por algum motivo esqueceu de entregar e a mesma passou do prazo, não tem importância, caso você tenha matado todos os monstros até 09/01 20:00 Hrs, você poderá entregar está Task em qualquer horário para receber suas Rewards e começar uma task a partir do momento em que você entregou! (INJUSTIÇA AQUI NÃO CARALHO).

 

[+] Comandos Adicionais [+]

 

/task -- Mostra as informações da sua Task Atual, como Nome da Task, Level, Rewards, Monstros que você poderá matar, Se tem que entregar algum Item junto, etc...

/task daily -- É basicamente mostra a mesma informação da Task Principal, porém mostra também qual o prazo limite para entrega da task.

/task counter -- É um comando que ATIVA ou DESATIVA o contador de monstros mortos na task no seu Channel.

 

[+] Imagens [+]

 

Cline neste link para ver algumas imagens da Task : http://imgur.com/a/eLIY3

 

 

 

------------------------------------------------ // --------------------------------------------------------------

 

[+] Instalação do Sistema [+]

 

Requisitos: Nível Médio de conhecimento em scripting LUA

 

Pasta Mods

 

Simple Task.xml


<?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 = "Trolls", start = 176201, monsters_list = {"Troll","Troll champion"}, level = 8, count = 40, points = 0, items = {}, reward = {}, exp = 2000, money = 2000},
	[2] = {name = "rotworms", start = 176202, monsters_list = {"rotworm","carrion worm","Rotworm Queen"}, level = 12, count = 50, points = 0, items = {}, reward = {}, exp = 2500, money = 3000},
	[3] = {name = "cyclops", start = 176203, monsters_list = {"cyclops","cyclops smith","cyclops drone"}, level = 19, count = 60, points = 0, items = {}, reward = {}, exp = 3000, money = 3000},
	[4] = {name = "Green Djinn", start = 176204, monsters_list = {"Green Djinn","Efreet"}, level = 23, count = 80, points = 1, items = {}, reward = {}, exp = 10000, money = 5000},
	[5] = {name = "Blue Djinn", start = 176205, monsters_list = {"Blue Djinn","Marid"}, level = 25, count = 80, points = 1, items = {}, reward = {}, exp = 10000, money = 5000},
	[6] = {name = "pirates", start = 176206, monsters_list = {"Pirate Marauder","Pirate Cutthroat","Pirate Buccaneer","Pirate Corsair"}, level = 30, count = 120, points = 2, items = {}, reward = {}, exp = 10000, money = 5000},
	[7] = {name = "Stone Golems", start = 176207, monsters_list = {"Stone Golem"}, level = 33, count = 130, points = 3, items = {}, reward = {}, exp = 12000, money = 7000},
	[8] = {name = "Carniphilas", start = 176208, monsters_list = {"carniphila"}, level = 36, count = 135, points = 3, items = {}, reward = {}, exp = 8000, money = 8000},
	[9] = {name = "Ice Golems", start = 176209, monsters_list = {"ice golem"}, level = 40, count = 150, points = 2, items = {}, reward = {}, exp = 12000, money = 8200},
	[10] = {name = "Wailing Widows", start = 176210, monsters_list = {"Wailing Widow"}, level = 42, count = 150, points = 3, items = {}, reward = {}, exp = 0, money = 0},
	[11] = {name = "Mutated Rats", start = 176211, monsters_list = {"Mutated Rat"}, level = 46, count = 170, points = 2, items = {}, reward = {}, exp = 8000, money = 8500},
	[12] = {name = "Dragons", start = 176212, monsters_list = {"dragon"}, level = 50, count = 120, points = 1, items = {}, reward = {}, exp = 9000, money = 9000},
	[13] = {name = "Necromancer" ,start = 176213, monsters_list = {"Necromancer"}, level = 60, count = 200, points = 3, items = {}, reward = {}, exp = 20000, money = 15000},
	[14] = {name = "Crystal Spiders" ,start = 176214, monsters_list = {"Crystal Spider"}, level = 63, count = 250, points = 3, items = {}, reward = {}, exp = 25000, money = 11000},
	[15] = {name = "Giant Spider" ,start = 176215, monsters_list = {"Giant Spider","The old widow"}, level = 80, count = 500, points = 0, items = {}, reward = {}, exp = 20000, money = 32000},
	[16] = {name = "Underwater Quaras" ,start = 176216, monsters_list = {"quara predator","quara constrictor","quara hydromancer","quara mantassin","quara pincher"}, level = 82, count = 550, points = 3, items = {}, reward = {}, exp = 22000, money = 15000},
	[17] = {name = "Underwater Quaras Scout" ,start = 176217, monsters_list = {"quara predator scout","quara constrictor scout","quara hydromancer scout","quara mantassin scout","quara pincher scout"}, level = 83, count = 600, points = 3, items = {}, reward = {}, exp = 25000, money = 18000},
	[18] = {name = "Hellspawn" ,start = 176218, monsters_list = {"Hellspawn"}, level = 85, count = 600, points = 4, items = {}, reward = {}, exp = 28000, money = 26000},
	[19] = {name = "Dragon Lords" ,start = 176219, monsters_list = {"Dragon lord"}, level = 88, count = 650, points = 3, items = {}, reward = {}, exp = 30000, money = 35000},
	[20] = {name = "Lizard Dragons" ,start = 176220, monsters_list = {"Lizard Chosen","Lizard Dragon Priest","Lizard High Guard","Lizard Legionnaire", "Lizard Zaogun"}, level = 90, count = 600, points = 4, items = {}, reward = {}, exp = 28000, money = 26000},
	[21] = {name = "Nightmare" ,start = 176221, monsters_list = {"Nightmare","nightmare scion"}, level = 95, count = 650, points = 2, items = {}, reward = {}, exp = 30000, money = 35000},
	[22] = {name = "Hydras" ,start = 176222, monsters_list = {"Hydra"}, level = 100, count = 700, points = 3, items = {}, reward = {}, exp = 40000, money = 40000},
	[23] = {name = "Serpent Spawn" ,start = 176223, monsters_list = {"Serpent Spawn"}, level = 103, count = 720, points = 4, items = {}, reward = {}, exp = 50000, money = 45000},
	[24] = {name = "Hellhounds" ,start = 176224, monsters_list = {"Hellhound"}, level = 107, count = 650, points = 2, items = {}, reward = {}, exp = 30000, money = 35000},
	[25] = {name = "Demons" ,start = 176225, monsters_list = {"Demon"}, level = 110, count = 666, points = 4, items = {}, reward = {}, exp = 66600, money = 66000}
}
daily_task = {
	[1] = {name = "Orcs" ,monsters_list = {"Orc Berserker","Orc Rider","Orc Leader","Orc Warlord"}, count = 100, points = 0, reward = {}, exp = 5000, money = 10000},
	[2] = {name = "TarantulaS" ,monsters_list = {"Tarantula"}, count = 120, points = 1, reward = {}, exp = 9000, money = 12000},
	[3] = {name = "Wyvern" ,monsters_list = {"Wyvern"}, count = 125, points = 2, reward = {}, exp = 9000, money = 15000},
	[4] = {name = "Dragons" ,monsters_list = {"Dragon","Dragon Hatchling"}, count = 150, points = 0, reward = {}, exp = 2000, money = 10000},
	[5] = {name = "Wailing Widows" ,monsters_list = {"Wailing Widows"}, count = 200, points = 1, reward = {}, exp = 20000, money = 25000},
	[6] = {name = "Ancient Scarabs" ,monsters_list = {"Ancient Scarab"}, count = 180, points = 5, reward = {}, exp = 22000, money = 18000},
	[7] = {name = "High Class Lizards" ,monsters_list = {"Corrupted Soul","Eternal Guardian","Lizard Chosen","Lizard Dragon Priest","Lizard High Guard","Lizard Legionnaire","Lizard Magistratus","Lizard Noble","Lizard Zaogun"}, count = 300, points = 3, reward = {}, exp = 50000, money = 60000},
	[8] = {name = "Mutated BatS" ,monsters_list = {"Mutated Bat"}, count = 260, points = 2, reward = {}, exp = 40000, money = 55000},
	[9] = {name = "Giant Spiders" ,monsters_list = {"Giant Spider"}, count = 350, points = 3, reward = {}, exp = 60000, money = 70000},
	[10] = {name = "Undead Dragons" ,monsters_list = {"Undead Dragon"}, count = 500, points = 3, reward = {{2173,1}}, exp = 90000, money = 120000},
	[11] = {name = "HydraS" ,monsters_list = {"Hydra"}, count = 600, points = 3, reward = {{2173,1}}, exp = 100000, money = 160000},
	[12] = {name = "Ghastly Dragons" ,monsters_list = {"Ghastly Dragon"}, count = 700, points = 3, reward = {{2173,1}}, exp = 130000, money = 200000}
}
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 = {
		[{6,49}] = {1,3},
		[{50,79}] = {4,6},
		[{80,129}] = {7,9},
		[{130,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}] = "Huntsman", 
		[{21, 50}] = "Ranger",
		[{51, 100}] = "Big Game Hunter",
		[{101, 200}] = "Trophy Hunter",		
		[{201, math.huge}] = "Elite Hunter"
	}
	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[i][2] .. ' ' .. getItemNameById(items[i][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[i][1]) >= items[i][2] then
			count = count + 1 end 
		end 
	end
	if count == table.maxn(items) then
		for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[i][1],items[i][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[i]
			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 você não está 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 Você não 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, "você não está 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) and not isSummon(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] Parabéns! Você 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] Parabéns! Você terminou a Task do "..daily.name..", volte ao npc parece receber sua recompensa.")
			end
		end 
	end
	return true
end]]></event>
</mod>

 

 

NPC:

 

 

Ludger.xml


<?xml version="1.0"?>
<npc name="Ludger" script="data/npc/scripts/simple_task.lua" walkinterval="50000" floorchange="0">
<health now="100" max="100"/>
<look type="129" head="95" body="116" legs="121" feet="115" addons="3"/>
<parameters>
<parameter key="message_greet" value="Ola |PLAYERNAME|. Deseja fazer uma {task} ou {daily} task? Ou quer {entregar} sua task e receber premios por ela!" />
</parameters>
</npc>

 

simple_task.lua


domodlib('task_func')
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
function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end
	local talkUser,msg, str,rst = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, msg:lower(),"",""
	local task,daily, hours = getTaskMission(cid),getDailyTaskMission(cid), 24
	if isInArray({"task","tasks","missao","mission"}, msg) then
		if task_sys[task] then
			if getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
				if getPlayerLevel(cid) >= task_sys[task].level then
					setPlayerStorageValue(cid, task_sys[task].start, 1)
					npcHandler:say("[Task System] Parabéns, agora você está participando da Task do "..task_sys[task].name.." e deverá matar "..task_sys[task].count.." desta lista: "..getMonsterFromList(task_sys[task].monsters_list)..". "..(#task_sys[task].items > 0 and "Ah e por favor me traga "..getItemsFromList(task_sys[task].items).." para mim." or "").."" , cid)
				else
					npcHandler:say("Desculpe, Mas você precisa alcançar level "..task_sys[task].level.." para poder participar da Task dos "..task_sys[task].name.."!", cid)
				end
			else
				npcHandler:say("Desculpe, Mas você atualmente está na task "..task_sys[task].name..". Você pode {entregar} caso já tenha terminado.", cid)
			end
		else
			npcHandler:say("Desculpe, Mas por enquanto não tenho mais nenhuma task para você!", cid)
		end
	elseif isInArray({"diaria","daili","daily","dayli","diario"}, msg) then
		if getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() > 0 then
			npcHandler:say("Desculpe, você deve esperar até "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).." para iniciar uma nova task diaria!", cid) return true
		elseif daily_task[daily] and getPlayerStorageValue(cid, task_sys_storages[5]) >= daily_task[daily].count then
			npcHandler:say("Desculpe, você tem task para {entregar} !", cid) return true
		end
		local r = doRandomDailyTask(cid)
		if r == 0 then
			npcHandler:say("Desculpe, mas você não tem level para completar nenhuma Task diaria.", cid) return true
		end
		setPlayerStorageValue(cid, task_sys_storages[4], r)
		setPlayerStorageValue(cid, task_sys_storages[6], os.time()+hours*3600)
		setPlayerStorageValue(cid, task_sys_storages[7], 1)
		setPlayerStorageValue(cid, task_sys_storages[5], 0)
       local dtask = daily_task[r]
		npcHandler:say("[Daily Task System] Parabéns, agora você está participando da Task Diaria do "..dtask.name.." e deverá matar "..dtask.count.." monstros desta lista: "..getMonsterFromList(dtask.monsters_list).." até "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6]))..". Boa sorte!" , cid)
	elseif isInArray({"receber","reward","recompensa","report","reportar","entregar","entrega"}, msg) then
		local v, k = task_sys[task], daily_task[daily] 
		if v then -- original task
			if getPlayerStorageValue(cid, v.start) > 0 then
				if getPlayerStorageValue(cid,task_sys_storages[3]) >= v.count then
					if #v.items > 0 and not doRemoveItemsFromList(cid, v.items) then
						npcHandler:say("Desculpe, Mas você também precisa entregar os itens desta lista: "..getItemsFromList(v.items), cid) return true
					end
			 if v.exp > 0 then doPlayerAddExp(cid, v.exp) str = str.."".. (str == "" and "" or ", ") .." "..v.exp.." de exp" end
		         if v.points > 0 then setPlayerStorageValue(cid, task_sys_storages[2], (getTaskPoints(cid)+v.points)) str = str.."".. (str == "" and "" or ", ") .." + "..v.points.."task points" end
		         if v.money > 0 then doPlayerAddMoney(cid, v.money) str = str.."".. (str == "" and "" or ", ") ..""..v.money.." gps" end
		         if table.maxn(v.reward) > 0 then GiveRewardsTask(cid, v.reward) str = str.."".. (str == "" and "" or ", ") ..""..getItemsFromList(v.reward) end
					npcHandler:say("Obrigado pela sua ajuda Recompensas: "..(str == "" and "nenhuma" or ""..str.."").." por ter completado a task do "..v.name, cid)
					setPlayerStorageValue(cid, task_sys_storages[3], 0)
					setPlayerStorageValue(cid, task_sys_storages[1], (task+1))
				else
					npcHandler:say("Desculpe, Mas você ainda não terminou a sua task do "..v.name..". Preciso que mate mais "..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and v.count or -(getPlayerStorageValue(cid,task_sys_storages[3])-v.count)).." Destes monstros terriveis!", cid)
				end
			end
		end
		if k then -- daily task
			if getPlayerStorageValue(cid, task_sys_storages[7]) > 0 then
				if getPlayerStorageValue(cid, task_sys_storages[5]) >= k.count then
				if k.exp > 0 then doPlayerAddExp(cid, v.exp) rst = rst.."".. (rst == "" and "" or ", ") .." "..k.exp.." de exp" end
		         if k.points > 0 then setPlayerStorageValue(cid, task_sys_storages[2], (getTaskPoints(cid)+k.points)) rst = rst.."".. (rst == "" and "" or ", ") .." + "..k.points.."task points" end
		         if k.money > 0 then doPlayerAddMoney(cid, k.money) rst = rst.."".. (rst == "" and "" or ", ") ..""..k.money.." gps" end
		         if table.maxn(k.reward) > 0 then GiveRewardsTask(cid, k.reward) rst = rst.."".. (rst == "" and "" or ", ") ..""..getItemsFromList(k.reward) end
					npcHandler:say("Obrigado pela sua ajuda! Recompensas: "..(rst == "" and "nenhuma" or ""..rst.."").." por ter completado a task do "..k.name, cid)
					setPlayerStorageValue(cid, task_sys_storages[4], 0)
					setPlayerStorageValue(cid, task_sys_storages[5], 0)
					setPlayerStorageValue(cid, task_sys_storages[7], 0)
					else
					npcHandler:say("Desculpe, Mas você ainda não terminou a sua task diaria do "..k.name..". Preciso que mate mais "..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and k.count or -(getPlayerStorageValue(cid,task_sys_storages[5])-k.count)).." Destes monstros!", cid)
				end
			end
		end
	elseif msg == "no" then 
		selfSay("Tudo bem então", cid) 
		talkState[talkUser] = 0 
		npcHandler:releaseFocus(cid) 
	end
	return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

 

---------------------------------------------- // ----------------------------------

 

[+] configuração [+ ]

 

Task System Principal

 


task_sys = {
	[1] = {name = "Trolls", start = 176201, monsters_list = {"Troll","Troll champion"}, level = 8, count = 40, points = 0, items = {}, reward = {}, exp = 2000, money = 2000}
}

 

[1]  --> O número entre os colchetes [] significa a ordem da Task, como a Task é por progresso sempre começará no 1 e irá pro [2], assim sucessivamente.

name --> É o nome da task que o jogador irá fazer.

start --> é a storage que indicará se o jogador começou a Task

monster_list ={} --> É o nome dos monstros em que o jogador deverá caçar para completar a Task

level --> É o level necessário para dar inicio á Task

count --> É o número de monstros que o jogador tem que matar para completar a Task

points --> Aqui determinada quantos Task points o jogador irá receber ao completar a Task

items = {} --> Aqui determinada se além de matar os monstros, o jogador terá que entregar item também! Caso tenha só colocar o {ITEM_ID, QUANTIDADE} EX:


items = {{2173,1}{2160,10},{2493,2}}

rewad --> Aqui determinada se o jogador irá receber itens ao terminar a Task, mesma formula do items /\


reward = {{2520,1},{2173,1}}

exp --> Se o jogador irá receber Exp ao terminar a task. 0 ou quantidade de exp

Money --> Se o jogador irá receber dinheiro ao terminar a task. 0 ou quantidade de dinheiro

 

 

Daily Task System

 


daily_task = {
	[1] = {name = "Orcs" ,monsters_list = {"Orc Berserker","Orc Rider","Orc Leader","Orc Warlord"}, count = 100, points = 0, reward = {}, exp = 5000, money = 10000}
}

 

Segue o padrão da Task original, exceto que não precisa entregar items para o npc!

 

Como funciona A randomização de level de acordo com a Daily task?

 

Procure por está tabela em MODS

 


	local t = {
		[{6,49}] = {1,3},
		[{50,79}] = {4,6},
		[{80,129}] = {7,9},
		[{130,math.huge}] = {10,12}
	}

 

entre as chaves e colchetes é o level do jogador para as Daily Task, Você pode adicionar quantas você quiser!

 

Digamos que:

 

[{6,49}] = {1,3}  --> Quer dizer que entre o level 6 ao 49 o jogador poderá cair na Daily Task número 1(Orcs), 2(Tarantulas) ou 3(Wyvern)!

[{50,79}] = {4,6} --> Quer dizer que entre o level 50 ao 79 o jogador poderá cair na Daily Task número 4(Dragons), 5(Wailing Widows) ou 6(Ancient Scarabs)!

...

[{130,math.huge}] = {10,12} --> Quer dizer que o jogador level 130 ou MAIS poderá cair na Daily Task número 10(Undead Dragons), 11(HydraS) ou 12(Ghastly Dragons)!

 

 

Look Rank System

Procure por está tabela em MODS

 


	local ranks = {
		[{1, 20}] = "Huntsman", 
		[{21, 50}] = "Ranger",
		[{51, 100}] = "Big Game Hunter",
		[{101, 200}] = "Trophy Hunter",		
		[{201, math.huge}] = "Elite Hunter"
	}

 

Entre 1-20 Task points o Rank será Huntsman

Entre 21-50 Task posints o Rank será Ranger

Entre 51-100 Task Points o rank será Big Game Hunter

etc...

Altere como quiser!

Copiei e fiz exatamente o que diz, porém não está funcionando o contato, teste /task counter tb só ativa e desativa, mas em /task nao ta contando não (to na do troll)

Em 08/01/2017 em 22:08, Vodkart disse:

 

 

Em 20/08/2017 em 10:49, JcA disse:

if

 

Em 20/08/2017 em 10:49, JcA disse:

Não esta funcionando o contador de monstros, e o npc não esta reconhecendo as criaturas na hr de entregar, help!

 

tfs 0.4

 

Problema resolvido, obrigado !

 

agora deu hahahahaha uuhuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

Link para o post
Compartilhar em outros sites

@Vodkart Usei/Uso esse script faz um tempão sempre funcionou certinho, nunca ocorreu bug algum, mas hoje fui aumentar as premiações e aconteceu algo estranho, quando eu tento por mais de 1 item de premiação da erro, mas ai é que ta, nas ultimas 5 task, ja ta pra ganhar 2 itens e não buga mas se eu por em outras tasks não funciona o script só nas ultimas.

 

Esse aqui é funcionando normal !

Spoiler

<?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 = "Trolls", start = 176201, monsters_list = {"Troll","Troll champion"}, level = 8, count = 120, points = 2, items = {{2448,1}}, reward = {{2645,1}}, exp = 100000, money = 20000},
    [2] = {name = "rotworms", start = 176202, monsters_list = {"rotworm","carrion worm","Rotworm Queen"}, level = 8, count = 150, points = 2, items = {{2530,1}}, reward = {{2520,1}}, exp = 100000, money = 30000},
    [3] = {name = "cyclops", start = 176203, monsters_list = {"cyclops","cyclops smith","cyclops drone"}, level = 8, count = 130, points = 2, items = {{2490,1}}, reward = {{2466,1}}, exp = 100000, money = 40000},
    [4] = {name = "Dragon", start = 176204, monsters_list = {"dragon"}, level = 8, count = 150, points = 3, items = {{2397,1}}, reward = {{2195,1}}, exp = 150000, money = 50000},
    [5] = {name = "Dragon Lord", start = 176205, monsters_list = {"Dragon Lord"}, level = 300, count = 200, points = 3, items = {{2528,3}}, reward = {{2470,1}}, exp = 150000, money = 60000},
    [6] = {name = "Behemoth", start = 176206, monsters_list = {"Behemoth"}, level = 8, count = 150, points = 3, items = {{5930,3}}, reward = {{8889,1}}, exp = 150000, money = 70000},
    [7] = {name = "Lizard Dragons" ,start = 176220, monsters_list = {"Lizard Chosen","Lizard Dragon Priest","Lizard High Guard","Lizard Legionnaire", "Lizard Zaogun"}, level = 8, count = 350, points = 3, items = {{11297,3}}, reward = {{2493,1}}, exp = 150000, money = 80000},
    [8] = {name = "Defiler", start = 176208, monsters_list = {"Defiler"}, level = 8, count = 300, points = 3, items = {{6500,4}}, reward = {{2494,1}}, exp = 150000, money = 90000},
    [9] = {name = "Hellfire Fighter", start = 176209, monsters_list = {"Hellfire Fighter"}, level = 8, count = 350, points = 4, items = {{2136,4}}, reward = {{2538,1}}, exp = 250000, money = 100000},
    [10] = {name = "Hydra", start = 176210, monsters_list = {"Hydra"}, level = 100, count = 600, points = 4, items = {{4850,5}}, reward = {{6391,1}}, exp = 250000, money = 100000},
    [11] = {name = "Medusa", start = 176211, monsters_list = {"Medusa"}, level = 100, count = 650, points = 5, items = {{2536,5}}, reward = {{2517,1}}, exp = 250000, money = 150000},
    [12] = {name = "Frost Dragon", start = 176212, monsters_list = {"Frost Dragon"}, level = 100, count = 800, points = 5, items = {{1976,7}}, reward = {{1992,1}}, exp = 250000, money = 150000},
    [13] = {name = "Warlock" ,start = 176213, monsters_list = {"Warlock"}, level = 200, count = 800, points = 5, items = {{2656,7}}, reward = {{2343,1}}, exp = 350000, money = 200000},
    [14] = {name = "Grim Reaper" ,start = 176214, monsters_list = {"Grim Reaper"}, level = 250, count = 700, points = 6, items = {{2521,9}}, reward = {{2499,1}}, exp = 350000, money = 200000},
    [15] = {name = "Demon" ,start = 176215, monsters_list = {"Demon"}, level = 300, count = 1000, points = 6, items = {{5954,9}}, reward = {{2644,1}}, exp = 450000, money = 300000},
    [16] = {name = "Medusa Vip" ,start = 176216, monsters_list = {"Medusa Vip"}, level = 350, count = 1200, points = 6, items = {{7887,11}}, reward = {{6132,1}}, exp = 450000, money = 300000},
    [17] = {name = "Hydra Vip" ,start = 176217, monsters_list = {"Hydra Vip"}, level = 350, count = 1200, points = 6, items = {{2498,11}}, reward = {{2527,1}}, exp = 550000, money = 400000},
    [18] = {name = "Grim Reaper Vip" ,start = 176218, monsters_list = {"Grim Reaper Vip"}, level = 350, count = 1200, points = 8, items = {{6300,15}}, reward = {{2518,1}}, exp = 550000, money = 400000},
    [19] = {name = "Warlock Vip" ,start = 176219, monsters_list = {"Warlock Vip"}, level = 350, count = 1200, points = 8, items = {{2466,15}}, reward = {{2519,1}}, exp = 650000, money = 500000},
    [20] = {name = "Frost Dragon Vip" ,start = 176220, monsters_list = {"Frost Dragon Vip"}, level = 350, count = 1200, points = 8, items = {{2492,19}}, reward = {{8932,1}}, exp = 650000, money = 500000},
    [21] = {name = "Demon Vip" ,start = 176221, monsters_list = {"Demon Vip"}, level = 350, count = 2000, points = 10, items = {{2418,19}}, reward = {{8926,1}}, exp = 750000, money = 600000},
    [22] = {name = "Dragon Lord Vip II" ,start = 176222, monsters_list = {"Dragon Lord Vip II"}, level = 450, count = 1500, points = 10, items = {{2414,25}}, reward = {{2444,1}}, exp = 750000, money = 600000},
    [23] = {name = "Frost Dragon Vip II" ,start = 176223, monsters_list = {"Frost Dragon Vip II"}, level = 450, count = 1500, points = 10, items = {{7290,25}}, reward = {{7367,1}}, exp = 850000, money = 700000},
    [24] = {name = "Grim Reaper Vip II" ,start = 176224, monsters_list = {"Grim Reaper Vip II"}, level = 450, count = 1500, points = 10, items = {{5909,30}}, reward = {{7367,1}}, exp = 850000, money = 700000},
    [25] = {name = "Hydra Vip II" ,start = 176225, monsters_list = {"Hydra Vip II"}, level = 450, count = 1500, points = 10, items = {{2476,30}}, reward = {{7414,1}}, exp = 2500000, money = 1000000},
    [26] = {name = "Medusa Vip II" ,start = 176226, monsters_list = {"Medusa Vip II"}, level = 450, count = 1500, points = 10, items = {{2143,75}}, reward = {{2495,1},{2471,1}}, exp = 2500000, money = 1000000},
    [27] = {name = "Lord Of Demon" ,start = 176227, monsters_list = {"Lord Of Demon"}, level = 500, count = 6666, points = 10, items = {{2462,120}}, reward = {{9969,5},{2366,1}}, exp = 10000000, money = 1000000},
    [28] = {name = "Bossing Of Baiak" ,start = 176228, monsters_list = {"Bossing Of Baiak"}, level = 500, count = 30, points = 10, items = {{5903,5}}, reward = {{9969,5},{2366,1}}, exp = 20000000, money = 3000000},
    [29] = {name = "Arabian" ,start = 176229, monsters_list = {"Arabian"}, level = 500, count = 30, points = 10, items = {{10521,10}}, reward = {{2523,1},{2263,1}}, exp = 20000000, money = 3000000},
    [30] = {name = "Shadow Warrior" ,start = 176230, monsters_list = {"Shadow Warrior"}, level = 500, count = 70, points = 10, items = {{5875,25}}, reward = {{2298,1},{11114,1}}, exp = 20000000, money = 3000000},
    [31] = {name = "Castle Guardian" ,start = 176231, monsters_list = {"Castle Guardian"}, level = 600, count = 25, points = 25, items = {{2520,100}}, reward = {{9969,15},{2366,2}}, exp = 20000000, money = 5000000}
}
daily_task = {
    [1] = {name = "Hydra Vip" ,monsters_list = {"Hydra Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
    [2] = {name = "Grim Reaper Vip" ,monsters_list = {"Grim Reaper Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
    [3] = {name = "Grim Reaper Vip II" ,monsters_list = {"Grim Reaper Vip II"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
    [4] = {name = "Frost Dragon Vip" ,monsters_list = {"Frost Dragon Vip"}, count = 750, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
    [5] = {name = "Dragon Lord Vip II" ,monsters_list = {"Dragon Lord Vip II"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
    [6] = {name = "Frost Dragon Vip II" ,monsters_list = {"Frost Dragon Vip II"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
    [7] = {name = "Frost Dragon" ,monsters_list = {"Frost Dragon"}, count = 300, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
    [8] = {name = "Hydra" ,monsters_list = {"Hydra"}, count = 700, points = 3, reward = {{9969,1}}, exp = 3000000, money = 3000000},
    [9] = {name = "Demon Vip" ,monsters_list = {"Demon Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
    [10] = {name = "Hydra Vip II" ,monsters_list = {"Hydra Vip II"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
    [11] = {name = "Medusa Vip" ,monsters_list = {"Medusa Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
    [12] = {name = "Warlock Vip" ,monsters_list = {"Warlock Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000}
}
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 = {
        [{6,100}] = {1,3},
        [{101,200}] = {4,6},
        [{201,300}] = {7,9},
        [{301,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, 40}] = "Leite com Pera", 
        [{41, 80}] = "Iniciante",
        [{81, 120}] = "Intermediario",
        [{121, 200}] = "Fodao",        
        [{201, math.huge}] = "Supremo Lord"
    }
    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[i][2] .. ' ' .. getItemNameById(items[i][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[i][1]) >= items[i][2] then
            count = count + 1 end 
        end 
    end
    if count == table.maxn(items) then
        for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[i][1],items[i][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[i]
            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
function getDeathsAndKills(cid, type) -- by vodka
  local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0
  if (query:getID() ~= -1) then
    repeat
      d = d+1
    until not query:next()
    query:free()
  end
  return d
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 você não está 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 Você não 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, "você não está 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").. " has Killed: ["..getDeathsAndKills(thing.uid, "kill").."] Players.\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." has Died: ["..getDeathsAndKills(thing.uid, "death").."] Times.\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] Parabéns! Você 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] Parabéns! Você terminou a Task do "..daily.name..", volte ao npc parece receber sua recompensa.")
            end
        end 
    end
    return true
end]]></event>
<action actionid="60001;60002;60003;60004" event="script"><![CDATA[
domodlib('task_func')
function onUse(cid, item, frompos, item2, topos)
local t = {[60001] = 20, [60002] = 40, [60003] = 100, [60004] = 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>

 

 

 

E esse aqui é depois de eu aumentar apenas 1 item de reward, e o dinheiro !

 

Spoiler

<?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 = "Trolls", start = 176201, monsters_list = {"Troll","Troll champion"}, level = 8, count = 120, points = 2, items = {{2448,1}}, reward = {{2645,1}},{5903,1}}, exp = 100000, money = 10000},
	[2] = {name = "rotworms", start = 176202, monsters_list = {"rotworm","carrion worm","Rotworm Queen"}, level = 8, count = 150, points = 2, items = {{2530,1}}, reward = {{2520,1}},{8982,1}}, exp = 100000, money = 150000},
	[3] = {name = "cyclops", start = 176203, monsters_list = {"cyclops","cyclops smith","cyclops drone"}, level = 8, count = 130, points = 2, items = {{2490,1}}, reward = {{2466,1}},{8931,1}}, exp = 100000, money = 200000},
	[4] = {name = "Dragon", start = 176204, monsters_list = {"dragon"}, level = 8, count = 150, points = 3, items = {{2397,1}}, reward = {{2195,1}},{8925,1}}, exp = 150000, money = 250000},
	[5] = {name = "Dragon Lord", start = 176205, monsters_list = {"Dragon Lord"}, level = 300, count = 200, points = 3, items = {{2528,3}}, reward = {{2470,1}},{2424,1}}, exp = 150000, money = 300000},
	[6] = {name = "Behemoth", start = 176206, monsters_list = {"Behemoth"}, level = 8, count = 150, points = 3, items = {{5930,3}}, reward = {{8889,1}},{2410,1}}, exp = 150000, money = 350000},
	[7] = {name = "Lizard Dragons" ,start = 176220, monsters_list = {"Lizard Chosen","Lizard Dragon Priest","Lizard High Guard","Lizard Legionnaire", "Lizard Zaogun"}, level = 8, count = 350, points = 3, items = {{11297,3}}, reward = {{2493,1}},{12609,1}}, exp = 150000, money = 400000},
	[8] = {name = "Defiler", start = 176208, monsters_list = {"Defiler"}, level = 8, count = 300, points = 3, items = {{6500,4}}, reward = {{2494,1}},{8932,1}}, exp = 150000, money = 450000},
	[9] = {name = "Hellfire Fighter", start = 176209, monsters_list = {"Hellfire Fighter"}, level = 8, count = 350, points = 4, items = {{2136,4}}, reward = {{2538,1}},{8926,1}}, exp = 250000, money = 500000},
	[10] = {name = "Hydra", start = 176210, monsters_list = {"Hydra"}, level = 100, count = 600, points = 4, items = {{4850,5}}, reward = {{6391,1}},{2444,1}}, exp = 250000, money = 550000},
	[11] = {name = "Medusa", start = 176211, monsters_list = {"Medusa"}, level = 100, count = 650, points = 5, items = {{2536,5}}, reward = {{2517,1}},{2444,1}}, exp = 250000, money = 600000},
	[12] = {name = "Frost Dragon", start = 176212, monsters_list = {"Frost Dragon"}, level = 100, count = 800, points = 5, items = {{1976,7}}, reward = {{1992,1}},{7367,1}}, exp = 250000, money = 700000},
	[13] = {name = "Warlock" ,start = 176213, monsters_list = {"Warlock"}, level = 200, count = 800, points = 5, items = {{2656,7}}, reward = {{2343,1}},{7414,1}}, exp = 350000, money = 800000},
	[14] = {name = "Grim Reaper" ,start = 176214, monsters_list = {"Grim Reaper"}, level = 250, count = 700, points = 6, items = {{2521,9}}, reward = {{2499,1}},{2421,1}}, exp = 350000, money = 900000},
	[15] = {name = "Demon" ,start = 176215, monsters_list = {"Demon"}, level = 300, count = 1000, points = 6, items = {{5954,9}}, reward = {{2644,1}},{2431,1}}, exp = 450000, money = 1000000},
	[16] = {name = "Medusa Vip" ,start = 176216, monsters_list = {"Medusa Vip"}, level = 350, count = 1200, points = 6, items = {{7887,11}}, reward = {{6132,1}},{2400,1}}, exp = 450000, money = 1500000},
	[17] = {name = "Hydra Vip" ,start = 176217, monsters_list = {"Hydra Vip"}, level = 350, count = 1200, points = 6, items = {{2498,11}}, reward = {{2527,1}},{8851,1}}, exp = 550000, money = 2000000},
	[18] = {name = "Grim Reaper Vip" ,start = 176218, monsters_list = {"Grim Reaper Vip"}, level = 350, count = 1200, points = 8, items = {{6300,15}}, reward = {{2518,1}},{8905,1}}, exp = 550000, money = 3000000},
	[19] = {name = "Warlock Vip" ,start = 176219, monsters_list = {"Warlock Vip"}, level = 350, count = 1200, points = 8, items = {{2466,15}}, reward = {{2519,1}},{2495,1}}, exp = 650000, money = 3000000},
	[20] = {name = "Frost Dragon Vip" ,start = 176220, monsters_list = {"Frost Dragon Vip"}, level = 350, count = 1200, points = 8, items = {{2492,19}}, reward = {{8932,1}},{2471,1}}, exp = 650000, money = 4000000},
	[21] = {name = "Demon Vip" ,start = 176221, monsters_list = {"Demon Vip"}, level = 350, count = 2000, points = 10, items = {{2418,19}}, reward = {{8926,1}},{2523,1}}, exp = 750000, money = 4000000},
	[22] = {name = "Dragon Lord Vip II" ,start = 176222, monsters_list = {"Dragon Lord Vip II"}, level = 450, count = 1500, points = 10, items = {{2414,25}}, reward = {{2444,1}},{8892,1}}, exp = 750000, money = 5000000},
	[23] = {name = "Frost Dragon Vip II" ,start = 176223, monsters_list = {"Frost Dragon Vip II"}, level = 450, count = 1500, points = 10, items = {{7290,25}}, reward = {{7367,1}},{7957,1}}, exp = 850000, money = 5000000},
	[24] = {name = "Grim Reaper Vip II" ,start = 176224, monsters_list = {"Grim Reaper Vip II"}, level = 450, count = 1500, points = 10, items = {{5909,30}}, reward = {{7367,1}},{9931,1}}, exp = 850000, money = 6000000},
	[25] = {name = "Hydra Vip II" ,start = 176225, monsters_list = {"Hydra Vip II"}, level = 450, count = 1500, points = 10, items = {{2476,30}}, reward = {{7414,1}}, exp = 2500000,{2506,1}}, money = 6000000},
	[26] = {name = "Medusa Vip II" ,start = 176226, monsters_list = {"Medusa Vip II"}, level = 450, count = 1500, points = 10, items = {{2143,75}}, reward = {{2495,1},{2471,1}},{9971,1}}, exp = 2500000, money = 7000000},
	[27] = {name = "Lord Of Demon" ,start = 176227, monsters_list = {"Lord Of Demon"}, level = 500, count = 6666, points = 10, items = {{2462,120}}, reward = {{9969,5},{2366,1}},{9971,1}}, exp = 10000000, money = 7000000},
	[28] = {name = "Bossing Of Baiak" ,start = 176228, monsters_list = {"Bossing Of Baiak"}, level = 500, count = 30, points = 10, items = {{5903,5}}, reward = {{9969,5},{2366,1}},{9971,1}}, exp = 20000000, money = 8000000},
	[29] = {name = "Arabian" ,start = 176229, monsters_list = {"Arabian"}, level = 500, count = 30, points = 10, items = {{10521,10}}, reward = {{2523,1},{2263,1}},{9971,1}}, exp = 20000000, money = 8000000},
	[30] = {name = "Shadow Warrior" ,start = 176230, monsters_list = {"Shadow Warrior"}, level = 500, count = 70, points = 10, items = {{5875,25}}, reward = {{2298,1},{11114,1}},{9971,1}}, exp = 20000000, money = 10000000},
	[31] = {name = "Castle Guardian" ,start = 176231, monsters_list = {"Castle Guardian"}, level = 600, count = 25, points = 25, items = {{2520,100}}, reward = {{9969,15},{2366,2}},{9971,1}}, exp = 20000000, money = 10000000}
}
daily_task = {
	[1] = {name = "Hydra Vip" ,monsters_list = {"Hydra Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
	[2] = {name = "Grim Reaper Vip" ,monsters_list = {"Grim Reaper Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
	[3] = {name = "Grim Reaper Vip II" ,monsters_list = {"Grim Reaper Vip II"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
	[4] = {name = "Frost Dragon Vip" ,monsters_list = {"Frost Dragon Vip"}, count = 750, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
	[5] = {name = "Dragon Lord Vip II" ,monsters_list = {"Dragon Lord Vip II"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
	[6] = {name = "Frost Dragon Vip II" ,monsters_list = {"Frost Dragon Vip II"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
	[7] = {name = "Frost Dragon" ,monsters_list = {"Frost Dragon"}, count = 300, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
	[8] = {name = "Hydra" ,monsters_list = {"Hydra"}, count = 700, points = 3, reward = {{9969,1}}, exp = 3000000, money = 3000000},
	[9] = {name = "Demon Vip" ,monsters_list = {"Demon Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
	[10] = {name = "Hydra Vip II" ,monsters_list = {"Hydra Vip II"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
	[11] = {name = "Medusa Vip" ,monsters_list = {"Medusa Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000},
	[12] = {name = "Warlock Vip" ,monsters_list = {"Warlock Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000}
}
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 = {
		[{6,100}] = {1,3},
		[{101,200}] = {4,6},
		[{201,300}] = {7,9},
		[{301,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, 40}] = "Leite com Pera", 
		[{41, 80}] = "Iniciante",
		[{81, 120}] = "Intermediario",
		[{121, 200}] = "Fodao",		
		[{201, math.huge}] = "Supremo Lord"
	}
	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[i][2] .. ' ' .. getItemNameById(items[i][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[i][1]) >= items[i][2] then
			count = count + 1 end 
		end 
	end
	if count == table.maxn(items) then
		for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[i][1],items[i][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[i]
			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
function getDeathsAndKills(cid, type) -- by vodka
  local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0
  if (query:getID() ~= -1) then
    repeat
      d = d+1
    until not query:next()
    query:free()
  end
  return d
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 você não está 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 Você não 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, "você não está 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").. " has Killed: ["..getDeathsAndKills(thing.uid, "kill").."] Players.\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." has Died: ["..getDeathsAndKills(thing.uid, "death").."] Times.\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] Parabéns! Você 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] Parabéns! Você terminou a Task do "..daily.name..", volte ao npc parece receber sua recompensa.")
			end
		end 
	end
	return true
end]]></event>
<action actionid="60001;60002;60003;60004" event="script"><![CDATA[
domodlib('task_func')
function onUse(cid, item, frompos, item2, topos)
local t = {[60001] = 20, [60002] = 40, [60003] = 100, [60004] = 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>

 

 

 

E esse é o erro que acontece na distro quando tento utilizar o script !

 

59cfc7b089782_errodistro.thumb.png.6414271e9b71e966b0d02201309474ea.png

       112674.gif

 

 

 

Link para o post
Compartilhar em outros sites

Gostei muito do Sistema Vodkart Parabens. Porem esta dando erro no meu servidor, Depois que eu pego a Task no NPC e dou /task o servidor cai sem deixar logs de erro.

Link para o post
Compartilhar em outros sites
  • 2 weeks later...

@Thayguroficial Deixa eu tentar ajudar.

 

Em talkactions/scripts, crie um arquivo.lua:

 

 

Spoiler

domodlib('task_func')
function onSay(cid, words, param)
doPlayerPopupFYI(cid, "You have " .. getTaskPoints(cid).. " task points.")
return true
end

 

 

Em talkactions.xml: <talkaction words="/taskpoints" event="script" value="NOMEDOSEUARQUIVO.lua"/>

 

O item de adicionar task points:

 

Crie um arquivo em actions/scripts:

 

Spoiler

domodlib('task_func')
local points = 10
function onUse(cid, item, fromPosition, itemEx, toPosition)
setPlayerStorageValue(cid, task_sys_storages[2], (getTaskPoints(cid)+points))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have received " .. points .. " task points!")
doSendMagicEffect(fromPosition, CONST_ME_STUN)
return true
end

 

 

No actions.xml: <action itemid="ID_DO_ITEM" script="NOMEDOARQUIVO.lua" />

Contato:

 

Link para o post
Compartilhar em outros sites

@Dwarfer Cara muito obrigado, funcionou certinho os 2!

Eu cheguei a adaptar uma talkaction de ppoints para taskpoints so que eu não sabia que precisava por esse 

domodlib('task_func')

Eu deixei:

function onSay(cid, words, param, channel)

bom, agora aprendi, que pra criar uma talkaction, action ou globalevents para um mod,  precisa do domodlib no começo, é nois :grin:

Link para o post
Compartilhar em outros sites
  • 4 months later...
  • 2 weeks later...

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por luanluciano93
      Olá pessoal, estou desenvolvendo esse sistema vip para TFS 1.x, se precisarem de alguma função nova é só comentar, criei para usar em um servidor meu e resolvi postar, bom proveito a todos.
       
      É só ir no arquivo data/lib/core/player.lua e adicionar esse código no começo do script:
      -- ALTER TABLE `accounts` ADD `vip_time` BIGINT(20) NOT NULL DEFAULT 0; -- player:getVipTime() function Player.getVipTime(self) local resultId = db.storeQuery("SELECT `vip_time` FROM `accounts` WHERE `id` = '".. self:getAccountId() .."';") local time = resultId ~= false and result.getNumber(resultId, "vip_time") or 0 result.free(resultId) return time end -- player:isVip() function Player.isVip(self) return self:getVipTime() > os.time() and true or false end -- player:addVipDays(days) function Player.addVipDays(self, days) return(self:isVip() and tonumber((days * 86400))) and db.query("UPDATE `accounts` SET `vip_time` = '".. (self:getVipTime() + (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") or db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() + (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:removeVipDays(days) function Player.removeVipDays(self, days) return(self:isVip() and tonumber((days * 86400))) and db.query("UPDATE `accounts` SET `vip_time` = '".. (self:getVipTime() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") or db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:setVipDays(days) function Player.setVipDays(self, days) return db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:removeVip() function Player.removeVip(self) db.query("UPDATE `accounts` SET `vip_time` = '0' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:sendVipDaysMessage() function Player.sendVipDaysMessage(self) if self:isVip() then local vipTime = self:getVipTime() - os.time() local vipDays = 1 + (math.floor(vipTime / 86400)) return self:getVipTime() ~= false and self:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'You have '.. vipDays .. ' vip day(s) in your account.') end end -- player:checkVipLogin() function Player.checkVipLogin(self) if self:getVipTime() > 0 and not self:isVip() then return self:removeVip() and self:teleportTo(self:getTown():getTemplePosition()) end end  
       
      As funções são:
      • player:getVipTime() - Retorna o valor da tabela vip_time (igual esta na database).
      • player:isVip() - Retorna se o player é vip ou não.
      • player:addVipDays(days) - Usa-se em algum script para para adicionar dias de vip ao player (parâmetro de entrada "days").
      • player:removeVipDays(days) - Usa-se em algum script para para remover dias de vip do player (parâmetro de entrada "days").
      • player:setVipDays(days) - Usa-se em algum script para para mudar os dias de vip do player (parâmetro de entrada "days").
      • player:removeVip() - Usa-se em algum script para para remover todo tempo de vip do player.
      • player:sendVipDaysMessage() - Retorna uma mensagem no player mostrando os dias de vip que ainda restam ao player.
      • player:checkVipLogin() - Checa se a vip do player acabou, se sim teleporta ele para o templo.
       

      Qualquer dúvida ou erro/bug poste aqui.
    • Por Killua
      Como funciona?
      A cada monstro que vc mata, seus itens equipados ganham 1 de exp. Quando seus itens chegarem às quantidades de exp definidas, eles upam e ficam com o nome assim: Demon Helmet + 1. Helmets, armors, legs, e boots recebem 1 de arm a cada vez que upam. Armas recebem 1 de ataque e escudos 1 de defesa.
       
      Para o monstro contar, ele deve dar um mínimo de exp (definido no script). O número de exp a que me refiro é aquele um presente no arquivo .xml.
       
      Para instalar, crie Killua Items Upgrade.lua em data/creaturescripts/scripts e coloque:
        Em data/creaturescripts/creaturescripts.xml coloque essas duas tags:
      <event type="kill" name="Item level" event="script" value="Killua Items Upgrade.lua"/> <event type="login" name="Item levell" event="script" value="Killua Items Upgrade.lua"/> Configurando: Na tabela table_of_slots, coloque em quais slots os itens upam.
      min_exp é a experiência mínima que o monstro deve ter para contar exp para o item. Se vc colocar 500, somente os monstros que tem exp igual ou superior a 500 no arquivo.xml vão valer.
      exp_levels são os valores de exp que os itens devem atingir para upar. No meu caso, quando o item alcançar 50 de exp, ele upa para o level 1. Quando alcançar 50 de exp, upa para o level 2 e assim por diante.
    • Por Sekk
      Bom, procurei esse Castle por MUITO TEMPO, mas não achei em NENHUM LUGAR DA INTERNET. Ontem, eu estava vendo alguns mapas do @Deathrocks, e vi nos prints, que o mapa possuia o evento que eu queria!
       
      Então baixei o mapa e extrai o evento, então venho lhes trazer!
       
       
      Nome: Castle 24H
      Cliente: 8.6
      Versão TFS: 0.4
      Tipo: Evento
       
      Bom, para começar, vamos em actions/scripts e crie 2 arquivos:
       
      castledoor1.lua
       
      castlewar1.lua
       
        Agora em actions.xml adicione as tags:
       
      Agora em monster/traps crie 3 arquivos:
       
      porta.xml
       
      protectcastle.xml  
      statue.xml  
      Agora em monsters.xml adicione as tags:    
      Vamos para movements/scripts e crie 2 arquivos:
       
      castlewar2.lua
       
      level.lua  
      Agora em movements.xml adicione as tags:  
       
      Pronto. Agora você só precisa baixar o mapa, inserir o mesmo ao seu servidor, configurar os teleports, e as hunts dentro do castle etc.
       
      PRINTS:
      1ª parte
       
      2ª parte:
       
      Obs.: Todos os ActionID e monsters já estão no mapa! Você só precisa configurar as coordenadas dos teleports, e o que possui no castle!
       
      Obs².: Tudo o que você pode configurar, já está escrito em cada script!
       
       
      Créditos:
      @DeathRocks
      PC98
      mapa.rar
    • Por gpedro
      Testado: MySQL & SQLite
      Distro: TFS 0.4_SVN & TFS 0.3.6

      MySQL

      ALTER TABLE `players` ADD `resets` INT(11) NOT NULL DEFAULT "0"; SQLite ALTER TABLE players ADD resets INTEGER not null default 0 Adicionando nas sources player.h procure por: uint32_t level; logo abaixo, adicione: uint32_t resets; iologindata.cpp procure por query << "SELECT `id`, `account_id`, `group_id`, `world_id`, `sex`, `vocation`, `experience`, `level`," substitua por: query << "SELECT `id`, `account_id`, `group_id`, `world_id`, `sex`, `vocation`, `experience`, `level`, `resets`, " procure por player->level = std::max((uint32_t)1, (uint32_t)result->getDataInt("level")); logo abaixo adicione: player->resets = (uint32_t)result->getDataInt("resets"); procure por query << "`maglevel` = " << player->magLevel << ", "; logo abaixo adicione: query << "`resets` = " << player->resets << ", "; players.cpp procure por: s << " (Level " << level << ")"; substitua por: s << " (Level " << level << ") [Reset " << resets << "]"; players.h procure por: void setPromotionLevel(uint32_t pLevel); logo abaixo adicione: uint32_t getResets() { return resets;} void setResets(int32_t amount) { resets += amount; if (resets < 0) {resets = 0;} } luascript.cpp para 0.3.6 static int32_t luaDoPlayerSetIdleTime(lua_State* L); logo abaixo adicione: static int32_t luaGetResets(lua_State* L); static int32_t luaSetResets(lua_State* L); talkactions.xml <talkaction words="!rank;/rank" event="script" value="ranks.lua"/> <talkaction words="!reset;/reset" script="reset.lua"/> ranks.lua
      Créditos: Dark Skyllen, Marcryzius, Mock, Kydrai, Cykotitan, gpedro*.
      * adaptação para 0.4
    • Por VitorSubhi
      Apresentação: Olá galera do Tibia King, este é meu primeiro tutorial que desenvolvo após anos apenas sugando da comunidade, chegou a hora de compartilhar um pouco de conhecimento, rsrs...
      Após ver que muitos usuários tinham interesse em um sistema de Trade de Points in-game resolvi trazer um sistema totalmente completo para vocês.
       
      Funcionamento:
      Player 1 após adquirir os Points, pode iniciar uma negociação com o Player 2 através do comando /tradepoints Player 2, Quantidade. Será aberto uma Janela de Trade com o item referente aos Points. Após ambos aceitarem a negociação será realizado a troca de Points pelo item requisitado.
      Observações:
      Necessário ter acesso às Sources de sua Distro. Testado em servidor 8.6 (The Forgotten Server 0.4). Antes que venham falar que possui sistemas parecidos, veja o diferencial (Item não aparece em nenhum inventário, e não é necessário usar/comprar qualquer item).  
      Algumas Imagens:
       
      Instalação:
      Sources > Luascript.cpp Sources > Luascript.cpp Sources > Luascript.h  
       
      Server > Data > Lib > 050-function Server > Data > Creaturescripts > Scripts >Trade_Orbs.lua Server > Data > Creaturescripts > Creaturescripts.xml Server > Data > Creaturescripts > Scripts > Login.lua Server > Data > Talkactions > Scripts > Points_Trade.lua Server > Data > Talkactions > Talkactions.xml Créditos:
      Todo o sistema foi feito completamente por mim: Vítor Subhi.
      The Forgotten Server (Pelas Sources)
      Vodkart, White Wolf, Natanael Beckman, e a todos os demais membros do TK que não lembro o nome, que contribuíram indiretamente através de seus tutoriais.
       
       
       
       
       

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo