Postado Maio 4, 2014 11 anos Fala Galera do Tibiaking Blz ? Espero que sim Então estou presisando de um npc que tipo ele pedira para o player matar um tando de pokemon . Quando ele voltar o npc dará um item para ele e ele ganhara Exp tbm só que no decorrer do dia ele não podera fazer ela denovo . Mais ai é facio né KKK . ai que ta o dificio . Eo quero que quado chegue a 12:00 Meia Noite e todos os dias ese npc reseta a estorage e o player podera fazer a task novamente . Irei deixar um npc aki caso alguem que posa me ajudar use como base . Obs:ele está bugado gente. 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 tasks = { ["blastoise"] = {["Dailly"] = {{"Blastoise", 300}}}, --modifiquei aki, mas n sei se vai da certo kk ["electabuzz"] = {["Daily"] = {{"Electabuzz", 300}}}, ["venusaur"] = {["Dailly"] = {{"Venusaur", 300}}}, ["charizard"] = {["Dailly"] = {{"Charizard", 300}}}, } local msg = msg:lower() --eh sempre bom por isso.. pra deixar a msg soh em letras minusculas if msgcontains(msg, "task") then if isMyTaskComplete(cid, getNpcCid()) then selfSay("Wow you have already complete my task! Ok then, take your reward!", cid) doPlayerAddExperience(cid, 1500000) --premio doPlayerAddItem(cid, 2160, 25) local sto = getMyTaskSto(cid, getNpcCid()) setPlayerStorageValue(cid, sto, -1) --nunca esqueça disso... setPlayerStorageValue(cid, 25566, os.time() + 24*60*60) setPlayerStorageValue(cid, 181601, 1) --storage da outfit setPlayerStorageValue(cid, 181602, 1) --storage da outfit talkState[talkUser] = 0 return true elseif getPlayerStorageValue(cid, 25566) > os.time() then selfSay("You have to wait 24h to do my task again!", cid) talkState[talkUser] = 0 return true elseif getMyTaskSto(cid, getNpcCid()) ~= -1 then selfSay("You are already doing my task! Go end it!", cid) talkState[talkUser] = 0 return true end selfSay("What task do you want? {blastoise}, {electabuzz}, {venusaur}, {charizard}", cid) talkState[talkUser] = 1 return true elseif isInArray({"blastoise", "electabuzz", "venusaur", "charizard"}, msg) and talkState[talkUser] == 1 then task = tasks[msg] --modifiquei aki tb selfSay("Are you sure?", cid) talkState[talkUser] = 2 return true elseif msgcontains(msg, "yes") and talkState[talkUser] == 2 then local sto = getFreeTaskStorage(cid) if sto == -1 then selfSay("You can't catch more tasks! You are already with the maximum of "..(maxTasks).." tasks!", cid) talkState[talkUser] = 0 return true end selfSay("OK kill 300, good luck!", cid) setStorageArray(cid, sto, task) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Ajudo ? Levo Rep +
Postado Maio 4, 2014 11 anos Bom, sobre a storage, tera que ser alguma globalevent, vou ver o que faço e qualquer coisa volto a postar. www.optimuserver.com [email protected] Skype: optimus.host TEL: (16) 98849-6902 Acesse já e garanta seu servidor com um dos melhores Firewall existentes no mercado!
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.