Ir para conteúdo

Bodak Reborn

Campones
  • Total de itens

    90
  • Registro em

  • Última visita

  • Dias Ganhos

    2

Tudo que Bodak Reborn postou

  1. Bodak Reborn

    Ajuda Random NPC

    Tenta assim: troca local tasks = {[1] = {name = "Blastoise", qnt = 20, npc = "Junko"},[2] = {name = "Electabuzz", qnt = 15, npc = "Junko"},[3] = {name = "Venusaur", qnt = 18, npc = "Junko"},[4] = {name = "Charizard", qnt = 27, npc = "Junko"},} por local tasks = {}if getPlayerLevel (cid) < 30 then tasks = { [1] = {name = "Weedle", qnt = 20}, [2] = {name = "Rattata", qnt = 15}, [3] = {name = "Charmander", qnt = 18}, [4] = {name = "Poliwag", qnt = 27}, }}elseif getPlayerLevel (cid) >= 30 and getPlayerLevel (cid) < 60 then tasks = { [1] = {name = "Ivysaur", qnt = 20}, [2] = {name = "Poliwhirl", qnt = 15}, [3] = {name = "Seadra", qnt = 18}, [4] = {name = "Weepinbell", qnt = 27}, }elseif getPlayerLevel (cid) >= 60 and getPlayerLevel (cid) < 100 then tasks = { [1] = {name = "Marowak", qnt = 20}, [2] = {name = "Machoke", qnt = 15}, [3] = {name = "Haunter", qnt = 18}, [4] = {name = "Hypno", qnt = 27}, }elseif getPlayerLevel (cid) >= 100 then tasks = { [1] = {name = "Blastoise", qnt = 20}, [2] = {name = "Electabuzz", qnt = 15}, [3] = {name = "Venusaur", qnt = 18}, [4] = {name = "Charizard", qnt = 27}, }end
  2. Bodak Reborn

    Ajuda Random NPC

    O modo que eu fiz, grava o nome dos pokémon em uma storage, então se tu colocar a mesma storage em todos os NPCs, cada vez que tu falar com um tu vai substituir a antiga storage, entende? Se não me engano, a storage que tu tem que manter é a "done".
  3. @iStark Provavelmente faltou algo no order.lua da lib, lá que define a outfit do pokémon ao subir no fly. Sobre o look, tenta colocar em um pokémon não-shiny e vê o que dá.
  4. Tenta dar look com ele morto, se não der, reinicia o servidor. Não faz sentido, deve ser algo da base DxP...
  5. Tu consegue dar look normalmente ou tu da look e da erro na distro?
  6. @iStark, tu deu /reload cr? Se sim, tenta assim: Sobre o fly, eu já testei aqui e está normal, tenho certeza que tu esqueceu de algo.
  7. Embaixo de CADA: if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end adicione: if getItemAttribute(thing.uid, "addon") then if flysAddon[getItemAttribute (thing.uid, "addon")] or ridesAddon[getItemAttribute (thing.uid, "addon")] or surfsAddon[getItemAttribute (thing.uid, "addon")] then if getItemAttribute(thing.uid, "addon") > 1 then table.insert(str, " Has the addon "..getItemNameById (getAddonId (getItemAttribute (thing.uid, "addon")))..".") end end end
  8. "E também, novamente, embaixo dos dois, adicione:" Tu adicionou as linhas somente abaixo de um dos blocos de código que eu mencionei.
  9. @iStark Tu não adicionou o sistema... o_O Reveja tudo.
  10. @iStark, não precisa subtrair 351, eu fiz pra não precisar. A sua lib e actions está okay, a única coisa que eu penso sobre o bug é que tu esqueceu de adicionar algo, reveja se está tudo adicionado. Sobre o evolution.lua, a cada " doEvolvePokemon", tu coloca aquela linha que eu falei.
  11. @iStark Tenta assim: procura por doEvolvePokemon(cid, item2, evo, stnid, stnid2) e embaixo coloca: doItemSetAttribute (item2, "addon", 0) Sobre o vídeo, eu acho desnecessário. O que eu vou fazer no vídeo é, ler o tópico e mostrar eu colocando as linhas que eu disponibilizei, nada demais... É a mesma coisa que eu falei lá em cima, olha só: se algo na lib tiver errado, vai dar esse bug.
  12. Atualizei o comentário com o código, pega lá. (só o creaturescripts)
  13. Foi o que eu te disse, tem que fazer um script pra resetar o storage depois de 24 horas. Isso é assunto de outro tópico, e já tem vários tópicos sobre isso aqui e no "sitezinho qualquer", só procurar.
  14. Não entendi... npc qntleft? event qnt storage? o_O
  15. Não. Perceba no final do código do NPC, que tem isso: local storage = 154721setPlayerStorageValue (cid, storage, name.."/"..qnt) No creaturescript eu pego o storage do player e dou explode, então se no final do código de cada NPC tiver isso com o mesmo storage, creio eu que não terá problemas.
  16. Ficou bem confuso. Pelo que entendi, tu não quer que o cara possa fazer a quest do 4 NPCs no mesmo dia, é isso? A storage que verifica se ele já terminou a task (depois que os prêmios foram entregues) é a "done", então mantendo ela em todos os scripts, o cara só vai poder fazer uma por dia.
  17. Eu tinha feito com o nome do NPC invés de "daily", ai eu lembrei que tu pediu pra deixar "daily" invés do nome do NPC. Eu esqueci de tirar... :'( não serve pra nada, pode tirar se quiser. E também, se quiser, eu posso colocar para aparecer o nome do NPC invés de "daily". As storages tem que ser diferentes.
  18. Eu coloquei pra quando você falar com o NPC pela primeira vez, ele te dar dois pokémon fixos, ou seja, se tu logar em outro char, vai ter dois pokémon fixos pra ele também. Com fixo eu quero dizer que, você pode falar com ele quantas vezes quiser/deslogar e tal, mas só quando os storages forem zerados que ele te dará outros pokémon.
  19. Eu fiz umas modificações no NPC: local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endlocal tasks = {[1] = {name = "Blastoise", qnt = 20, npc = "Junko"},[2] = {name = "Electabuzz", qnt = 15, npc = "Junko"},[3] = {name = "Venusaur", qnt = 18, npc = "Junko"},[4] = {name = "Charizard", qnt = 27, npc = "Junko"},}local function getRandomTaskMonster1 () local randomTask = math.random(#tasks) local taskPokemon = tasks[randomTask].namereturn taskPokemonendlocal function getRandomTaskMonster2 () local randomTask2 = math.random(#tasks) local taskPokemon2 = tasks[randomTask2].namereturn taskPokemon2end 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 = msg:lower() if msgcontains(msg, "task") then qntLeft = 84956 gotDaily = 84957 fixedPokemon = 84958 daily = 5619846 check = 84959 done = 84960 if getPlayerStorageValue (cid, gotDaily) == 1 then if getPlayerStorageValue (cid, done) == 1 then selfSay ("Thank you! Was incredible!", cid) talkState[talkUser] = 0 return true elseif getPlayerStorageValue (cid, qntLeft) == 0 then selfSay ("Did you kill all of them?", cid) setPlayerStorageValue (cid, check, 1) talkState[talkUser] = 2 return true elseif getPlayerStorageValue(cid, 25588) > os.time() then selfSay("You have to wait 24h to do my task again!", cid) talkState[talkUser] = 0 return true elseif getPlayerStorageValue (cid, daily) ~= 0 and getPlayerStorageValue (cid, daily) ~= -1 then if getPlayerStorageValue (cid, qntLeft) >= 0 then local n = string.explode(getPlayerStorageValue (cid, daily), " ") local str = string.sub(getPlayerStorageValue (cid, daily), 1, 1) local sta = string.sub(getPlayerStorageValue (cid, daily), 2, string.len(getPlayerStorageValue (cid, daily))) name = ""..string.upper(str)..""..string.lower(sta).."" selfSay("What are you waiting for? Go kill the remaining "..getPlayerStorageValue (cid, qntLeft).." "..name.."!", cid) talkState[talkUser] = 2 return true end end end if getPlayerStorageValue (cid, fixedPokemon) ~= 1 then randomName1 = getRandomTaskMonster1 () randomName2 = getRandomTaskMonster2 () while randomName1 == randomName2 do randomName1 = getRandomTaskMonster1 () randomName2 = getRandomTaskMonster2 () end for i = 1, #tasks do if tasks[i].name == randomName1 then qnt1 = tasks[i].qnt end if tasks[i].name == randomName2 then qnt2 = tasks[i].qnt end end setPlayerStorageValue (cid, fixedPokemon, 1) end selfSay("Which you prefer? "..qnt1.." "..randomName1.." or "..qnt2.." "..randomName2.."?", cid) talkState[talkUser] = 1 return true elseif (msg == randomName1:lower() or msg == randomName2:lower()) and talkState[talkUser] == 1 then decide = msg selfSay("Are you sure?", cid) talkState[talkUser] = 2 return true elseif msgcontains(msg, "yes") and talkState[talkUser] == 2 then if getPlayerStorageValue (cid, check) == 1 then selfSay ("Thank you! That was incredible, i can't believe you kill all of them!", cid) setPlayerStorageValue(cid, sto, -1) doPlayerAddExperience(cid, 1500000) doPlayerAddItem(cid, 2160, 25) local sto = 5646132 setPlayerStorageValue(cid, sto, -1) setPlayerStorageValue(cid, 25566, os.time() + 24*60*60) setPlayerStorageValue(cid, 181601, 1) setPlayerStorageValue(cid, 181602, 1) setPlayerStorageValue(cid, qntLeft, -1) setPlayerStorageValue(cid, done, 1) talkState[talkUser] = 0 end if getPlayerStorageValue (cid, gotDaily) == 1 then return true end setPlayerStorageValue (cid, daily, decide) setPlayerStorageValue (cid, gotDaily, 1) for i = 1, #tasks do if tasks[i].name:lower() == getPlayerStorageValue (cid, daily) then qnt = tasks[i].qnt end end setPlayerStorageValue (cid, qntLeft, qnt) 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 local n = string.explode(getPlayerStorageValue (cid, daily), " ") local str = string.sub(getPlayerStorageValue (cid, daily), 1, 1) local sta = string.sub(getPlayerStorageValue (cid, daily), 2, string.len(getPlayerStorageValue (cid, daily))) name = ""..string.upper(str)..""..string.lower(sta).."" local storage = 154721 setPlayerStorageValue (cid, storage, name.."/"..qnt) selfSay("OK kill all, good luck!", cid) talkState[talkUser] = 0 return true endreturn trueendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new()) E aqui o creaturescripts, presumo que você saiba adicionar as tags. Caso tenha dificuldades, me avise. function onKill(cid, target) if not isPlayer (cid) then return true end local storage = 154721 if getPlayerStorageValue (cid, storage) == -1 then return true end local check = 154722 local qntStorage = 84956 local explode = string.explode(getPlayerStorageValue(cid, storage), "/") local pokename = explode[1] local qnt = explode[2] if ehMonstro(target) then if getCreatureName (target) == pokename then if getPlayerStorageValue (cid, qntStorage) > 0 and getPlayerStorageValue (cid, check) ~= 1 then doPlayerSendTextMessage(cid, 27, "Daily: You need to kill more "..getPlayerStorageValue (cid, qntStorage).." "..pokename.."!") setPlayerStorageValue (cid, qntStorage, getPlayerStorageValue (cid, qntStorage) - 1) if getPlayerStorageValue (cid, qntStorage) == 0 and getPlayerStorageValue (cid, check) ~= 1 then doPlayerSendTextMessage(cid, 27, "Daily: Quest Done!") setPlayerStorageValue (cid, check, 1) end end end end return trueend Lembrando que você tem que resetar todos os storages depois de 24 horas, se não a contagem só vai aparecer uma vez.
  20. Acho que fica mais simples, vou terminar um sistema que prometi pra um cara e já faço isso.
  21. Específico apenas para esse NPC?
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...