Ir para conteúdo

luanasar

Membro
  • Registro em

  • Última visita

  1. luanasar reagiu a uma resposta no tópico: Erro em NPC de quest com tasks
  2. Criei um NPC pra uma Quest com 5 tasks, mas não ta funcionando direito, e não consegui encontrar o erro no script. Provavelmente é algum erro nas talkState ou nas storage. Poderiam me ajudar? Servidor 8.6. Segue o lua do NPC: 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 local storage = 5000 function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then if msg == "hi" or msg == "hello" then if getPlayerStorageValue(cid, storage) == -1 then selfSay("Hello " .. getPlayerName .. ". I am kind of busy right now. But, 50 points to gryffindor, anyways.", cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, storage) == 1 then selfSay("Did you find it already? By now, Mr Potter would've brought it to me already..", cid) talkState[talkUser] = 2 elseif getPlayerStorageValue(cid, storage) == 3 then selfSay("Did you find it already? By now, Mr Potter would've brought it to me already..", cid) talkState[talkUser] = 3 elseif getPlayerStorageValue(cid, storage) == 5 then selfSay("Did you find it already? By now, Mr Potter would've brought it to me already..", cid) talkState[talkUser] = 4 elseif getPlayerStorageValue(cid, storage) == 7 then selfSay("Did you find it already? By now, Mr Potter would've brought it to me already..", cid) talkState[talkUser] = 5 elseif getPlayerStorageValue(cid, storage) == 9 then selfSay("Did you find it already? By now, Mr Potter would've brought it to me already..", cid) talkState[talkUser] = 6 else selfSay("Thank you for helping me, " .. getPlayerName .. ".", cid) end npcHandler:addFocus(cid) else return false end end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 1 or cid if msgcontains(msg, "job") or msgcontains(msg, "quest") or msgcontains(msg, "mission") or msgcontains(msg, "help") then if getPlayerStorageValue(cid, storage) == -1 then selfSay( "Ah, so you'd like to help me?! It looks like I misplaced some important items. Would you like to help me finding them?", cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, storage) == 10 then selfSay("I don't have more missions for you right now.", cid) talkState[talkUser] = 1 end elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, storage) == -1 then selfSay( "Good. The first item is Rowena Ravenclaw's Diadem. Look for the {Grey Lady} in Ravenclaw's Common Room and ask her about this {horcrux}, and she might help you. Come back once you have it", cid) setPlayerStorageValue(cid, storage, 1) else if doPlayerRemoveItem(cid, 2139, 1) then selfSay("You found it, " .. getPlayerName .. "! 50 points to your house. And... a few galeons too, so you can buy some candy at Honeydukes. Are you ready for the next task?", cid) doPlayerAddItem(cid, 2160, 3) doPlayerAddExp(cid, 250000) setPlayerStorageValue(cid, storage, 2) talkState[talkUser] = 2 end end elseif msgcontains(msg, "yes") and talkState[talkUser] == 2 then if getPlayerStorageValue(cid, storage) == 2 then selfSay( "The next artifact is Tom Riddle's Diary. Look for a statue in Slytheryn's Common Room, and it should lead you to it's location.", cid) setPlayerStorageValue(cid, storage, 3) else if doPlayerRemoveItem(cid, 10563, 1) then selfSay( "Ah, about time! 50 more points to your house, and a few more galeons.. yada yada. Ready for the next task?", cid) doPlayerAddItem(cid, 2160, 2) doPlayerAddItem(cid, 2152, 50) doPlayerAddExp(cid, 250000) setPlayerStorageValue(cid, storage, 4) talkState[talkUser] = 3 end end elseif msgcontains(msg, "yes") and talkState[talkUser] == 3 then if getPlayerStorageValue(cid, storage) == 4 then selfSay( "The third item is Helga Hufflepuff's Cup. Maybe {Bogrod} knows something about it. You can find him at the Depot, to the west of the Castle.", cid) setPlayerStorageValue(cid, storage, 5) else if doPlayerRemoveItem(cid, 7369, 1) then selfSay("Great, " .. getPlayerName .. "! Although.. I ran out of galeons... I'll give you a little more experience points this time. Ready for the next task?", cid) doPlayerAddExp(cid, 500000) setPlayerStorageValue(cid, storage, 6) talkState[talkUser] = 4 end end elseif msgcontains(msg, "yes") and talkState[talkUser] == 4 then if getPlayerStorageValue(cid, storage) == 6 then selfSay( "The fourth item is Salazar Slytherin's Locket. The {Bloody Baron} might have some information about it. You can find him at Slytherin's Common Room. Don't forget to ask him about the {horcrux}, or he won't give you any leads.", cid) setPlayerStorageValue(cid, storage, 7) else if doPlayerRemoveItem(cid, 7889, 1) then selfSay("Good, good. More galeons to your account, " .. getPlayerName .. ". Ready for the last task?", cid) doPlayerAddItem(cid, 2160, 5) doPlayerAddItem(cid, 2152, 75) doPlayerAddExp(cid, 500000) setPlayerStorageValue(cid, storage, 8) talkState[talkUser] = 5 end end elseif msgcontains(msg, "yes") and talkState[talkUser] == 5 then if getPlayerStorageValue(cid, storage) == 8 then selfsay( "The last item is Marvolo Gaunt's Ring. It's guarded by.. an.. creature. You might have to talk to Hagrid in order to locate it. Don't forget to ask him about the {horcrux}, or he won't give you any leads. And, " .. getPlayerName .. ", good luck!", cid) setPlayerStorageValue(cid, storage, 9) else if doPlayerRemoveItem(cid, 2121, 1) then selfSay("" .. getPlayerName .. ", you made it alive! I mean.. I knew you would. *coughs*. Thank you very much for helping me. 100 points to your house, " .. getPlayerName .. ". And my last galeons too.", cid) doPlayerAddItem(cid, 2160, 10) doPlayerAddExp(cid, 7500) setPlayerStorageValue(cid, storage, 10) talkState[talkUser] = 6 end end elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then selfSay("Nevermind. -10 points to your house.", cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  3. luanasar reagiu a uma resposta no tópico: Estatua ou porta de Teleport.
  4. To tentando usar o script só com a parte de lifeSteal. Comentei o restante do código que não é necessária. Mas ainda assim, quando desequipa o ring, o soptEvent(steal) não funciona, e o player continua tomando dano até morrer. Conseguiu encontrar alguma solução? -- local invisible = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_INVISIBLE) -- local outfit = createConditionObject(CONDITION_INVISIBLE, -1, false) local percent = 3 local tempo = 5 -- em segundos function onEquip(cid, item, slot) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "I told you not to wear this ring..") function lifesteal(cid) steal = addEvent(lifesteal, 1000 * tempo, cid) if isCreature(cid) then doSendAnimatedText(getCreaturePos(cid), "-" .. math.floor((getCreatureMaxHealth(cid) * (percent / 100))), 144, cid) doCreatureAddHealth(cid, -math.floor(getCreatureMaxHealth(cid) * (percent / 100))) end end lifesteal(cid) -- doAddCondition(cid, invisible) -- doAddCondition(cid, outfit) doSendMagicEffect(getCreaturePos(cid), 12) return true end function onDeEquip(cid, item, slot) doTransformItem(item.uid, 2121) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You're no longer cursed.") stopEvent(steal) -- doRemoveCondition(cid, CONDITION_INVISIBLE) doSendMagicEffect(getCreaturePos(cid), 12) -- doRemoveCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) return true end
  5. Poderia compartilhar todos os scripts? Tenho interesse ?
  6. luanasar reagiu a uma resposta no tópico: Como criar quest
  7. Vodkart reagiu a uma resposta no tópico: [TFS] New Auto Loot Unlimited Edition 2.0
  8. luanasar reagiu a uma resposta no tópico: [TFS] New Auto Loot Unlimited Edition 2.0
  9. luanasar reagiu a uma resposta no tópico: Free for use!
  10. luanasar reagiu a uma resposta no tópico: Monstros na Perspectiva
  11. luanasar reagiu a uma resposta no tópico: Fazendo Sprites
  12. luanasar reagiu a uma resposta no tópico: Fazendo Sprites
  13. Fui importar uma database e o phpmyadmin deu esse erro Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 100663304 bytes) in C:\xampp\phpMyAdmin\libraries\Util.php on line 2302 Não consigo acessar mais o localhost e não sei o que fazer. Alguma dica?
  14. Estou com um problema nas portas das casas. Em alguns lugares, mesmo alterando o modelo de porta pelo Remere's, ela não é atualizada no servidor. E praticamente nenhuma delas está abrindo, apresentando a mensagem You cannot use this object. PS: Já tentei deletar as casas e adicionar elas de novo, mas o problema persiste. Seguem prints do servidor e do Remere's
  15. luanasar postou uma resposta no tópico em Tibia Global OTServer
    Segui o tutorial do video, mas quando tento fazer login dá Connection refused. Sabe o que pode ser?
  16. luanasar postou uma resposta no tópico em Tibia Global OTServer
    (Desculpa a pergunta idiota, mas eu to voltando agora pra área de otserv e to penando pra aprender tudo de novo) Não tem ipchanger pra versão 11.32? Como faço pra entrar no servidor?
  17. luanasar postou uma resposta no tópico em Suporte Tibia OTServer
    No caso essa pasta Mods fica dentro de data? Eu criei a pasta em data e criei o arquivo xml, mas aparentemente não funcionou.
  18. luanasar postou uma resposta no tópico em Suporte Tibia OTServer
    Quando abro o loader do servidor aparece o seguinte erro: [Warning - Event: : checkScript] Event onSay not found. scripts/save.lua

Informação Importante

Confirmação de Termo