Ir para conteúdo
  • Cadastre-se

(Resolvido)Colocar distancia na pesca


Ir para solução Resolvido por Vodkart,

Posts Recomendados

Alguém pode me ajudar a colocar distancia de 1 sqm nesse script ?
 

Spoiler

function onUse(cid, item, fromPos, itemEx, toPos)

d0 = 
{
        [0] = {pokemon = 'Caterpie'}, 
        [1] = {pokemon = 'Weedle'}, 
        [2] = {pokemon = 'Paras'}, 
        [3] = {pokemon = 'Caterpie'}, 
        [4] = {pokemon = 'Weedle'}, 
        [5] = {pokemon = 'Paras'}, 
        [6] = {pokemon = 'Pidgey'},

}

d20 = 
{
        [0] = {pokemon = 'Caterpie'}, 
        [1] = {pokemon = 'Weedle'}, 
        [2] = {pokemon = 'Paras'}, 
        [3] = {pokemon = 'Caterpie'}, 
        [4] = {pokemon = 'Weedle'}, 
        [5] = {pokemon = 'Paras'}, 
        [6] = {pokemon = 'Venonat'}, 
        [7] = {pokemon = 'Kakuna'}, 
        [8] = {pokemon = 'Metapod'}, 
        [9] = {pokemon = 'Pidgey'}, 
        [10] = {pokemon = 'Pidgey'}, 
        [11] = {pokemon = 'Mankey'},
        [12] = {pokemon = 'Spearow'},
        [13] = {pokemon = 'Meowth'},
}

d40 = 
{
        [0] = {pokemon = 'Caterpie'}, 
        [1] = {pokemon = 'Weedle'}, 
        [2] = {pokemon = 'Paras'}, 
        [3] = {pokemon = 'Caterpie'}, 
        [4] = {pokemon = 'Weedle'}, 
        [5] = {pokemon = 'Paras'}, 
        [6] = {pokemon = 'Venonat'}, 
        [7] = {pokemon = 'Kakuna'}, 
        [8] = {pokemon = 'Metapod'}, 
        [9] = {pokemon = 'Pidgey'}, 
        [10] = {pokemon = 'Pidgey'}, 
        [11] = {pokemon = 'Venonat'}, 
        [12] = {pokemon = 'Kakuna'}, 
        [13] = {pokemon = 'Metapod'}, 
        [14] = {pokemon = 'Pidgey'}, 
        [15] = {pokemon = 'Mankey'},
        [16] = {pokemon = 'Spearow'},
        [17] = {pokemon = 'Meowth'}, 
        [18] = {pokemon = 'Mankey'},
        [19] = {pokemon = 'Spearow'},
        [20] = {pokemon = 'Meowth'}, 
        [21] = {pokemon = 'Beedrill'}, 
        [22] = {pokemon = 'Butterfree'}, 
        [23] = {pokemon = 'Pidgeotto'},
        [24] = {pokemon = 'Paras'}, 
        
}

d60 = 
{
        [0] = {pokemon = 'Caterpie'}, 
        [1] = {pokemon = 'Weedle'}, 
        [2] = {pokemon = 'Paras'}, 
        [3] = {pokemon = 'Caterpie'}, 
        [4] = {pokemon = 'Weedle'}, 
        [5] = {pokemon = 'Paras'}, 
        [6] = {pokemon = 'Venonat'}, 
        [7] = {pokemon = 'Kakuna'}, 
        [8] = {pokemon = 'Metapod'}, 
        [9] = {pokemon = 'Pidgey'}, 
        [10] = {pokemon = 'Pidgey'}, 
        [11] = {pokemon = 'Venonat'}, 
        [12] = {pokemon = 'Kakuna'}, 
        [13] = {pokemon = 'Metapod'}, 
        [14] = {pokemon = 'Pidgey'}, 
        [15] = {pokemon = 'Mankey'},
        [16] = {pokemon = 'Spearow'},
        [17] = {pokemon = 'Meowth'}, 
        [18] = {pokemon = 'Mankey'},
        [19] = {pokemon = 'Spearow'},
        [20] = {pokemon = 'Meowth'}, 
        [21] = {pokemon = 'Beedrill'}, 
        [22] = {pokemon = 'Butterfree'},
        [23] = {pokemon = 'Pidgeotto'}, 
        [24] = {pokemon = 'Paras'}, 
        [25] = {pokemon = 'Farfetchd'},
        [26] = {pokemon = 'Fearow'},
        [27] = {pokemon = 'Venomoth'},
        [28] = {pokemon = 'Butterfree'},
        [29] = {pokemon = 'Pidgeotto'},
        [30] = {pokemon = 'Meowth'},  
}

d80 = 
{
        [0] = {pokemon = 'Caterpie'}, 
        [1] = {pokemon = 'Weedle'}, 
        [2] = {pokemon = 'Paras'}, 
        [3] = {pokemon = 'Caterpie'}, 
        [4] = {pokemon = 'Weedle'}, 
        [5] = {pokemon = 'Paras'}, 
        [6] = {pokemon = 'Venonat'}, 
        [7] = {pokemon = 'Kakuna'}, 
        [8] = {pokemon = 'Metapod'}, 
        [9] = {pokemon = 'Pidgey'}, 
        [10] = {pokemon = 'Pidgey'}, 
        [11] = {pokemon = 'Venonat'}, 
        [12] = {pokemon = 'Kakuna'}, 
        [13] = {pokemon = 'Metapod'}, 
        [14] = {pokemon = 'Pidgey'}, 
        [15] = {pokemon = 'Mankey'},
        [16] = {pokemon = 'Spearow'},
        [17] = {pokemon = 'Meowth'}, 
        [18] = {pokemon = 'Mankey'},
        [19] = {pokemon = 'Spearow'},
        [20] = {pokemon = 'Meowth'}, 
        [21] = {pokemon = 'Beedrill'}, 
        [22] = {pokemon = 'Butterfree'},
        [23] = {pokemon = 'Pidgeotto'}, 
        [24] = {pokemon = 'Paras'}, 
        [25] = {pokemon = 'Farfetchd'},
        [26] = {pokemon = 'Fearow'},
        [27] = {pokemon = 'Venomoth'},
        [28] = {pokemon = 'Butterfree'},
        [29] = {pokemon = 'Pidgeotto'},
        [30] = {pokemon = 'Meowth'},  
        [31] = {pokemon = 'Pinsir'}, 
        [32] = {pokemon = 'Beedrill'}, 
        [33] = {pokemon = 'Venomoth'}, 
        [34] = {pokemon = 'Fearow'}, 
        [35] = {pokemon = 'Paras'},
        [36] = {pokemon = 'Butterfree'},
        [37] = {pokemon = 'Beedrill'},
        [38] = {pokemon = 'Venonat'},
}

d100 = 
{       
        [0] = {pokemon = 'Caterpie'}, 
        [1] = {pokemon = 'Weedle'}, 
        [2] = {pokemon = 'Paras'}, 
        [3] = {pokemon = 'Caterpie'}, 
        [4] = {pokemon = 'Weedle'}, 
        [5] = {pokemon = 'Paras'}, 
        [6] = {pokemon = 'Venonat'}, 
        [7] = {pokemon = 'Kakuna'}, 
        [8] = {pokemon = 'Metapod'}, 
        [9] = {pokemon = 'Pidgey'}, 
        [10] = {pokemon = 'Pidgey'}, 
        [11] = {pokemon = 'Venonat'}, 
        [12] = {pokemon = 'Kakuna'}, 
        [13] = {pokemon = 'Metapod'}, 
        [14] = {pokemon = 'Pidgey'}, 
        [15] = {pokemon = 'Mankey'},
        [16] = {pokemon = 'Spearow'},
        [17] = {pokemon = 'Meowth'}, 
        [18] = {pokemon = 'Mankey'},
        [19] = {pokemon = 'Spearow'},
        [20] = {pokemon = 'Meowth'}, 
        [21] = {pokemon = 'Beedrill'}, 
        [22] = {pokemon = 'Butterfree'},
        [23] = {pokemon = 'Pidgeotto'}, 
        [24] = {pokemon = 'Paras'}, 
        [25] = {pokemon = 'Farfetchd'},
        [26] = {pokemon = 'Fearow'},
        [27] = {pokemon = 'Venomoth'},
        [28] = {pokemon = 'Butterfree'},
        [29] = {pokemon = 'Pidgeotto'},
        [30] = {pokemon = 'Meowth'},  
        [31] = {pokemon = 'Pinsir'}, 
        [32] = {pokemon = 'Beedrill'}, 
        [33] = {pokemon = 'Venomoth'}, 
        [34] = {pokemon = 'Fearow'}, 
        [35] = {pokemon = 'Paras'},
        [36] = {pokemon = 'Butterfree'},
        [37] = {pokemon = 'Beedrill'},
        [38] = {pokemon = 'Venonat'},
        [39] = {pokemon = 'Pidgeot'},
        [40] = {pokemon = 'Venomoth'},
        [41] = {pokemon = 'Butterfree'},
        [42] = {pokemon = 'Scyther'},

}
        local config = {
        waters = {2711},
}

local skill = getPlayerSkillLevel(cid, 5)
local playerpos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}

        if(isInArray(config.waters, itemEx.itemid)) then
                doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)
                doPlayerAddSkillTry(cid, 5, 1)

                        if skill >= 100 then
                                local random = math.random(0, 80)
                                if random <= 42 then
                                        doSummonCreature(d100[random].pokemon, playerpos)
                                        return true
                                end
                        else
                        if skill >= 80 then
                                local random = math.random(0, 80)
                                if random <= 38 then
                                        doSummonCreature(d80[random].pokemon, playerpos)
                                        return true
                                end
                        else
                        if skill >= 60 then
                                local random = math.random(0, 80)
                                if random <= 30 then
                                        doSummonCreature(d60[random].pokemon, playerpos)
                                        return true
                                end
                        else
                        if skill >= 40 then
                                local random = math.random(0, 80)
                                if random <= 24 then
                                        doSummonCreature(d40[random].pokemon, playerpos)
                                        return true
                                end
                        else
                        if skill >= 20 then
                                local random = math.random(0, 80)
                                if random <= 13 then
                                        doSummonCreature(d20[random].pokemon, playerpos)
                                        return true
                                end
                        else
                        if skill >= 0 and skill < 20 then
                                local random = math.random(0, 80)
                                if random <= 6 then
                                        doSummonCreature(d0[random].pokemon, playerpos)
                                        return true
                                end
                                return true
                        end
                return true
        end
        return true
end
end
end
end
end
end


 

 

  •               6oI4lwi.gif
  • FusionPoké Estará aberto este mês para testes !
  • Curta A Page e Fique Por Dentro Das Novidades Do Servidor!   Like Aqui!
  •                         qNmeLvu.png
Link para o post
Compartilhar em outros sites

@J.L Coloca essa tag no items.xml dentro do item 

        <attribute key="range" value="1" />

Editado por Makhai Drakon (veja o histórico de edições)

Ajudei? REP+

 

Meus Servers:

PokeUnwind Em Breve

Rust Tibia Fechado

 

Tópicos: 

[Tutorial] Adicionando Pokemons com icon system

[Solução] ElfBot não abre corpos

 

Projetos:

DigiTibia Fechado

Rust Tibia Fechado(temporariamente!)

Link para o post
Compartilhar em outros sites

ainda continua dando pra usar de longe ;-; 

  •               6oI4lwi.gif
  • FusionPoké Estará aberto este mês para testes !
  • Curta A Page e Fique Por Dentro Das Novidades Do Servidor!   Like Aqui!
  •                         qNmeLvu.png
Link para o post
Compartilhar em outros sites

.

Spoiler

function onUse(cid, item, fromPos, itemEx, toPos)
if getDistanceBetween(fromPos, toPos) > 2 then return false end
d0 = 
{
        [0] = {pokemon = 'Caterpie'}, 
        [1] = {pokemon = 'Weedle'}, 
        [2] = {pokemon = 'Paras'}, 
        [3] = {pokemon = 'Caterpie'}, 
        [4] = {pokemon = 'Weedle'}, 
        [5] = {pokemon = 'Paras'}, 
        [6] = {pokemon = 'Pidgey'},

}

d20 = 
{
        [0] = {pokemon = 'Caterpie'}, 
        [1] = {pokemon = 'Weedle'}, 
        [2] = {pokemon = 'Paras'}, 
        [3] = {pokemon = 'Caterpie'}, 
        [4] = {pokemon = 'Weedle'}, 
        [5] = {pokemon = 'Paras'}, 
        [6] = {pokemon = 'Venonat'}, 
        [7] = {pokemon = 'Kakuna'}, 
        [8] = {pokemon = 'Metapod'}, 
        [9] = {pokemon = 'Pidgey'}, 
        [10] = {pokemon = 'Pidgey'}, 
        [11] = {pokemon = 'Mankey'},
        [12] = {pokemon = 'Spearow'},
        [13] = {pokemon = 'Meowth'},
}

d40 = 
{
        [0] = {pokemon = 'Caterpie'}, 
        [1] = {pokemon = 'Weedle'}, 
        [2] = {pokemon = 'Paras'}, 
        [3] = {pokemon = 'Caterpie'}, 
        [4] = {pokemon = 'Weedle'}, 
        [5] = {pokemon = 'Paras'}, 
        [6] = {pokemon = 'Venonat'}, 
        [7] = {pokemon = 'Kakuna'}, 
        [8] = {pokemon = 'Metapod'}, 
        [9] = {pokemon = 'Pidgey'}, 
        [10] = {pokemon = 'Pidgey'}, 
        [11] = {pokemon = 'Venonat'}, 
        [12] = {pokemon = 'Kakuna'}, 
        [13] = {pokemon = 'Metapod'}, 
        [14] = {pokemon = 'Pidgey'}, 
        [15] = {pokemon = 'Mankey'},
        [16] = {pokemon = 'Spearow'},
        [17] = {pokemon = 'Meowth'}, 
        [18] = {pokemon = 'Mankey'},
        [19] = {pokemon = 'Spearow'},
        [20] = {pokemon = 'Meowth'}, 
        [21] = {pokemon = 'Beedrill'}, 
        [22] = {pokemon = 'Butterfree'}, 
        [23] = {pokemon = 'Pidgeotto'},
        [24] = {pokemon = 'Paras'}, 
        
}

d60 = 
{
        [0] = {pokemon = 'Caterpie'}, 
        [1] = {pokemon = 'Weedle'}, 
        [2] = {pokemon = 'Paras'}, 
        [3] = {pokemon = 'Caterpie'}, 
        [4] = {pokemon = 'Weedle'}, 
        [5] = {pokemon = 'Paras'}, 
        [6] = {pokemon = 'Venonat'}, 
        [7] = {pokemon = 'Kakuna'}, 
        [8] = {pokemon = 'Metapod'}, 
        [9] = {pokemon = 'Pidgey'}, 
        [10] = {pokemon = 'Pidgey'}, 
        [11] = {pokemon = 'Venonat'}, 
        [12] = {pokemon = 'Kakuna'}, 
        [13] = {pokemon = 'Metapod'}, 
        [14] = {pokemon = 'Pidgey'}, 
        [15] = {pokemon = 'Mankey'},
        [16] = {pokemon = 'Spearow'},
        [17] = {pokemon = 'Meowth'}, 
        [18] = {pokemon = 'Mankey'},
        [19] = {pokemon = 'Spearow'},
        [20] = {pokemon = 'Meowth'}, 
        [21] = {pokemon = 'Beedrill'}, 
        [22] = {pokemon = 'Butterfree'},
        [23] = {pokemon = 'Pidgeotto'}, 
        [24] = {pokemon = 'Paras'}, 
        [25] = {pokemon = 'Farfetchd'},
        [26] = {pokemon = 'Fearow'},
        [27] = {pokemon = 'Venomoth'},
        [28] = {pokemon = 'Butterfree'},
        [29] = {pokemon = 'Pidgeotto'},
        [30] = {pokemon = 'Meowth'},  
}

d80 = 
{
        [0] = {pokemon = 'Caterpie'}, 
        [1] = {pokemon = 'Weedle'}, 
        [2] = {pokemon = 'Paras'}, 
        [3] = {pokemon = 'Caterpie'}, 
        [4] = {pokemon = 'Weedle'}, 
        [5] = {pokemon = 'Paras'}, 
        [6] = {pokemon = 'Venonat'}, 
        [7] = {pokemon = 'Kakuna'}, 
        [8] = {pokemon = 'Metapod'}, 
        [9] = {pokemon = 'Pidgey'}, 
        [10] = {pokemon = 'Pidgey'}, 
        [11] = {pokemon = 'Venonat'}, 
        [12] = {pokemon = 'Kakuna'}, 
        [13] = {pokemon = 'Metapod'}, 
        [14] = {pokemon = 'Pidgey'}, 
        [15] = {pokemon = 'Mankey'},
        [16] = {pokemon = 'Spearow'},
        [17] = {pokemon = 'Meowth'}, 
        [18] = {pokemon = 'Mankey'},
        [19] = {pokemon = 'Spearow'},
        [20] = {pokemon = 'Meowth'}, 
        [21] = {pokemon = 'Beedrill'}, 
        [22] = {pokemon = 'Butterfree'},
        [23] = {pokemon = 'Pidgeotto'}, 
        [24] = {pokemon = 'Paras'}, 
        [25] = {pokemon = 'Farfetchd'},
        [26] = {pokemon = 'Fearow'},
        [27] = {pokemon = 'Venomoth'},
        [28] = {pokemon = 'Butterfree'},
        [29] = {pokemon = 'Pidgeotto'},
        [30] = {pokemon = 'Meowth'},  
        [31] = {pokemon = 'Pinsir'}, 
        [32] = {pokemon = 'Beedrill'}, 
        [33] = {pokemon = 'Venomoth'}, 
        [34] = {pokemon = 'Fearow'}, 
        [35] = {pokemon = 'Paras'},
        [36] = {pokemon = 'Butterfree'},
        [37] = {pokemon = 'Beedrill'},
        [38] = {pokemon = 'Venonat'},
}

d100 = 
{       
        [0] = {pokemon = 'Caterpie'}, 
        [1] = {pokemon = 'Weedle'}, 
        [2] = {pokemon = 'Paras'}, 
        [3] = {pokemon = 'Caterpie'}, 
        [4] = {pokemon = 'Weedle'}, 
        [5] = {pokemon = 'Paras'}, 
        [6] = {pokemon = 'Venonat'}, 
        [7] = {pokemon = 'Kakuna'}, 
        [8] = {pokemon = 'Metapod'}, 
        [9] = {pokemon = 'Pidgey'}, 
        [10] = {pokemon = 'Pidgey'}, 
        [11] = {pokemon = 'Venonat'}, 
        [12] = {pokemon = 'Kakuna'}, 
        [13] = {pokemon = 'Metapod'}, 
        [14] = {pokemon = 'Pidgey'}, 
        [15] = {pokemon = 'Mankey'},
        [16] = {pokemon = 'Spearow'},
        [17] = {pokemon = 'Meowth'}, 
        [18] = {pokemon = 'Mankey'},
        [19] = {pokemon = 'Spearow'},
        [20] = {pokemon = 'Meowth'}, 
        [21] = {pokemon = 'Beedrill'}, 
        [22] = {pokemon = 'Butterfree'},
        [23] = {pokemon = 'Pidgeotto'}, 
        [24] = {pokemon = 'Paras'}, 
        [25] = {pokemon = 'Farfetchd'},
        [26] = {pokemon = 'Fearow'},
        [27] = {pokemon = 'Venomoth'},
        [28] = {pokemon = 'Butterfree'},
        [29] = {pokemon = 'Pidgeotto'},
        [30] = {pokemon = 'Meowth'},  
        [31] = {pokemon = 'Pinsir'}, 
        [32] = {pokemon = 'Beedrill'}, 
        [33] = {pokemon = 'Venomoth'}, 
        [34] = {pokemon = 'Fearow'}, 
        [35] = {pokemon = 'Paras'},
        [36] = {pokemon = 'Butterfree'},
        [37] = {pokemon = 'Beedrill'},
        [38] = {pokemon = 'Venonat'},
        [39] = {pokemon = 'Pidgeot'},
        [40] = {pokemon = 'Venomoth'},
        [41] = {pokemon = 'Butterfree'},
        [42] = {pokemon = 'Scyther'},

}
        local config = {
        waters = {2711},
}

local skill = getPlayerSkillLevel(cid, 5)
local playerpos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}

        if(isInArray(config.waters, itemEx.itemid)) then
                doSendMagicEffect(toPos, CONST_ME_LOSEENERGY)
                doPlayerAddSkillTry(cid, 5, 1)

                        if skill >= 100 then
                                local random = math.random(0, 80)
                                if random <= 42 then
                                        doSummonCreature(d100[random].pokemon, playerpos)
                                        return true
                                end
                        else
                        if skill >= 80 then
                                local random = math.random(0, 80)
                                if random <= 38 then
                                        doSummonCreature(d80[random].pokemon, playerpos)
                                        return true
                                end
                        else
                        if skill >= 60 then
                                local random = math.random(0, 80)
                                if random <= 30 then
                                        doSummonCreature(d60[random].pokemon, playerpos)
                                        return true
                                end
                        else
                        if skill >= 40 then
                                local random = math.random(0, 80)
                                if random <= 24 then
                                        doSummonCreature(d40[random].pokemon, playerpos)
                                        return true
                                end
                        else
                        if skill >= 20 then
                                local random = math.random(0, 80)
                                if random <= 13 then
                                        doSummonCreature(d20[random].pokemon, playerpos)
                                        return true
                                end
                        else
                        if skill >= 0 and skill < 20 then
                                local random = math.random(0, 80)
                                if random <= 6 then
                                        doSummonCreature(d0[random].pokemon, playerpos)
                                        return true
                                end
                                return true
                        end
                return true
        end
        return true
end
end
end
end
end
end

 

 

Editado por DboExplorer (veja o histórico de edições)

 

Te ajudei ?? Que tal fazer uma contribuição ?

Doar

Link para o post
Compartilhar em outros sites

@DboExplorer Assim não da pra usar o item :/

  •               6oI4lwi.gif
  • FusionPoké Estará aberto este mês para testes !
  • Curta A Page e Fique Por Dentro Das Novidades Do Servidor!   Like Aqui!
  •                         qNmeLvu.png
Link para o post
Compartilhar em outros sites

@J.L Desculpe, daqui a pouco dou uma olhada melhor no script, o range que eu te passei ele funciona para ataques, tava na esperança de funcionar como range de use também, calma aí que Jajá resolvo

Ajudei? REP+

 

Meus Servers:

PokeUnwind Em Breve

Rust Tibia Fechado

 

Tópicos: 

[Tutorial] Adicionando Pokemons com icon system

[Solução] ElfBot não abre corpos

 

Projetos:

DigiTibia Fechado

Rust Tibia Fechado(temporariamente!)

Link para o post
Compartilhar em outros sites
  • Solução
9 horas atrás, DboExplorer disse:

editei testa novamente

 

 

coloca assim:

 

local Range = 1
	if getDistanceBetween(getCreaturePosition(cid), toPos) > Range then
	 	return true 	
	end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
10 horas atrás, DboExplorer disse:

editei testa novamente

 

@Makhai Drakon continua não pegando o item

1 hora atrás, Vodkart disse:

 

coloca assim:

 


local Range = 1
	if getDistanceBetween(getCreaturePosition(cid), toPos) > Range then
	 	return true 	
	end

@Vodkart Funcionou perfeitamente!!!


Agradeço a todos pelo suporte e a atenção!!!

 

 

  •               6oI4lwi.gif
  • FusionPoké Estará aberto este mês para testes !
  • Curta A Page e Fique Por Dentro Das Novidades Do Servidor!   Like Aqui!
  •                         qNmeLvu.png
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.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo