Postado Julho 13, 2015 10 anos Boa noite glr do TK, Gostaria de saber se alguém consegue bolar essa TASK, então... Seria assim, configuraria uma sequencia de bixos para matar, através de um npc claro. TFS 0.4 Ex: {1} - 200 rotworm {2} - 210 dwarf {3} - 220 tarantula Ai iria até a task numero 35, configuravel... E no final dessa task o npc entregaria um item para cada vocação. Knight: Dragon Claw Druid: Mandrake Sorcerer: Soul Stone Paladin: Nose Ring Alguem consegue? REPP++ OBRIGADO DESDE JAA !!!!! Editado Julho 13, 2015 10 anos por brendoonh (veja o histórico de edições)
Postado Julho 13, 2015 10 anos Já modifiquei os scripts para você basta seguir o exemplo do vodkart: http://www.tibiaking.com/forum/topic/15642-pedido-npc-task-system/ Npc: domodlib('KillM_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 = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local msg = string.lower(msg) if isInArray({"task","mission","missao"}, msg) then if not tonumber(getPlayerStorageValue(cid, tsk.storages[1])) then npcHandler:say("Você já terminou a task!", cid) elseif getPlayerStorageValue(cid, tsk.storages[2]) >= 1 then npcHandler:say("Você já matou "..tsk.task[2].." "..tsk.task[1].."? {yes}", cid) talkState[talkUser] = 2 else npcHandler:say("Você deseja fazer uma missão de matar "..tsk.task[2].." "..tsk.task[1].." e receber "..tsk.exp.." de experience e "..tsk.item[getPlayerVocation(cid)].itens.." "..getItemNameById(tsk.item[getPlayerVocation(cid)].count).."? {yes}", cid) talkState[talkUser] = 1 end elseif isInArray({"yes","sim"}, msg) and talkState[talkUser] > 0 then if talkState[talkUser] == 1 then npcHandler:say("Parabéns! Agora você está participando da task, volte quanto tiver terminado!", cid) setPlayerStorageValue(cid, tsk.storages[2], 1) else if getPlayerStorageValue(cid, tsk.storages[1]) >= tsk.task[2] then npcHandler:say("Obrigado guerreiro, aqui está sua recompensa!", cid) setPlayerStorageValue(cid, tsk.storages[1], "Finished") doPlayerAddExp(cid, tsk.exp) doPlayerAddItem(cid, tsk.item[getPlayerVocation(cid)].itens, tsk.item[getPlayerVocation(cid)].count) else npcHandler:say("Você ainda não terminou a sua task!", cid) end end talkState[talkUser] = 0 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()) Mod: <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Task Kill" version="1.0" author="Vodkart" contact="tibiaking.com" enabled="yes"> <config name="KillM_func"><![CDATA[ tsk = { storages = {68754,68755}, task = {"dragon", 10}, -- nome do bixo e quantidade exp = 200, item = { [1] = {itens = {IDDOITEM}, count=10}, [2] = {itens = {IDDOITEM}, count=10}, [3] = {itens = {IDDOITEM}, count=10}, [4] = {itens = {IDDOITEM}, count=10}} } ]]></config> <event type="login" name="AreKill" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "CountTask") return true end]]></event> <event type="kill" name="CountTask" event="script"><![CDATA[ domodlib('KillM_func') function onKill(cid, target) if isMonster(target) then local n = string.lower(getCreatureName(target)) if n == tsk.task[1] and getPlayerStorageValue(cid, tsk.storages[2]) >= 1 then local contagem = getPlayerStorageValue(cid, tsk.storages[1]) if (contagem == -1) then contagem = 1 end if not tonumber(contagem) then return true end if contagem > tsk.task[2] then return true end setPlayerStorageValue(cid, tsk.storages[1], contagem+1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,""..(contagem == tsk.task[2] and "Congratulations! You finished the task of "..n.."." or "defeated. Total [" .. contagem .. "/" .. tsk.task[2] .. "] " .. n .. ".").."") end end return true end]]></event> </mod> Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais... ________________________________________________________________________________ Minhas Sprites: Mega Metagross Mega Abomasnow Pack de Shinys [Posso atualizá-lo com novos shinys a qualquer momento] Tutoriais: [Completo] Criando e adicionando um novo Pokémon [Actions] Criando quest no RME Editores Lua/Xml/Sync Entre outros: Editores Win/Mac/Linux
Postado Julho 13, 2015 10 anos Autor Já modifiquei os scripts para você basta seguir o exemplo do vodkart: http://www.tibiaking.com/forum/topic/15642-pedido-npc-task-system/ Npc: domodlib('KillM_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 = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local msg = string.lower(msg) if isInArray({"task","mission","missao"}, msg) then if not tonumber(getPlayerStorageValue(cid, tsk.storages[1])) then npcHandler:say("Você já terminou a task!", cid) elseif getPlayerStorageValue(cid, tsk.storages[2]) >= 1 then npcHandler:say("Você já matou "..tsk.task[2].." "..tsk.task[1].."? {yes}", cid) talkState[talkUser] = 2 else npcHandler:say("Você deseja fazer uma missão de matar "..tsk.task[2].." "..tsk.task[1].." e receber "..tsk.exp.." de experience e "..tsk.item[getPlayerVocation(cid)].itens.." "..getItemNameById(tsk.item[getPlayerVocation(cid)].count).."? {yes}", cid) talkState[talkUser] = 1 end elseif isInArray({"yes","sim"}, msg) and talkState[talkUser] > 0 then if talkState[talkUser] == 1 then npcHandler:say("Parabéns! Agora você está participando da task, volte quanto tiver terminado!", cid) setPlayerStorageValue(cid, tsk.storages[2], 1) else if getPlayerStorageValue(cid, tsk.storages[1]) >= tsk.task[2] then npcHandler:say("Obrigado guerreiro, aqui está sua recompensa!", cid) setPlayerStorageValue(cid, tsk.storages[1], "Finished") doPlayerAddExp(cid, tsk.exp) doPlayerAddItem(cid, tsk.item[getPlayerVocation(cid)].itens, tsk.item[getPlayerVocation(cid)].count) else npcHandler:say("Você ainda não terminou a sua task!", cid) end end talkState[talkUser] = 0 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()) Mod: <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Task Kill" version="1.0" author="Vodkart" contact="tibiaking.com" enabled="yes"> <config name="KillM_func"><![CDATA[ tsk = { storages = {68754,68755}, task = {"dragon", 10}, -- nome do bixo e quantidade exp = 200, item = { [1] = {itens = {IDDOITEM}, count=10}, [2] = {itens = {IDDOITEM}, count=10}, [3] = {itens = {IDDOITEM}, count=10}, [4] = {itens = {IDDOITEM}, count=10}} } ]]></config> <event type="login" name="AreKill" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "CountTask") return true end]]></event> <event type="kill" name="CountTask" event="script"><![CDATA[ domodlib('KillM_func') function onKill(cid, target) if isMonster(target) then local n = string.lower(getCreatureName(target)) if n == tsk.task[1] and getPlayerStorageValue(cid, tsk.storages[2]) >= 1 then local contagem = getPlayerStorageValue(cid, tsk.storages[1]) if (contagem == -1) then contagem = 1 end if not tonumber(contagem) then return true end if contagem > tsk.task[2] then return true end setPlayerStorageValue(cid, tsk.storages[1], contagem+1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,""..(contagem == tsk.task[2] and "Congratulations! You finished the task of "..n.."." or "defeated. Total [" .. contagem .. "/" .. tsk.task[2] .. "] " .. n .. ".").."") end end return true end]]></event> </mod> Então. O premio so vai vim dps de concluir as 35 missoes né? Para eu adicionar mais bixos ali teria que almentar as storages? E como ficaria? storages = {68754,68755,68756}, task = {"dragon", 10}, -- nome do bixo e quantidade {"dragon lord", 20}, {"frost dragon", 30}, Assim? E esse xp 200? daria no final das 35 missões tb? Como eu disse, sou mt leigo nessa parada, mal mal sei onde vão as coisas kkkkkkkk Editado Julho 13, 2015 10 anos por brendoonh (veja o histórico de edições)
Postado Julho 13, 2015 10 anos task = {{"dragon", 10},{"dragon lord", 20},{"frost dragon", 30}}, -- nome do bixo e quantidade Na verdade ele está ganhando para cada task pois está utilizando somente uma storage para kill exemplo: 10 Dragon = 1 premio, 20 dragon lord = 1 premio a storage é sempre a mesma... Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais... ________________________________________________________________________________ Minhas Sprites: Mega Metagross Mega Abomasnow Pack de Shinys [Posso atualizá-lo com novos shinys a qualquer momento] Tutoriais: [Completo] Criando e adicionando um novo Pokémon [Actions] Criando quest no RME Editores Lua/Xml/Sync Entre outros: Editores Win/Mac/Linux
Postado Julho 13, 2015 10 anos Autor Não teria como fazer para ganhar o premio depois de ter feito as 35 que irei por? Pq a tendencia é essa... o Ultimo premio é mt valioso para ganhar fazendo somente 1 task!
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.