Ir para conteúdo
  • Cadastre-se

Programação Master ball nao pegar pokemons megas


Posts Recomendados

Galera bom dia,estou pra lançar alguns megas no meu servidor, e  nao sera por mega stone e sim por aleatorio, porem a master ball vai ser capaz de pegar eles, eu ja retirei pra ela pegar pokes shinys, porem queria colocar pra nao pegar megas...alguem me ajuda pfv?

 


local ballcatch = {                    --id normal, id da ball shiy
[2394] = {cr = 6, on = 193, off = 192, ball = {11826, 11737}, send = 47, typeee = "poke", boost = "0"},  --alterado v1.9  \/
[2391] = {cr = 7, on = 198, off = 197, ball = {11832, 11740}, send = 48, typeee = "great", boost = "0"},
[2393] = {cr = 9, on = 202, off = 201, ball = {11835, 11743}, send = 46, typeee = "super", boost = "0"},
[2392] = {cr = 13, on = 200, off = 199, ball = {11829, 11746}, send = 49, typeee = "ultra", boost = "0"},
[12617] = {cr = 11, on = 204, off = 203, ball = {10975, 12621}, send = 35, typeee = "saffari", boost = "0"}, 
[12832] = {cr = 100000, on = 23, off = 24, ball = {12826, 12829}, send = 181, typeee = "master", boost = "15"},


[15677] = {cr = 16, on = 313, off = 314, ball = {16181, 16204}, send = 72, typeee = "magu", boost = "0", type = {"fire", "ground"}},
[15676] = {cr = 16, on = 316, off = 317, ball = {16182, 16205}, send = 73, typeee = "sora", boost = "0", type = {"ice", "flying"}},
[15678] = {cr = 16, on = 320, off = 321, ball = {16183, 16206}, send = 74, typeee = "yume", boost = "0", type = {"normal", "psychic"}},
[15680] = {cr = 16, on = 322, off = 323, ball = {16184, 16207}, send = 75, typeee = "dusk", boost = "0", type = {"rock", "fighting"}},
[15673] = {cr = 16, on = 331, off = 332, ball = {16187, 16210}, send = 78, typeee = "tale", boost = "0", type = {"dragon", "fairy"}},
[15674] = {cr = 16, on = 334, off = 335, ball = {16188, 16211}, send = 79, typeee = "moon", boost = "0", type = {"dark", "ghost"}},
[15675] = {cr = 16, on = 337, off = 338, ball = {16189, 16212}, send = 80, typeee = "net", boost = "0", type = {"bug", "water"}},
[15679] = {cr = 16, on = 343, off = 344, ball = {16191, 16214}, send = 82, typeee = "premier", boost = "0", type = {"grass", "poison"}},
[15681] = {cr = 16, on = 346, off = 347, ball = {16192, 16215}, send = 83, typeee = "tinker", boost = "0", type = {"electric", "steel"}},


[15682] = {cr = 18, on = 325, off = 326, ball = {16185, 16208}, send = 76, typeee = "fast", boost = "0", pokes = {"Pikachu", "Raichu"}},
[15672] = {cr = 18, on = 328, off = 329, ball = {16186, 16209}, send = 77, typeee = "heavy", boost = "0", pokes = {"Snorlax", "Venusaur"}},
}

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(getItemAttribute(item2.uid, "pokeName"))
      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 type(getPlayerStorageValue(cid, storage)) ~= "string" or not string.find(getPlayerStorageValue(cid, storage), "magu") then  --alterado v1.9 
   setPlayerStorageValue(cid, storage, "normal = 0, great = 0, super = 0, ultra = 0, saffari = 0, dark = 0, magu = 0, sora = 0, yume = 0, dusk = 0, tale = 0, moon = 0, net = 0, premier = 0, tinker = 0, fast = 0, heavy = 0;")             --alterado v1.9 
end  

local owner = getItemAttribute(item2.uid, "corpseowner")
local pOwner = getPlayerByName(owner)
local isInParyWithPlayer = false
      if isInParty(cid) and isInParty(pOwner) then
         isInParyWithPlayer = isPartyEquals(pOwner, cid)
      end
if owner and isCreature(pOwner) and isPlayer(pOwner) and cid ~= pOwner and not isInParyWithPlayer then   
   doPlayerSendCancel(cid, "Desculpa Isso não é possivel.")
   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 boost = ballcatch[item.itemid].boost    

    local catchBlocks = {"Shiny Snorlax", "Aerodactyl"}
    if isInArray(catchBlocks, name) then
        doSendMsg(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 = newidd                      
      catchinfo.name = doCorrectPokemonName(name)
      catchinfo.topos = topos
      catchinfo.chance = x.chance
      
      
    doBrokesCount(cid, newpokedex[doCorrectPokemonName(name)].stoCatch , typeee)

    doSendDistanceShoot(getThingPos(cid), topos, ballcatch[item.itemid].send)
    doRemoveItem(item.uid, 1)
    
    ---- newsBalls
    if (ballcatch[item.itemid].type ~= nil or ballcatch[item.itemid].pokes ~= nil)  then
       catchinfo.rate = getBallsRate(catchinfo.name, item.itemid)
    end
    
    --if isGod(cid) then catchinfo.rate = 100000 end 

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

function getBallsRate(name, id)
    if pokes[name] then
       if isInArray(ballcatch[id].type, pokes[name].type) or isInArray(ballcatch[id].type, pokes[name].type2) or isInArray(ballcatch[id].pokes, name) then
          return 16
       end
    end
    return 13
end

 

Obrigado desde ja.

2 minutos atrás, Luzetti disse:

Galera bom dia,estou pra lançar alguns megas no meu servidor, e  nao sera por mega stone e sim por aleatorio, porem a master ball vai ser capaz de pegar eles, eu ja retirei pra ela pegar pokes shinys, porem queria colocar pra nao pegar megas...alguem me ajuda pfv?

 

 


local ballcatch = {                    --id normal, id da ball shiy
[2394] = {cr = 6, on = 193, off = 192, ball = {11826, 11737}, send = 47, typeee = "poke", boost = "0"},  --alterado v1.9  \/
[2391] = {cr = 7, on = 198, off = 197, ball = {11832, 11740}, send = 48, typeee = "great", boost = "0"},
[2393] = {cr = 9, on = 202, off = 201, ball = {11835, 11743}, send = 46, typeee = "super", boost = "0"},
[2392] = {cr = 13, on = 200, off = 199, ball = {11829, 11746}, send = 49, typeee = "ultra", boost = "0"},
[12617] = {cr = 11, on = 204, off = 203, ball = {10975, 12621}, send = 35, typeee = "saffari", boost = "0"}, 
[12832] = {cr = 100000, on = 23, off = 24, ball = {12826, 12829}, send = 181, typeee = "master", boost = "15"},


[15677] = {cr = 16, on = 313, off = 314, ball = {16181, 16204}, send = 72, typeee = "magu", boost = "0", type = {"fire", "ground"}},
[15676] = {cr = 16, on = 316, off = 317, ball = {16182, 16205}, send = 73, typeee = "sora", boost = "0", type = {"ice", "flying"}},
[15678] = {cr = 16, on = 320, off = 321, ball = {16183, 16206}, send = 74, typeee = "yume", boost = "0", type = {"normal", "psychic"}},
[15680] = {cr = 16, on = 322, off = 323, ball = {16184, 16207}, send = 75, typeee = "dusk", boost = "0", type = {"rock", "fighting"}},
[15673] = {cr = 16, on = 331, off = 332, ball = {16187, 16210}, send = 78, typeee = "tale", boost = "0", type = {"dragon", "fairy"}},
[15674] = {cr = 16, on = 334, off = 335, ball = {16188, 16211}, send = 79, typeee = "moon", boost = "0", type = {"dark", "ghost"}},
[15675] = {cr = 16, on = 337, off = 338, ball = {16189, 16212}, send = 80, typeee = "net", boost = "0", type = {"bug", "water"}},
[15679] = {cr = 16, on = 343, off = 344, ball = {16191, 16214}, send = 82, typeee = "premier", boost = "0", type = {"grass", "poison"}},
[15681] = {cr = 16, on = 346, off = 347, ball = {16192, 16215}, send = 83, typeee = "tinker", boost = "0", type = {"electric", "steel"}},


[15682] = {cr = 18, on = 325, off = 326, ball = {16185, 16208}, send = 76, typeee = "fast", boost = "0", pokes = {"Pikachu", "Raichu"}},
[15672] = {cr = 18, on = 328, off = 329, ball = {16186, 16209}, send = 77, typeee = "heavy", boost = "0", pokes = {"Snorlax", "Venusaur"}},
}

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(getItemAttribute(item2.uid, "pokeName"))
      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 type(getPlayerStorageValue(cid, storage)) ~= "string" or not string.find(getPlayerStorageValue(cid, storage), "magu") then  --alterado v1.9 
   setPlayerStorageValue(cid, storage, "normal = 0, great = 0, super = 0, ultra = 0, saffari = 0, dark = 0, magu = 0, sora = 0, yume = 0, dusk = 0, tale = 0, moon = 0, net = 0, premier = 0, tinker = 0, fast = 0, heavy = 0;")             --alterado v1.9 
end  

local owner = getItemAttribute(item2.uid, "corpseowner")
local pOwner = getPlayerByName(owner)
local isInParyWithPlayer = false
      if isInParty(cid) and isInParty(pOwner) then
         isInParyWithPlayer = isPartyEquals(pOwner, cid)
      end
if owner and isCreature(pOwner) and isPlayer(pOwner) and cid ~= pOwner and not isInParyWithPlayer then   
   doPlayerSendCancel(cid, "Desculpa Isso não é possivel.")
   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 boost = ballcatch[item.itemid].boost    

    local catchBlocks = {"Shiny Snorlax", "Aerodactyl"}
    if isInArray(catchBlocks, name) then
        doSendMsg(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 = newidd                      
      catchinfo.name = doCorrectPokemonName(name)
      catchinfo.topos = topos
      catchinfo.chance = x.chance
      
      
    doBrokesCount(cid, newpokedex[doCorrectPokemonName(name)].stoCatch , typeee)

    doSendDistanceShoot(getThingPos(cid), topos, ballcatch[item.itemid].send)
    doRemoveItem(item.uid, 1)
    
    ---- newsBalls
    if (ballcatch[item.itemid].type ~= nil or ballcatch[item.itemid].pokes ~= nil)  then
       catchinfo.rate = getBallsRate(catchinfo.name, item.itemid)
    end
    
    --if isGod(cid) then catchinfo.rate = 100000 end 

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

function getBallsRate(name, id)
    if pokes[name] then
       if isInArray(ballcatch[id].type, pokes[name].type) or isInArray(ballcatch[id].type, pokes[name].type2) or isInArray(ballcatch[id].pokes, name) then
          return 16
       end
    end
    return 13
end

 

 

Obrigado desde ja.

 

Abaixo de 

 

  local catchBlocks = {"Shiny Snorlax", "Aerodactyl"}
    if isInArray(catchBlocks, name) then
        doSendMsg(cid, "Você não pode capturar este pokemon.")
        return true
    end

Ja coloquei pra mega assim:

 

if typeee == "master" and isMegaName(name) then
        doSendMsg(cid, "Você não pode capturar pokemon shiny com a master ball.")
        return true
    end

 

 

Mas da erro na distro, e nao da pra catar pokemon nenhum dps.

Link para o post
Compartilhar em outros sites
  local megaBlocks = {"Mega Swampert", "Mega Blaziken"}
    if isInArray(megaBlocks, name) then
        doSendMsg(cid, "Você não pode capturar este pokemon.")
        return true
    end

coloca abaixa da função catchblocks

 

Editado por sharen (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Tenta assim, se der erro manda o erro tbm

 local megaBlocks = {"Mega Swampert", "Mega Blaziken"}
    if isInArray(megaBlocks, name) and if typeee == "master" then
        doSendMsg(cid, "Você não pode capturar pokemon mega com master ball.")
        return true
    end
Link para o post
Compartilhar em outros sites
59 minutos atrás, sharen disse:

Tenta assim, se der erro manda o erro tbm


 local megaBlocks = {"Mega Swampert", "Mega Blaziken"}
    if isInArray(megaBlocks, name) and if typeee == "master" then
        doSendMsg(cid, "Você não pode capturar pokemon mega com master ball.")
        return true
    end

 

[09/11/2018 22:47:16] [Error - LuaScriptInterface::loadFile] data/actions/scripts/catch.lua:80: unexpected symbol near 'if'
[09/11/2018 22:47:16] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/catch.lua)
[09/11/2018 22:47:16] data/actions/scripts/catch.lua:80: unexpected symbol near 'if'

image.thumb.png.1aa72ee9812a4c831d09a18090daa531.png

ta estranho isso

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 Muvuka
      Alguem tem anti-nuker igual a esse 
       

       
    • Por Muvuka
      [SQLite] -=[TFS]=- 0.4 8.60 Alguem faz apk mobile pra mim ip: dexsoft.ddns.net
       
      pra mim
       
      https://www.mediafire.com/file/5klqnyy6k7jda0u/OTClientV8.rar/file
       
      TA TUDO AI
    • Por yuriowns
      Salve rapazes, estou precisando de um client próprio para o meu servidor 7.4, preciso que algum programador experiente e com referências faça um client do jeito que eu procuro. Responda aqui para fazermos um orçamento, obrigado!

      Não sei se estou no lugar certo, se não me desculpem e peço que movam por gentileza!
    • Por paulo thush
      Pessoal to com um grande problema, estou com um servidor TFS 1.4x 10.98, recentemente começou dar um problema, sempre quando falava "trade" com o npc dava um erros, com qual quer npc, o erro e o seguinte.
       
       
      me falaram que o problema e nas sourcer que precisava mudar umas coisas me passaram um link no github esse aqui 
      https://github.com/otland/forgottenserver/pull/3996/files
       
      porem eu vi vídeos no youtube ensinando a compilar, já vi muitos tópicos como compilar a sourcer, ai quando vou compilar da esse erro
      já tentei instalar, desinstala muitas coisas, alterar também não vai, minha sourcer e essa 
      https://github.com/otland/forgottenserver
       
       
      Alguém poderia me ajuda com esse erro, ou ate compilar 100% as sourcer. os Tópicos que eu tentei para compilar e esse daqui, se não poder o link me desculpe.
      https://forums.otserv.com.br/index.php?/forums/topic/169234-windowsvc2019-compilando-sources-tfs-14-vcpkg/
       
      alguém me da uma luz por favor kkk
    • Por Ryzek
      Uso tfs 0.4 trunk3884 bem simples.
      Queria acrescentar magic effects para 255 pois o meu só vai até 69. Encontrei um tópico que falava sobre porém parece ter sido removido, não consigo acessar!
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo