Ir para conteúdo

Featured Replies

Postado

Teria como colocar pra quando eu der catch em um pokemon ele já vir com boost +20 na ball? 

Distro 8.54

Rep pra quem ajudar. ^^

 

Script:

Spoiler

local ballcatch = {                    --id normal, id da ball shiy

[8195] = {cr = 99999999, on = 194, off = 23, ball = {8193, 8196}, send = 31, typeee = "dark"},  
}

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!")   
end

local name = string.lower(getItemNameById(item2.itemid))
      name = string.gsub(name, "fainted ", "")
      name = string.gsub(name, "defeated ", "")
      name = doCorrectPokemonName(name)
local x = pokecatches[name]

if not x then return true end
	
local storage = newpokedex[name].stoCatch 
if getPlayerStorageValue(cid, storage) == -1 or not string.find(getPlayerStorageValue(cid, storage), ";") then  --alterado v1.9 
   setPlayerStorageValue(cid, storage, "dark = 0;")             --alterado v1.9 
end     

local owner = getItemAttribute(item2.uid, "corpseowner")
	
if owner and isCreature(owner) and isPlayer(owner) and cid ~= owner then   
   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 v1.9       
local typeee = ballcatch[item.itemid].typeee
local catch_rate = isPremium(cid) and ballcatch[item.itemid].cr + 2 or ballcatch[item.itemid].cr

	
local catchinfo = {}
      catchinfo.rate = catch_rate
      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 v1.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

 

 

 

 

Resolvido por Featzen

Ir para solução
  • 2 weeks later...
Postado
  • Solução

Arquivo errado. É no "data/lib/catch system.lua".

 

Em baixo de:

doItemSetAttribute(item, "poke", poke)

Adiciona:

if typeee == "dark" then
	doItemSetAttribute(item, 'boost', 20)
end

 

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

Postado
  • Autor
15 horas atrás, Featzen disse:

Arquivo errado. É no "data/lib/catch system.lua".

 

Em baixo de:


doItemSetAttribute(item, "poke", poke)

Adiciona:


if typeee == "dark" then
	doItemSetAttribute(item, 'boost', 20)
end

 

Amigo obg por ajudar testado e 100%, muito simples e eu aqui inventando coisas tipo:

Spoiler

if (cid, poke, typeee, dark) then
doItemSetAttribute(item, 'boost', 20)
return true
end

Rep+ Grato ^^ 

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

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.

Estatísticas dos Fóruns

  • Tópicos 96k
  • Posts 512.7k

Informação Importante

Confirmação de Termo