Ir para conteúdo

Featured Replies

Postado
  • Autor
20 minutos atrás, Mor3nao disse:

spells/script/find_person

No meu não há essa pasta, será que deve estar em outro local? Uso tfs 0.4 (8.6)

7 minutos atrás, Movie disse:

Faz utilizando uma tabela global, inserindo o last monster que o player atacou. No exiva você só pega a informação da tabela global :)

 

image.png.e55cbd27c3d6ae5893e29d2718904e7f.png

Eu gostaria bastante de entender o que você disse, pois parece uma solução simples para o meu pedido.

</instant>
    <instant name="Find Person" words="exiva" lvl="8" mana="20" aggressive="0" params="1" exhaustion="1000" needlearn="0" event="function" value="searchPlayer">
        <vocation id="1"/>
        <vocation id="2"/>
        <vocation id="3"/>
        <vocation id="4"/>
        <vocation id="5"/>
        <vocation id="6"/>
        <vocation id="7"/>
        <vocation id="8"/>
    </instant>

 

(única coisa que achei a respeito do exiva, pois não há pasta de script para ele. Porém ele funciona normalmente)

  • Respostas 10
  • Visualizações 2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Então, pra fazer esse rolê de falar o ultimo, vai dar um trabalho meio chato, unico jeito q pense é mexendo na database, mas fiz esse, q fala o target ATUAL, as vezes te serve ?   bota essas

Posted Images

Postado

Ele está em spells.cpp na source se tiver ela, existe a versão lua feita pelo LukeOake.

Spoiler

function getSearchString(fromPos, toPos, isFromCreature, isToCreature)
    isFromCreature = isFromCreature == nil and false or isFromCreature
    isToCreature = isToCreature == nil and false or isToCreature
    local DISTANCE_CLOSE,DISTANCE_FAR,DISTANCE_VERYFAR = 0,1,2
    local LEVEL_HIGHER,LEVEL_LOWER,LEVEL_SAME = 1,-1,0
    local DIR_N,DIR_S,DIR_E,DIR_W,DIR_NE,DIR_NW,DIR_SE,DIR_SW = 0,1,2,3,4,5,6,7,8
    local distance
    local direction
    local level
    local dx,dy,dz = fromPos.x - toPos.x,fromPos.y - toPos.y,fromPos.z - toPos.z
    
    if dz > 0 then
        level = LEVEL_HIGHER
    elseif dz < 0 then
        level = LEVEL_LOWER
    else
        level = LEVEL_SAME
    end
    
    if math.abs(dx) < 5 and math.abs(dy) < 5 then
        distance = DISTANCE_BESIDE
    else
        tmp = dx * dx + dy * dy
        if tmp < 10000 then
            distance = DISTANCE_CLOSE
        elseif tmp < 75625 then
            distance = DISTANCE_FAR
        else
            distance = DISTANCE_VERYFAR
        end
    end
    
    local tangent
    
    if dx ~= 0 then
        tangent = dy / dx
    else
        tangent = 10.
    end
    
    if math.abs(tangent) < 0.4142 then
        if dx > 0 then
            direction = DIR_W
        else
            direction = DIR_E
        end
    elseif math.abs(tangent) < 2.4142 then
        if tangent > 0 then
            if dy > 0 then
                direction = DIR_NW
            else
                direction = DIR_SE
            end
        else
            if dx > 0 then
                direction = DIR_SW
            else
                direction = DIR_NE
            end
        end
    else
        if dy > 0 then
            direction = DIR_N
        else
            direction = DIR_S
        end
    end
    
    local ss = ""
    
    if distance == DISTANCE_BESIDE then
        if level == LEVEL_SAME then
            ss = ss.."is "
            if toIsCreature then
                ss = ss.."standing "
            end
            
            ss = ss.."next to you"
        elseif level == LEVEL_HIGHER then
            ss = ss.."is above "
            if fromIsCreature then
                ss = ss.."you"
            end
        elseif level == LEVEL_LOWER then
            ss = ss.."is below "
            if fromIsCreature then
                ss = ss.."you"
            end
        end
    elseif distance == DISTANCE_CLOSE then
        if level == LEVEL_SAME then
            ss = ss.."is to the"
        elseif level == LEVEL_HIGHER then
            ss = ss.."is on a higher level to the "
        elseif level == LEVEL_LOWER then
            ss = ss.."is on a lower level to the "
        end
    elseif distance == DISTANCE_FAR then
        ss = ss.."is far to the"
    elseif distance == DISTANCE_VERYFAR then
        ss = ss.."is very far to the"
    end
    
    if distance ~= DISTANCE_BESIDE then
        ss = ss.." "
        if direction == DIR_N then
            ss = ss.."north"
        elseif direction == DIR_S then
            ss = ss.."south"
        elseif direction == DIR_E then
            ss = ss.."east"
        elseif direction == DIR_W then
            ss = ss.."west"
        elseif direction == DIR_NE then
            ss = ss.."north-east"
        elseif direction == DIR_NW then
            ss = ss.."north-west"
        elseif direction == DIR_SE then
            ss = ss.."south-east"
        elseif direction == DIR_SW then
            ss = ss.."south-west"
        end
    end
    
    return ss
end
 
function useExiva(cid, pid)
    return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getCreatureName(pid)..getSearchString(getCreaturePosition(cid), getCreaturePosition(pid), true, true))
end

 

 

Postado
  • Autor
1 hora atrás, Naze disse:

Ele está em spells.cpp na source se tiver ela, existe a versão lua feita pelo LukeOake.

  Ocultar conteúdo


function getSearchString(fromPos, toPos, isFromCreature, isToCreature)
    isFromCreature = isFromCreature == nil and false or isFromCreature
    isToCreature = isToCreature == nil and false or isToCreature
    local DISTANCE_CLOSE,DISTANCE_FAR,DISTANCE_VERYFAR = 0,1,2
    local LEVEL_HIGHER,LEVEL_LOWER,LEVEL_SAME = 1,-1,0
    local DIR_N,DIR_S,DIR_E,DIR_W,DIR_NE,DIR_NW,DIR_SE,DIR_SW = 0,1,2,3,4,5,6,7,8
    local distance
    local direction
    local level
    local dx,dy,dz = fromPos.x - toPos.x,fromPos.y - toPos.y,fromPos.z - toPos.z
    
    if dz > 0 then
        level = LEVEL_HIGHER
    elseif dz < 0 then
        level = LEVEL_LOWER
    else
        level = LEVEL_SAME
    end
    
    if math.abs(dx) < 5 and math.abs(dy) < 5 then
        distance = DISTANCE_BESIDE
    else
        tmp = dx * dx + dy * dy
        if tmp < 10000 then
            distance = DISTANCE_CLOSE
        elseif tmp < 75625 then
            distance = DISTANCE_FAR
        else
            distance = DISTANCE_VERYFAR
        end
    end
    
    local tangent
    
    if dx ~= 0 then
        tangent = dy / dx
    else
        tangent = 10.
    end
    
    if math.abs(tangent) < 0.4142 then
        if dx > 0 then
            direction = DIR_W
        else
            direction = DIR_E
        end
    elseif math.abs(tangent) < 2.4142 then
        if tangent > 0 then
            if dy > 0 then
                direction = DIR_NW
            else
                direction = DIR_SE
            end
        else
            if dx > 0 then
                direction = DIR_SW
            else
                direction = DIR_NE
            end
        end
    else
        if dy > 0 then
            direction = DIR_N
        else
            direction = DIR_S
        end
    end
    
    local ss = ""
    
    if distance == DISTANCE_BESIDE then
        if level == LEVEL_SAME then
            ss = ss.."is "
            if toIsCreature then
                ss = ss.."standing "
            end
            
            ss = ss.."next to you"
        elseif level == LEVEL_HIGHER then
            ss = ss.."is above "
            if fromIsCreature then
                ss = ss.."you"
            end
        elseif level == LEVEL_LOWER then
            ss = ss.."is below "
            if fromIsCreature then
                ss = ss.."you"
            end
        end
    elseif distance == DISTANCE_CLOSE then
        if level == LEVEL_SAME then
            ss = ss.."is to the"
        elseif level == LEVEL_HIGHER then
            ss = ss.."is on a higher level to the "
        elseif level == LEVEL_LOWER then
            ss = ss.."is on a lower level to the "
        end
    elseif distance == DISTANCE_FAR then
        ss = ss.."is far to the"
    elseif distance == DISTANCE_VERYFAR then
        ss = ss.."is very far to the"
    end
    
    if distance ~= DISTANCE_BESIDE then
        ss = ss.." "
        if direction == DIR_N then
            ss = ss.."north"
        elseif direction == DIR_S then
            ss = ss.."south"
        elseif direction == DIR_E then
            ss = ss.."east"
        elseif direction == DIR_W then
            ss = ss.."west"
        elseif direction == DIR_NE then
            ss = ss.."north-east"
        elseif direction == DIR_NW then
            ss = ss.."north-west"
        elseif direction == DIR_SE then
            ss = ss.."south-east"
        elseif direction == DIR_SW then
            ss = ss.."south-west"
        end
    end
    
    return ss
end
 
function useExiva(cid, pid)
    return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getCreatureName(pid)..getSearchString(getCreaturePosition(cid), getCreaturePosition(pid), true, true))
end

 

está dando erro na distro, diz assim ''Event on CastSpell not found <data/spells/scripts/support/find_person.lua

 

Postado

O que passei é apenas a função, para usa-la no spells teria q ser de outra forma, ai você poderia usar o que mor3nao falou. Da forma que você tem atual o que você quer que seja feito se não usar tfs 1.3, seria apenas na forma que movie falou, pela sources, então talvez não é um trabalho que qualquer um vai fazer de graça, acho que vou adicionar no meu servidor isso, ai posto aqui mas tenho muito trabalho antes disso então pode tentar por conta, as informações que precisa ja tem.

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo