Ir para conteúdo
  • Cadastre-se
  1. leozincorsair

    leozincorsair

  2. Diiego Liima

    Diiego Liima

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por specail
      Olá. Estou com um problema no NPC Halvar, o carinha da arena de Svar... A quest funciona normalmente (cada player só pode fazer 1x cada e em ordem, começando pela Greenhorn, depois Scrapper e Warlord...)
       
      Porém aparecem alguns erros que incomodam um pouco, queria saber se tem como tirar...

      Quando falo hi pro npc:
       
      [15/7/2023 18:29:17] [Error - NpcScript Interface] [15/7/2023 18:29:17] data/npc/scripts/arena.lua:onCreatureSay [15/7/2023 18:29:17] Description: [15/7/2023 18:29:17] (LuaInterface::internalGetPlayerInfo) Player not found when requesting player info #3 [15/7/2023 18:29:17] [Error - NpcScript Interface] [15/7/2023 18:29:17] data/npc/scripts/arena.lua:onCreatureSay [15/7/2023 18:29:17] Description: [15/7/2023 18:29:17] data/npc/scripts/arena.lua:46: attempt to compare number with boolean [15/7/2023 18:29:17] stack traceback: [15/7/2023 18:29:17] data/npc/scripts/arena.lua:46: in function <data/npc/scripts/arena.lua:34> [15/7/2023 18:29:17] [C]: in function 'selfSay' [15/7/2023 18:29:17] data/npc/scripts/arena.lua:37: in function <data/npc/scripts/arena.lua:34>  
      E quando eu falo bye ou fico sem digitar nada por alguns segundos o NPC fica louco e spamma "bye" 20 vezes kkkkkk... Segue o erro:
      [15/7/2023 18:29:28] [Error - NpcEvents::onCreatureSay] NPC Name: Halvar - Call stack overflow  
      Eu renomeei todas falas dele com "bye" pra saber qual causava isso, porque o fdm tem 4 falas assim... e a mensagem que ele está spamando é essa que esta agora como "Bye three!"
      Segue o script completo que acusa o erro:
      domodlib('arenaFunctions') 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 focus = 0 local talk_start = 0 local TS = 0 function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Bye one.') focus = 0 talk_start = 0 end end local function BYE() focus = 0 talk_start = 0 TS = 0 end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) msg = string.lower(msg) if (msgcontains(msg, 'hi') and (focus == 0)) then selfSay('Hello ' .. getCreatureName(cid) .. ', do you want to fight in the arena?') focus = cid talk_start = os.clock() TS = 1 elseif msgcontains(msg, 'hi') and (focus ~= cid) then selfSay('Im Busy') elseif TS == 1 and msgcontains(msg, 'yes') or msgcontains(msg, 'fight') or msgcontains(msg, 'arena') then if getPlayerStorageValue(cid, myArenaLevel) < 3 then local enterArena = myArenaLevelIs(cid) if getPlayerLevel(cid) >= enterArena.RLV then if getPlayerMoney(cid) >= enterArena.RC then setPlayerStorageValue(cid, talkNPC, 1) doPlayerRemoveMoney(cid, enterArena.RC) selfSay("Now you can face the... ".. enterArena.LN .."level!") BYE() else selfSay("You don\'t have "..enterArena.RC.." gold! Come back when you are ready!") BYE() end else selfSay("You don\'t have level "..enterArena.RLV.." yet! Come back when you are ready!") BYE() end else selfSay(Cancel[6]) BYE() end elseif TS == 1 and msgcontains(msg, 'no') then selfSay("Bye two!") BYE() elseif msgcontains(msg, 'bye') then selfSay("Bye three!") BYE() end return true end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 10 then if focus > 0 then selfSay('Bye four.') end focus = 0 end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())  
    • Por L3K0T
      NPC DE TELETRANSPORTE
       
      Nada mais diz, é um NPC que faz para teletransportar jogadores para lugares aleatórios e deixando o jogo mais interessante.
       
       
      INSTALANDO:
      1 - vá em data/npc/scripts copie um arquivo .lua, renomeia a gosto, apague o que esta dentro e adicione o código abaixo:
       
      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 l3k0tpos = { {x = 1002, y = 1000, z = 7}, --trocar posisão 1 {x = 1003, y = 1000, z = 7}, --trocar posisão 2 {x = 1004, y = 1000, z = 7}, --trocar posisão 3 {x = 1004, y = 1000, z = 7} --trocar posisão 4 } function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'teleporte')) and talkState[talkUser] ~= 2 then selfSay('Gostaria de ir para um lugar aletorio? {yes} ou {no}.', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes')) and talkState[talkUser] == 1 then local l3k0t = l3k0tpos[math.random(#l3k0tpos)] doTeleportThing(cid, l3k0t) doSendMagicEffect(l3k0t, CONST_ME_TELEPORT) selfSay('Pronto! Boa jornada.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'no')) and talkState[talkUser] ~= 1 then talkState[talkUser] = 0 selfSay('Ok, até logo!', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())  
       
      2 - agora em data/npc/ copie um arquivo .xml, renomeia a gosto e coloque o colodigo abaixo:
       
      <npc name="Teleporte" script="data/npc/scripts/npctelerandom.lua" floorchange="0" walkinterval="2000" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="128" head="79" body="95" legs="57" feet="106" addons="2"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME| posso te levar para um ilugar especial, deseja ir? é só dizer {teleporte}" /> </parameters> </npc>  
       
      Créditos: @L3K0T
      agora é só por o npc no mapa e usar
       
       
       
       
    • Por MatheusVidaLoka
      Fala galera do Tibia King, hoje venho trazer um actions a vocês, queria dizer que essa action já é velha, mas dei uma olhada no TK e não vi nada a respeito da action, então decidi postar para vocês.




      Qual a função da Action?



      É um novo tipo de gold que cada um vale 1kk, funcionando normal nas compras e vendas de itens em npcs, e nas trocas de crystal coin para o golda nugget (novo gold).




      Bom vamos ao script.




      Vá em data/actions/scripts e abra o arquivo crystal.lua, apague tudo o que está dentro, logo em seguida cole o script abaixo:









      Traduzindo:
      Vermelho: É o id da crystal coin, e a quantidade a ser trocada por 1 gold nugget (Novo Gold).
      Azul: É o id da gold nugget, e a quantidade de gold nugget.




      Logo em seguida, vá novamente em data/actions/scripts copie qualquer arquivo.lua e cole, em seguida renomeie-o para "goldnuggets" sem aspas, abra-o, apague tudo, e cole o script abaixo.




      Traduzindo:
      Laranja: É o que vai dizer quando o player trocar 1 gold nugget por 100 crystal coins.
      Verde: É o id da crystal coin, e a quantidade equivalente a 1 gold nugget.



      Logo em seguida, abra data/actions/actions.xml e adicione a tag abaixo.









      Traduzindo:
      Rosa: É o id do gold nuggets.
      Azul: O nome do arquivo.lua que você salvou.




      Depois disso abra data/items/items.xml, aperte CTRL + F, e digite 2157, ai você vai achar o item Gold Nugget que vai estar assim:








      Substitua tudo por isso:



      <item id="2157" article="a" name="gold nugget" plural="gold nuggets">
      <attribute key="weight" value="10"/>
      <attribute key="worth" value="1000000" />




      Traduzindo:
      Vermelho: Peso do gold nugget.
      Azul: Valor do item (como 1 crystal coin = 10k , 1 gold nugget = 1kk)




      Logo depois vá data/actions/scripts/other e abra o arquivo changegold.lua, susbistitua tudo oque está la dentro por esse script a seguir, e salve:




      -- By MatheusVidaLoka
      local coins = {
      [iTEM_GOLD_COIN] = {
      to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW
      },
      [iTEM_PLATINUM_COIN] = {
      from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE
      },
      [iTEM_CRYSTAL_COIN] = {
      from = ITEM_PLATINUM_COIN, to = 2157, effect = TEXTCOLOR_LIGHTBLUE
      },
      [2157] = {
      from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_TEAL
      }



      }



      function onUse(cid, item, fromPosition, itemEx, toPosition)
      if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
      return false
      end



      local coin = coins[item.itemid]
      if(not coin) then
      return false
      end



      if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then
      doChangeTypeItem(item.uid, item.type - item.type)
      doPlayerAddItem(cid, coin.to, 1)
      doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)
      elseif(coin.from ~= nil) then
      doChangeTypeItem(item.uid, item.type - 1)
      doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
      doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)
      end
      return true
      end



      Traduzindo:
      Vermelho: É o id do Gold Nugget.




      Por fim vá em data/actions/actions.xml, pule uma linha qualquer e cole isso, e salve:



      <action itemid="2157" event="script" value="other/changegold.lua"/>




      Traduzindo:
      Azul: É o id do gold nugget.
      Verde: O nome do arquivo que você salvou.

      Server testado em Ot 8.60 e funcionou corretamente.



      Creditos:



      MatheusVidaLoka



      JFLNT




      Se enfringi alguma regra do TK por favor me reporte.




      Desculpe-me pelos mal usos das ferramentas do TK (quotes,spoiler,CODES,etc) pois estou com certos problemas.

    • Por pabloxp
      gostaria que alguem me ajuda-se!! queria 1 sistema ou script que o trenó (Sled) se movimentase qnd o char fica-se em cima dele e ele controlase o trenó para as direçoes segurando CTRL + a direção desejada
      +rep pra qm ajudar
    • Por jonei
      Olá Tibiakinguianos, meu OT tem uma coisa que eu não entendo pra que...
      Vip system
      Premmium system
       
      Pelo que eu sei o premmium system é aquele no qual tu pode tocar as spells, usar barco, comprar casa entre outros
       
      o Vip system... Ai é que esta o problema, eu não sei nem pra que serve o Vip system. então estou aqui pedindo pra que alguém me explique a diferença entre estes

      Desde já agradeço
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo