Ir para conteúdo
  • Cadastre-se

Scripting Simple Task 0.4 não funciona


Posts Recomendados

Olá, recentemente adicionei o mod do Simple Task no meu server mas estou com um problema que sempre que falo com o npc e falo task ele não responde mais e aparece na minha distro o seguinte:

 

[2:18:09.636] [Error - NpcScript Interface]
[2:18:09.638] data/npc/scripts/task.lua:onCreatureSay
[2:18:09.639] Description:
[2:18:09.639] data/npc/scripts/task.lua:19: attempt to compare nil with number
[2:18:09.640] stack traceback:
[2:18:09.640]   data/npc/scripts/task.lua:19: in function 'callback'
[2:18:09.641]   data/npc/lib/npcsystem/npchandler.lua:390: in function 'onCreatureSay'
[2:18:09.642]   data/npc/scripts/task.lua:8: in function <data/npc/scripts/task.lua:8>

 

Meu TFS é 0.4 e meu tibia é 8.60

Todos os tópicos relacionados a esse problema falam que é por causa de versão mas no caso a minha versão e a mesma que pede para usar esse mod.

 

Script:

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, k.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())

 

Editado por Nother (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Moderador

envie o script quando for assim, pra ser lido direto e ter sua resposta mais rapido!

@Nother

                                                                                                                  Have no idea!

                                                                                                  freelance? go to my discord:  sun#8860

 

Link para o post
Compartilhar em outros sites
  • Moderador
4 minutos atrás, Nother disse:

Adicionado!

queria saber, esta task_sys está na sua lib?

                                                                                                                  Have no idea!

                                                                                                  freelance? go to my discord:  sun#8860

 

Link para o post
Compartilhar em outros sites
4 minutos atrás, Sun disse:

queria saber, esta task_sys está na sua lib?

Não está não, segui o tutorial e so fiz alteraçõs nos bixos das tasks, no tutorial não tava falando nada a respeito

Link para o post
Compartilhar em outros sites
  • Moderador
Agora, Nother disse:

Não está não, segui o tutorial e so fiz alteraçõs nos bixos das tasks, no tutorial não tava falando nada a respeito

falta a tabela, se não tiver a tabela no script não irá funcionar mesmo!

me envia este tutorial

 

                                                                                                                  Have no idea!

                                                                                                  freelance? go to my discord:  sun#8860

 

Link para o post
Compartilhar em outros sites
1 minuto atrás, Sun disse:

falta a tabela, se não tiver a tabela no script não irá funcionar mesmo!

me envia este tutorial

 

 

Link para o post
Compartilhar em outros sites
  • Moderador
1 minuto atrás, Nother disse:

 

qual versão do seu tfs?

                                                                                                                  Have no idea!

                                                                                                  freelance? go to my discord:  sun#8860

 

Link para o post
Compartilhar em outros sites
  • Moderador
Spoiler

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) >= 12 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, k.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())

 

testa isto pra gente ver oque irá acontecer.

@Nother

                                                                                                                  Have no idea!

                                                                                                  freelance? go to my discord:  sun#8860

 

Link para o post
Compartilhar em outros sites
2 minutos atrás, Sun disse:
  Ocultar conteúdo


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) >= 12 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, k.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())

 

testa isto pra gente ver oque irá acontecer.

@Nother

Nada, deu o mesmo erro na distro

Link para o post
Compartilhar em outros sites
  • Moderador
Spoiler

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
	local level = getPlayerLevel(cid)
	if isInArray({"task","tasks","missao","mission"}, msg) then
		if task_sys[task] then
			if getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
				if level >= 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, k.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())

 

@Nother

                                                                                                                  Have no idea!

                                                                                                  freelance? go to my discord:  sun#8860

 

Link para o post
Compartilhar em outros sites
2 minutos atrás, Sun disse:
  Mostrar conteúdo oculto


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
	local level = getPlayerLevel(cid)
	if isInArray({"task","tasks","missao","mission"}, msg) then
		if task_sys[task] then
			if getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
				if level >= 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, k.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())

 

@Nother

Tbm não deu, mesma coisa

Link para o post
Compartilhar em outros sites
  • Moderador
Spoiler

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
	local level = getPlayerLevel(cid)
	if isInArray({"task","tasks","missao","mission"}, msg) then
		if task_sys[task] then
			if getPlayerStorageValue(cid, task_sys[task].start) == -1 then
				if level >= task_sys[task].level then
					setPlayerStorageValue(cid, task_sys[task].start, 1)
					selfSay("[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
					selfSay("Desculpe, Mas você precisa alcançar level "..task_sys[task].level.." para poder participar da Task dos "..task_sys[task].name.."!", cid)
				end
			else
				selfSay("Desculpe, Mas você atualmente está na task "..task_sys[task].name..". Você pode {entregar} caso já tenha terminado.", cid)
			end
		else
			selfSay("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
			selfSay("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
			selfSay("Desculpe, você tem task para {entregar} !", cid) return true
		end
		local r = doRandomDailyTask(cid)
		if r == 0 then
			selfSay("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]
		selfSay("[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
						selfSay("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
					selfSay("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
					selfSay("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, k.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
					selfSay("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
					selfSay("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())

 

@Nother

Spoiler


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
	local level = getPlayerLevel(cid)
	if isInArray({"task","tasks","missao","mission"}, msg) then
		if task_sys[task] then
			if getPlayerStorageValue(cid, task_sys[task].start) == -1 then
				if level >= task_sys[task].level then
					setPlayerStorageValue(cid, task_sys[task].start, 1)
					selfsay("[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
					selfSay("Desculpe, Mas você precisa alcançar level "..task_sys[task].level.." para poder participar da Task dos "..task_sys[task].name.."!", cid)
				end
			else
				selfSay("Desculpe, Mas você atualmente está na task "..task_sys[task].name..". Você pode {entregar} caso já tenha terminado.", cid)
			end
		else
			selfSay("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
			selfSay("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
			selfSay("Desculpe, você tem task para {entregar} !", cid) return true
		end
		local r = doRandomDailyTask(cid)
		if r == 0 then
			selfSay("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]
		selfSay("[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
						selfSay("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
					selfSay("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
					selfSay("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, k.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
					selfSay("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
					selfSay("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())

 

@Nother acabei errando, testa este!

Editado por Sun (veja o histórico de edições)

                                                                                                                  Have no idea!

                                                                                                  freelance? go to my discord:  sun#8860

 

Link para o post
Compartilhar em outros sites
2 minutos atrás, Sun disse:
  Ocultar conteúdo


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
	local level = getPlayerLevel(cid)
	if isInArray({"task","tasks","missao","mission"}, msg) then
		if task_sys[task] then
			if (getPlayerStorageValue(cid, task_sys[task].start) - os.time()) <= 0 then
				if level >= task_sys[task].level then
					setPlayerStorageValue(cid, task_sys[task].start, 1)
					selfSay("[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
					selfSay("Desculpe, Mas você precisa alcançar level "..task_sys[task].level.." para poder participar da Task dos "..task_sys[task].name.."!", cid)
				end
			else
				selfSay("Desculpe, Mas você atualmente está na task "..task_sys[task].name..". Você pode {entregar} caso já tenha terminado.", cid)
			end
		else
			selfSay("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
			selfSay("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
			selfSay("Desculpe, você tem task para {entregar} !", cid) return true
		end
		local r = doRandomDailyTask(cid)
		if r == 0 then
			selfSay("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]
		selfSay("[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
						selfSay("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
					selfSay("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
					selfSay("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, k.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
					selfSay("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
					selfSay("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())

 

@Nother

Tbm não deu, na primeira vez a função "entregar task" o script até que leu mas da segunda e terceira ele não lê mais. E a "task" e "daily" continuam dando o erro na distro

Link para o post
Compartilhar em outros sites
1 minuto atrás, Vodkart disse:

@Nother posta o mods que vc editou para eu dar uma olhadinha...

<?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 = "Wolf" ,monsters_list = {"Wolf","Wolf Beast"}, count = 100, points = 1, reward = {}, exp = 50000, money = 50000},
	[2] = {name = "Bandit" ,monsters_list = {"Bandit","Bandit Human","Bandit Gun","Bandit Scout","Bandit Swordman"}, count = 150, points = 2, reward = {}, exp = 100000, money = 100000},
    [3] = {name = "Mummy" ,monsters_list = {"Mummy","Dragon Skeleton","Desertor"}, count = 200, points = 5, reward = {}, exp = 200000, money = 150000},
	[4] = {name = "Poison Fly" ,monsters_list = {"Poison Fly","Wolfman","Saibamen","Water Saibamen"}, count = 250, points = 10, reward = {}, exp = 400000, money = 200000},
	[5] = {name = "Namekjin" ,monsters_list = {"Namekjin","Namekjin Warrior","Namekjin Scout","Namekjin Mindcontroller"}, count = 300, points = 20, reward = {}, exp = 1000000, money = 300000}
}
daily_task = {
	[1] = {name = "Wolf" ,monsters_list = {"Wolf","Wolf Beast"}, count = 100, points = 1, reward = {}, exp = 5000, money = 10000},
	[2] = {name = "Bandit" ,monsters_list = {"Bandit","Bandit Human","Bandit Gun","Bandit Scout","Bandit Swordman"}, count = 150, points = 2, reward = {}, exp = 100000, money = 100000},
    [3] = {name = "Mummy" ,monsters_list = {"Mummy","Dragon Skeleton","Desertor"}, count = 200, points = 5, reward = {}, exp = 200000, money = 150000},
	[4] = {name = "Poison Fly" ,monsters_list = {"Poison Fly","Wolfman","Saibamen","Water Saibamen"}, count = 250, points = 10, reward = {}, exp = 400000, money = 200000},
	[5] = {name = "Namekjin" ,monsters_list = {"Namekjin","Namekjin Warrior","Namekjin Scout","Namekjin Mindcontroller"}, count = 300, points = 20, reward = {}, exp = 1000000, money = 300000}
}
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 = {
	[{1,49}] = {1,2},
		[{50,99}] = {3},
		[{100,149}] = {4},
		[{150,math.huge}] = {5}
	}
	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}] = "Ranger", 
		[{21, 50}] = "Hunter",
		[{51, 100}] = "Monster Hunter",
		[{101, 200}] = "Elite Hunter",		
		[{201, 400}] = "Master Hunter",	
		[{401, 600}] = "King Hunter",
		[{601, math.huge}] = "God 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
]]></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) 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="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] .. " Hunt Points.") 
end
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, topos, true)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Welcome, Hunt Points!")
return true
end]]></action>
</mod>

 

Link para o post
Compartilhar em outros sites

entendi, você apagou o parâmetro level do mods... vc quer remover o level é isso?

 

 

@Nother removei o level então... usa desse jeito:

 

 

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
					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ê 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, k.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())

 

Editado por Vodkart (veja o histórico de edições)

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
6 minutos atrás, Vodkart disse:

entendi, você apagou o parâmetro level do mods... vc quer remover o level é isso?

 

 

@Nother removei o level então... usa desse jeito:

 

 


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
					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ê 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, k.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())

 

Tbm não resolveu, nesse caso ai eu não alterei mais nada alem dos bixos, eu não to usando o mesmo script da postagem, o script estava dando varios erros na distro e o npc não aparecia, dai eu peguei o script que vc editou para um rapaz que estava com o mesmo problema que o meu.

Com esse script funcionou o npc até aparece e tinha acessado o scipt mas com as alterações para cima não faz nem isso mais. Ele so da o erro agora direto quando falo task ou daily

Link para o post
Compartilhar em outros sites
3 minutos atrás, Nother disse:

Tbm não resolveu, nesse caso ai eu não alterei mais nada alem dos bixos, eu não to usando o mesmo script da postagem, o script estava dando varios erros na distro e o npc não aparecia, dai eu peguei o script que vc editou para um rapaz que estava com o mesmo problema que o meu.

Com esse script funcionou o npc até aparece e tinha acessado o scipt mas com as alterações para cima não faz nem isso mais. Ele so da o erro agora direto quando falo task ou daily

 

o script original dando vários erros na distro? não lembro dessa alteração, porém consigo resolver. testei aqui com o mods e o npc e funcionou, qual erro aparece agora? e vc tem o link da alteração que eu fiz?

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites

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 cloudrun2023
      CloudRun - Sua Melhor Escolha para Hospedagem de OTServer!
      Você está procurando a solução definitiva para hospedar seu OTServer com desempenho imbatível e segurança inigualável? Não procure mais! Apresentamos a CloudRun, sua parceira confiável em serviços de hospedagem na nuvem.
       
      Recursos Exclusivos - Proteção DDoS Avançada:
      Mantenha seu OTServer online e seguro com nossa robusta proteção DDoS, garantindo uma experiência de jogo ininterrupta para seus jogadores.
       
      Servidores Ryzen 7 Poderosos: Desfrute do poder de processamento superior dos servidores Ryzen 7 para garantir um desempenho excepcional do seu OTServer. Velocidade e estabilidade garantidas!
       
      Armazenamento NVMe de Alta Velocidade:
      Reduza o tempo de carregamento do jogo com nosso armazenamento NVMe ultrarrápido. Seus jogadores vão adorar a rapidez com que podem explorar o mundo do seu OTServer.
       
      Uplink de até 1GB:
      Oferecemos uma conexão de alta velocidade com até 1GB de largura de banda, garantindo uma experiência de jogo suave e livre de lag para todos os seus jogadores, mesmo nos momentos de pico.
       
      Suporte 24 Horas:
      Estamos sempre aqui para você! Nossa equipe de suporte está disponível 24 horas por dia, 7 dias por semana, para resolver qualquer problema ou responder a qualquer pergunta que você possa ter. Sua satisfação é a nossa prioridade.
       
      Fácil e Rápido de Começar:
      Configurar seu OTServer na CloudRun é simples e rápido. Concentre-se no desenvolvimento do seu jogo enquanto cuidamos da hospedagem.
       
      Entre em Contato Agora!
      Website: https://central.cloudrun.com.br/index.php?rp=/store/cloud-ryzen-brasil
      Email: [email protected]
      Telefone: (47) 99902-5147

      Não comprometa a qualidade da hospedagem do seu OTServer. Escolha a CloudRun e ofereça aos seus jogadores a melhor experiência de jogo possível. Visite nosso site hoje mesmo para conhecer nossos planos e começar!
       
      https://central.cloudrun.com.br/index.php?rp=/store/cloud-ryzen-brasil
       
      CloudRun - Onde a Velocidade Encontra a Confiabilidade!
       

    • Por FeeTads
      SALVE rapaziada do TK, esses dias vim pensando em novos scripts pro meu OT, e em um deles eu precisava que determinada area não contasse frag pro player que matasse outros, PORÉM eu precisava que os players que morressem nessa area ainda assim tivessem as penalidades da sua morte, procurei por ai, achei alguns scripts que apenas tiravam o SKULL e não realmente o FRAG do player.

      **script atualizado 22/10/2023** - melhorado e otimizado, levei o script pra puxar as infos por .lua / creatureScripts

      vou disponibilizar o code aqui, e o que fazer pra determinada area não contar frag.

      SOURCE OTX 2 / TFS 0.x, Funciona em TFS 1.x mudando as tags e ajeitando as sintaxes.

      vá em creatureevent.cpp

      procure por:
      else if(type == "preparedeath") _type = CREATURE_EVENT_PREPAREDEATH;
      Adiciona abaixo:
      else if(type == "nocountfrag") _type = CREATURE_EVENT_NOCOUNTFRAG;

      procure por:
      case CREATURE_EVENT_PREPAREDEATH: return "onPrepareDeath";  
      Adicione abaixo: 
      case CREATURE_EVENT_NOCOUNTFRAG: return "noCountFragArea";

      procure por:
      case CREATURE_EVENT_PREPAREDEATH: return "cid, deathList";
      Adicione abaixo:
      case CREATURE_EVENT_NOCOUNTFRAG: return "cid, target";

      agora no mesmo arquivo, vá até o final do arquivo e adicione essa função:
      uint32_t CreatureEvent::executeNoCountFragArea(Creature* creature, Creature* target) { //noCountFragArea(cid, target) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(creature->getPosition()); std::ostringstream scriptstream; scriptstream << "local cid = " << env->addThing(creature) << std::endl; scriptstream << "local target = " << env->addThing(target) << std::endl; if(m_scriptData) scriptstream << *m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ std::ostringstream desc; desc << creature->getName(); env->setEvent(desc.str()); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(creature->getPosition()); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(creature)); lua_pushnumber(L, env->addThing(target)); bool result = m_interface->callFunction(2); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::noCountFragArea] Call stack overflow." << std::endl; return 0; } }

      agora vá em creatureevent.h

      procure por:
      CREATURE_EVENT_PREPAREDEATH
      adicione abaixo:
      CREATURE_EVENT_NOCOUNTFRAG

      procure por:
      uint32_t executePrepareDeath(Creature* creature, DeathList deathList);
      Adicione abaixo:
      uint32_t executeNoCountFragArea(Creature* creature, Creature* target);

      agora vá em player.cpp

      procure por:
      bool Player::onKilledCreature(Creature* target, DeathEntry& entry)
      abaixo de:
      War_t enemy; if(targetPlayer->getEnemy(this, enemy)) { if(entry.isLast()) IOGuild::getInstance()->updateWar(enemy); entry.setWar(enemy); }
      Adicione o seguinte código:
      if (targetPlayer){ CreatureEventList killEvents = getCreatureEvents(CREATURE_EVENT_NOCOUNTFRAG); for (const auto &event : killEvents) { if (!event->executeNoCountFragArea(this, target)) { return true; } } }

      //

      Feito isso, tudo completo na sua source, agora é necessário adicionar o creaturescript dentro do servidor

      vá até creaturescripts/scripts
      crie um arquivo chamado, "noCountFragInArea.lua"
      e dentro dele cole o código:
       
      --[[ script feito por feetads / TibiaKing ]]-- --[[ discord: feetads / FeeTads#0246 ]]-- -- Add positions here for which you do not want to count frags local areas = { [1] = {from = {x = 91, y = 122, z = 7}, to = {x = 98, y = 127, z = 7}}, -- from = area superior esquerda / to = area inferior direita (formando um quadrado) } local onlyKillerInArea = false -- only killer need to be in area? function noCountFragArea(cid, target) if not isCreature(cid) or not isCreature(target) then return true end local posKiller = getPlayerPosition(cid) local posTarget = getPlayerPosition(target) for i = 1, #areas do local area = areas[i] if isInArea(posKiller, area.from, area.to) then if onlyKillerInArea then return false elseif isInArea(posTarget, area.from, area.to) then return false end end end return true end
      agora em creaturescripts.xml
      <event type="nocountfrag" name="fragarea" event="script" value="noCountFragInArea.lua"/>
      agora em creaturescripts/scripts/login.lua
       procure por OU semelhante a esse:
      registerCreatureEvent(cid, "AdvanceSave")
      e abaixo adicione:
      registerCreatureEvent(cid, "fragarea")

      //


      Agora tudo certo, quando quiser adiciona uma area que não pega frag, vá até o script e apenas coloque a area, igual o demonstrado no script

      Exemplo:
      local areas = { [1] = {from = {x = 91, y = 122, z = 7}, to = {x = 98, y = 127, z = 7}}, [2] = {from = {x = 1000, y = 1000, z = 7}, to = {x = 1100, y = 1100, z = 7}}, }
      assim somente colocando a area no script e abrindo o server ou dando /reload, já funcionará a area como não pegar frag.
      Esse sistema pode ser bom pra areas de pvp ativo, onde você ainda quer que o player que morrer perca os atributos, como se fosse uma morte normal, porém não conta frag pra quem matar.
      Bom pra sistemas tipo castle 48h (guild war), onde há diversas mortes e risco de pegar red, atrapalhando a war.

      Façam bom proveito dos scripts, e deixem os créditos no script rsrs

      **Eu fiz as alterações e o simples código por isso vim disponibilizar, créditos meus**
    • Por Muvuka
      Abri canal a força creaturescript acho que funcione no creaturescript cria script creaturescript
       
      <channel id="9" name="HELP" logged="yes"/>
      <channel id="12" name="Report Bugs" logged="yes"/>
      <channel id="13" name="Loot" logged="yes"/>
      <channel id="14" name="Report Character Rules Tibia Rules" logged="yes"/>
      <channel id="15" name="Death Channel"/>
      <channel id="6548" name="DexSoft" level="1"/>
      <channel id="7" name="Reports" logged="yes"/>
       
      antes de 
              if(lastLogin > 0) then adicione isso:
                      doPlayerOpenChannel(cid, CHANNEL_HELP) doPlayerOpenChannel(cid, 1,  2, 3) = 1,2 ,3 Channels, entendeu? NÃO FUNCIONA EU QUERO UM MEIO DE ABRI SEM USA A SOURCE
       
      EU NÃO CONSEGUI ABRI EU NÃO TENHO SOURCE
       
       
    • Por bolachapancao
      Rapaziada seguinte preciso de um script que ao utilizar uma alavanca para até 4 jogadores.
      Os jogadores serão teleportados para hunt durante uma hora e depois de uma hora os jogadores serão teleportados de volta para o templo.
       
      Observação: caso o jogador morra ou saia da hunt o evento hunt é cancelado.

      Estou a base canary
      GitHub - opentibiabr/canary: Canary Server 13.x for OpenTibia community.
       
    • Por RAJADAO
      .Qual servidor ou website você utiliza como base? 
      Sabrehaven 8.0
      Qual o motivo deste tópico? 
      Ajuda com novos efeitos
       
      Olá amigos, gostaria de ajuda para introduzir os seguintes efeitos no meu servidor (usando o Sabrehaven 8.0 como base), adicionei algumas runas novas (avalanche, icicle, míssil sagrado, stoneshower & Thunderstorm) e alguns novos feitiços (exevo mas san, exori san, exori tera, exori frigo, exevo gran mas frigo, exevo gran mas tera, exevo tera hur, exevo frigo hur) mas nenhum dos efeitos dessas magias parece existir no servidor, alguém tem um link para um tutorial ou algo assim para que eu possa fazer isso funcionar?
      Desculpe pelo mau inglês, sou brasileiro.

      Obrigado!


      AVALANCHE RUNE id:3161 \/
      (COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_ICEAREA)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)

      STONESHOWER RUNE id:3175 \/
      (COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_STONES)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)

      THUNDERSTORM RUNE id:3202 \/
      (COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_E NERGYHIT)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL)

      ICICLE RUNE id:3158 \/
      COMBAT_ICEDAMAGE
      CONST_ME_ICEAREA
      CONST_ANI_ICE

      SANTO MÍSSIL RUNA id:3182 \/
      (COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)

      CONST_ME_PLANTATTACK (exevo gran mas tera)
      CONST_ME_ICETORNADO (exevo gran mas frigo)
      CONST_ME_SMALLPLANTS (exevo tera hur)
      CONST_ME_ICEAREA (exevo frigo hur)
      CONST_ME_ICEATTACK (exori frigo)
      CONST_ME_CARNIPHILA (exori tera)

      EXORI SAN \/
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)
      CONST_ME_HOLYDAM IDADE

      EXEVO MAS SAN \/
      CONST_ME_HOLYAREA
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo