Ir para conteúdo
  • Cadastre-se

Posts Recomendados

alguem poderia me ajudar com esse erro ?

é um npc que ataca monsters e playes com skull

fica dando esse erro toda hora.

Spoiler

local level = 10  ----- change this to make the npc hit more/less---------------------|damage_min = (level * 2 + maglevel * 3) * min_multiplier | 
 local maglevel = 10  ----- change this to make the npc hit more/less -----------------|damage_max = (level * 2 + maglevel * 3) * max_multiplier | 
 local min_multiplier = 2.1  ----- change this to make the npc hit more/less ----------|damage_formula = math.random(damage_min,damage_max)      | 
 local max_multiplier = 4.2  ----- change this to make the npc hit more/less --------------------------------------------------------------------- 
 local check_interval = 5  ----- change this to the time between checks for a creature (the less time the more it will probably lag :S)   
 local radiusx = 7  ----- change this to the amount of squares left/right the NPC checks (default 7 so he checks 7 squares left of him and 7 squares right (the hole screen)   
 local radiusy = 5  ----- change this to the amount of squares left/right the NPC checks (default 5 so he checks 5 squares up of him and 5 squares down (the hole screen)   
 local Attack_message = "An Invader, ATTACK!!!"  ----- change this to what the NPC says when he sees a monster(s)   
 local town_name = "Archgard"  ----- the name of the town the NPC says when you say "hi"  
 local Attack_monsters = TRUE  ----- set to TRUE for the npc to attack monsters in his area or FALSE if he doesnt  
 local Attack_swearers = TRUE  ----- set to TRUE for the npc to attack players that swear near him or FALSE if he doesnt  
 local Attack_pkers = TRUE  ----- set to TRUE for the npc to attack players with white and red skulls or FALSE if he doesnt  
 local health_left = 10  ----- set to the amount of health the npc will leave a player with if they swear at him (ie at 10 he will hit the player to 10 health left)  
 local swear_message = "Take this!!!"  ----- change this to what you want the NPC to say when he attackes a swearer  
 local swear_words = {"shit", "fuck", "dick", "cunt"}  ----- if "Attack_swearers" is set to TRUE then the NPC will attack anyone who says a word in here. Remember to put "" around each word and seperate each word with a comma (,)  
 local hit_effect = CONST_ME_MORTAREA  ----- set this to the magic effect the creature will be hit with, see global.lua for more effects 
 local shoot_effect = CONST_ANI_SUDDENDEATH  ----- set this to the magic effect that will be shot at the creature, see global.lua for more effects 
 local damage_colour = TEXTCOLOR_RED  ----- set this to the colour of the text that shows the damage when the creature gets hit 
 ------------------end of config------------------  
 local check_clock = os.clock()  ----- leave this  
 local focus = 0  ----- leave this   
  
 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)  
 health = getCreatureHealth(cid) - health_left  
    if ((string.find(msg, '(%a*)hi(%a*)'))) and getDistanceToCreature(cid) < 4 then   
        selfSay('Hello ' .. creatureGetName(cid) .. '! I am a defender of '..town_name..'.')   
        doNpcSetCreatureFocus(cid)   
        focus = 0  
    end  
  
    if msgcontains(msg, 'time') then 
        selfSay('The time is ' .. getWorldTime() .. '.') 
    end 
  
    if messageIsInArray(swear_words, msg) then  
        if Attack_swearers == TRUE then  
            selfSay('' .. swear_message ..' ')   
            doCreatureAddHealth(cid,-health)  
            doSendMagicEffect(getThingPos(cid),17)   
            doSendAnimatedText(getThingPos(cid),health,180)  
            doNpcSetCreatureFocus(cid)   
            focus = 0   
        end  
    end  
 end   
  
 function getMonstersfromArea(pos, radiusx, radiusy, stack)  
 local monsters = { }   
 local starting = {= (pos.- radiusx), y = (pos.- radiusy), z = pos.z, stackpos = stack}   
 local ending = {= (pos.+ radiusx), y = (pos.+ radiusy), z = pos.z, stackpos = stack}   
 local checking = {= starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos}   
    repeat   
        creature = getThingfromPos(checking)   
            if creature.itemid > 0 then   
                if isCreature(creature.uid) == TRUE then  
                    if isPlayer(creature.uid) == FALSE then 
                        if Attack_monsters == TRUE then                             
                            table.insert (monsters, creature.uid)   
                            check_clock = os.clock()                          
                        end 
                    elseif isPlayer(creature.uid) == TRUE then   
                        if Attack_pkers == TRUE then  
                            if getPlayerSkullType(creature.uid) > 0 then  
                                table.insert (monsters, creature.uid)   
                                check_clock = os.clock()       
                            end  
                        end  
                    end   
                end   
            end   
        if checking.== pos.x-1 and checking.== pos.then   
            checking.= checking.x+2   
        else    
            checking.= checking.x+1   
        end   
        if checking.> ending.then   
            checking.= starting.x   
            checking.= checking.y+1   
        end   
    until checking.> ending.y   
        return monsters   
 end   
  
 function onThink()   
 if (Attack_monsters == TRUE and Attack_pkers == TRUE) or (Attack_monsters == TRUE and Attack_pkers == FALSE) or (Attack_monsters == FALSE and Attack_pkers == TRUE) then  
    if (os.clock() - check_clock) > check_interval then       
        monster_table = getMonstersfromArea(getCreaturePosition(getNpcCid(  )), radiusx, radiusy, 253)   
            if #monster_table >= 1 then  
                selfSay('' .. Attack_message ..' ')   
                    for i = 1, #monster_table do   
                        doNpcSetCreatureFocus(monster_table[i])   
                        local damage_min = (level * 2 + maglevel * 3) * min_multiplier   
                        local damage_max = (level * 2 + maglevel * 3) * max_multiplier   
                        local damage_formula = math.random(damage_min,damage_max) 
                        doSendDistanceShoot(getCreaturePosition(getNpcCid(  )), getThingPos(monster_table[i]), shoot_effect) 
                        doSendMagicEffect(getThingPos(monster_table[i]),hit_effect)   
                        doSendAnimatedText(getThingPos(monster_table[i]),damage_formula,damage_colour)   
                        doCreatureAddHealth(monster_table[i],-damage_formula)   
                        check_clock = os.clock()   
                        focus = 0   
                    end   
            elseif table.getn(monster_table) < 1 then   
                focus = 0   
                check_clock = os.clock()   
            end     
    end  
 end  
    focus = 0  
 end
Spoiler

<?xml version="1.0"?> 
  
 <npc name="Defender" script="defender.lua" access="5" lookdir="2" walkinterval="1000"> 
  <mana now="800" max="800"/> 
  <health now="200" max="200"/> 
  <look type="131" head="116" body="94" legs="78" feet="115" addons="3"/> 
 </npc>

[Error - Npc interface]
data/npc/scripts/defender.lua:onThink
Description:
(luaGetThingFromPos) Tile not found

 

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por braianlomas
      Como faço para corrigir esse problema para meu cliente, eu uso o tfs 0.3.6  
      Quero resolver esse problema que tenho no meu cliente, como e onde posso resolver?  
      Eu uso o tfs 0.3.6, não tenho as fontes do cliente, se você puder me dar eu vou amá-las para sempre  
       

       
    • Por A.Mokk
      Ola pessoal, estou tentando compilar o TFS 1.5 Downgrade para 8.60 atraves do MSVC 2022, ao tentar compilar da o seguinte erro:
       
       
      Fiz o download do MSVC, GitDash, TFS-SDK-3.2, e de varios boosts que tentei, ao fazer o seguinte procedimento no GitDash:
       
      Ao chegar em ./bootstrap-vcpkg.bat o GitDash nao consegue realizar o procedimento corretamente, alguem poderia me ajudar ?

      Tentei de diversas formas mas o mesmo erro sempre persiste, atualmente meu servidor utiliza TFS 0.4, consigo compilar sem nenhum problema no MSVC 2010, porem, as limitações do TFS 0.4 estão me fazendo precisar atualizar, se alguem souber como corrigir esses erros eu agradeço !

      Tutoriais utilizados :
      Compiling on Windows (vcpkg) · otland/forgottenserver Wiki · GitHub
      Compiling on Windows · otland/forgottenserver Wiki · GitHub
      Compilando TFS 1.3 com vídeo-aula - Tutoriais Infraestrutura & Proteção - Tibia King - Tudo sobre Tibia, OTServ e Bots!
      Compilar TFS 1.3 Vcpkg - Tutoriais Infraestrutura & Proteção - Tibia King - Tudo sobre Tibia, OTServ e Bots!
       
      O que acontece no Powershell:
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      Canary 2.3.6
      Qual o motivo deste tópico? 
      Queria fazer com que os players não pudessem mexer no aleta sio, pois, agora os mesmos estão conseguindo mexer nos itens
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      canary para o cliente 13.16
      Qual o motivo deste tópico? 
      Não consigo encontrar onde ajusta
      to com o problema no 13.16  o exausted, por exemplo os kinas era pra combar exori, erori gran e exori min, porém não ta indo ta dando exausted o char ta soltando magia ou runa e não consegue usar as potions
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • Por Andersontatuador
      Olá galera da TK, me chamo Anderson estou procurando alguém profissional em otservs e site.
      Já tenho um servidor o site e o cliente preciso só de uma pessoal competente, que esteja empenhado a trabalhar,
      não quero nada de graça, pois nessa onda fui mais roubado do quer eu pagar um profissional.
      caso alguém se interesse entrar em contato comigo através do whatsapp
      82 9 9304-9462
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo