Ir para conteúdo
  • Cadastre-se

Derivado Como mudo o catch do Pokemon Centurion V5


Posts Recomendados

Olá, gente!

Eu estou com um problema na hora de tentar mudar o rate do catch:

 

local ballcatch = {
[2394] = {cr = 40, on = 24, off = 23, ball = 11826, send = 47}, --normal ball
[2391] = {cr = 50, on = 198, off = 197, ball = 11832, send = 48}, --great ball
[2393] = {cr = 60, on = 202, off = 201, ball = 11835, send = 46}, --super ball
[2392] = {cr = 70, on = 200, off = 199, ball = 11829, send = 49}, --ultra ball
[556] = {cr = 80, on = 187, off = 176, ball = 554, send = 45}, --master ball
}

 

Killa_gasmask_and_a_gun_by_syosa-d2zahuw.gif.42316ba954470ed0e48b7898a30fa4e2.gifAlla_gasmask_and_a_gun_by_syosa-d2zahuw.gif.42316ba954470ed0e48b7898a30fa4e2.gifThea_gasmask_and_a_gun_by_syosa-d2zahuw.gif.42316ba954470ed0e48b7898a30fa4e2.gifZombies

Link para o post
Compartilhar em outros sites
8 minutos atrás, Noob II disse:

Poste aqui o arquivo catch.lua da pasta data/actions/scripts

local ballcatch = {
[2394] = {cr = 40, on = 24, off = 23, ball = 11826, send = 47}, --normal ball
[2391] = {cr = 50, on = 198, off = 197, ball = 11832, send = 48}, --great ball
[2393] = {cr = 60, on = 202, off = 201, ball = 11835, send = 46}, --super ball
[2392] = {cr = 70, on = 200, off = 199, ball = 11829, send = 49}, --ultra ball
[556] = {cr = 80, on = 187, off = 176, ball = 554, send = 45}, --master ball
}

function onUse(cid, item, frompos, item3, topos)

local item2 = getTopCorpse(topos)
	if item2 == null then
	return true
	end

if getItemAttribute(item2.uid, "catching") == 1 then
return true
end

local name = string.lower(getItemNameById(item2.itemid))
name = string.gsub(name, "fainted ", "")
name = string.gsub(name, "defeated ", "")

	local x = pokecatches[doCorrectPokemonName(name)]

	if not x then return true end

		local owner = getItemAttribute(item2.uid, "corpseowner")
	
		if owner and isCreature(owner) and isPlayer(owner) and cid ~= owner and isInArray({1,9}, getPlayerGroupId(cid)) then
		doPlayerSendCancel(cid, "Você não pode capturar este pokemon.")
		return true
		end

	local catchinfo = {}
		catchinfo.rate = ballcatch[item.itemid].cr
		catchinfo.catch = ballcatch[item.itemid].on
		catchinfo.fail = ballcatch[item.itemid].off
		catchinfo.newid = ballcatch[item.itemid].ball
		catchinfo.name = doCorrectPokemonName(name)
		catchinfo.topos = topos
		catchinfo.chance = x.chance

		doSendDistanceShoot(getThingPos(cid), topos, ballcatch[item.itemid].send)
		doRemoveItem(item.uid, 1)

		local d = getDistanceBetween(getThingPos(cid), topos)

		addEvent(doSendPokeBall, d * 70 + 100 - (d * 14) , cid, catchinfo, false, false)
		addEvent(doSendMagicEffect, (d * 70 + 100 - (d * 14)) - 100, topos, 3)

return true
end

 

Killa_gasmask_and_a_gun_by_syosa-d2zahuw.gif.42316ba954470ed0e48b7898a30fa4e2.gifAlla_gasmask_and_a_gun_by_syosa-d2zahuw.gif.42316ba954470ed0e48b7898a30fa4e2.gifThea_gasmask_and_a_gun_by_syosa-d2zahuw.gif.42316ba954470ed0e48b7898a30fa4e2.gifZombies

Link para o post
Compartilhar em outros sites

@citizen

muda isso

local ballcatch = {
[2394] = {cr = 40, on = 24, off = 23, ball = 11826, send = 47}, --normal ball
[2391] = {cr = 50, on = 198, off = 197, ball = 11832, send = 48}, --great ball
[2393] = {cr = 60, on = 202, off = 201, ball = 11835, send = 46}, --super ball
[2392] = {cr = 70, on = 200, off = 199, ball = 11829, send = 49}, --ultra ball
[556] = {cr = 80, on = 187, off = 176, ball = 554, send = 45}, --master ball
}

por isso
 

local ballcatch = {
[2394] = {cr = 40, on = 24, off = 23, ball = 11826, send = 47}, --normal ball
[2391] = {cr = 50, on = 198, off = 197, ball = 11832, send = 48}, --great ball
[2393] = {cr = 60, on = 202, off = 201, ball = 11835, send = 46}, --super ball
[2392] = {cr = 70, on = 200, off = 199, ball = 11829, send = 49}, --ultra ball
[556] = {cr = 80, on = 187, off = 176, ball = 554, send = 45} --master ball
}

 

Link para o post
Compartilhar em outros sites
local ballcatch = {                    --id normal, id da ball shiy
[2394] = {cr = 3, on = 24, off = 23, ball = {11826, 11737}, send = 47, typeee = "normal"},  --alterado v2.9  \/
[2391] = {cr = 6, on = 198, off = 197, ball = {11832, 11740}, send = 48, typeee = "great"},
[2393] = {cr = 10, on = 202, off = 201, ball = {11835, 11743}, send = 46, typeee = "super"},
[2392] = {cr = 15, on = 200, off = 199, ball = {11829, 11746}, send = 49, typeee = "ultra"},
}

function onUse(cid, item, frompos, item3, topos)

local item2 = getTopCorpse(topos)
if item2 == null then
	return true
end

if getItemAttribute(item2.uid, "catching") == 1 then
   return true
end

if getItemAttribute(item2.uid, "golden") and getItemAttribute(item2.uid, "golden") == 1 then
   return doPlayerSendCancel(cid, "You can't try to catch a pokemon in the Golden Arena!")   --alterado v2.6
end

local name = string.lower(getItemNameById(item2.itemid))  --alterado v2.9 \/
      name = string.gsub(name, "fainted ", "")
      name = string.gsub(name, "defeated ", "")
      name = doCorrectPokemonName(name)
local x = pokecatches[name]
	

local storage = newpokedex[doCorrectPokemonName(name)].stoCatch            --alterado v2.9 \/
if getPlayerStorageValue(cid, storage) == -1 or not string.find(getPlayerStorageValue(cid, storage), ";") then  
   setPlayerStorageValue(cid, storage, "normal = 0, great = 0, super = 0, ultra = 0, saffari = 0;")              
end    
    
if not x then return true end

local owner = getItemAttribute(item2.uid, "corpseowner")
	
if owner and isCreature(owner) and isPlayer(owner) and cid ~= owner then  --alterado v2.5
   doPlayerSendCancel(cid, "You are not allowed to catch this pokemon.")
   return true
end

local newidd = isShinyName(name) and ballcatch[item.itemid].ball[2] or ballcatch[item.itemid].ball[1] --alterado v2.9       
local typeee = ballcatch[item.itemid].typeee
       
local catchinfo = {}
		catchinfo.rate = ballcatch[item.itemid].cr
		catchinfo.catch = ballcatch[item.itemid].on
		catchinfo.fail = ballcatch[item.itemid].off
		catchinfo.newid = newidd                      
		catchinfo.name = doCorrectPokemonName(name)
		catchinfo.topos = topos
		catchinfo.chance = x.chance

doSendDistanceShoot(getThingPos(cid), topos, ballcatch[item.itemid].send)
doRemoveItem(item.uid, 1)

local d = getDistanceBetween(getThingPos(cid), topos)
                                              
if getPlayerStorageValue(cid, 98796) >= 1 and getPlayerItemCount(cid, 12617) <= 0 then --alterado v2.9 
   setPlayerStorageValue(cid, 98796, -1) 
   setPlayerStorageValue(cid, 98797, -1)                                              
   doTeleportThing(cid, SafariOut, false)
   doSendMagicEffect(getThingPos(cid), 21)
   doPlayerSendTextMessage(cid, 27, "You spend all your 'saffari balls', good luck in the next time...")
end
        
addEvent(doSendPokeBall, d * 70 + 100 - (d * 14) , cid, catchinfo, false, false, typeee)
addEvent(doSendMagicEffect, (d * 70 + 100 - (d * 14)) - 100, topos, 3)
return true
end

 

Editado por Noob II (veja o histórico de edições)
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 LeoTK
      Salve galera neste tópico irei postar algumas prints do mapa do servidor para quem queira acompanhar e quem sabe até utilizar de inspiração para mapear o seu NTO.
       
      #Att 11/08/2022

       
       
       
       
      Konoha (Em Desenvolvimento)
       
       
       
       
    • Por DiigooMix
      Como o título já diz, será que alguém possui sprite do hitto e se possível as transformações dele?
    • Por OmegaZero
      Olá gostaria que alguém me ajudasse com uma "scripting" não sei se é pela mesma, seria o seguinte uma determinada arma teria a chance de dar double hit e não sei oque fazer alguem poderia ajudar?

      OBS:não sei se é o local correto se não for mova, desculpe
    • Por Madarasenju
      Olá galera do Tibia King, queria por uns npc's no meu server que não tem função de trade nem nada do tipo, queria que eles só andassem como enfeite, Rep+ Pra quem me ajudar... grato desde já.
    • Por SilenceRoot
      A magia é assim o você usa a a magia e ela ficará ativado por 10 segundos, até que o inimigo lance a primeira magia ou todos de uma vez, quando ele lançar a primeira magia, ele não lhe acertará ou seja esquivando dela, e logo em seguida será teletransportado aleatoriamente ao redor do inimigo que usou.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo