• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    [Ayuda] ayuda con server de tibia pokemon 8.54

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    namd0gma1

    namd0gma1
    Nuevo Miembro
    Nuevo Miembro
    amigos necesito ayuda quiero hacer 1 pokeball que capture al 100% en mi server de tibia pomekon 8.54 y un npc para vender los pokemon capturados


    local chance_premium = 10 -- Mude aqui a chance de capiturar
    local ballcatch = {                    --id normal, id da ball shiy
    [2394] = {cr = 2, on = 24, off = 23, ball = {11826, 11826}, send = 46, typeee = "normal"},  --Normal Ball v2.9  \/ ok
    [2391] = {cr = 4, on = 198, off = 197, ball = {11832, 11832}, send = 47, typeee = "great"},  --Great Ball v3.1  \/ ok
    [2393] = {cr = 6, on = 202, off = 201, ball = {11835, 11835}, send = 48, typeee = "super"},  --Super Ball v3.1  \/ ok
    [2392] = {cr = 8, on = 200, off = 199, ball = {11829, 11829}, send = 49, typeee = "ultra"},  --Ultra Ball v3.2  \/ ok
    [12617] = {cr = 4, on = 204, off = 203, ball = {10975, 10975}, send = 35, typeee = "saffari"},  --Saffari Ball v3.1  \/ ok
    [12971] = {cr = 10, on = 193, off = 192, ball = {11737, 11737}, send = 50, typeee = "premier"},  --Premier Ball v3.2  \/ ok
    [13258] = {cr = 10, on = 187, off = 172, ball = {11740, 11740}, send = 51, typeee = "rocket"},  --Rocket Ball v3.2  \/ ok
    }

    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, "Golden Arena'da Pokemon Yakalamaya Çalisamazsiniz!")   --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, love = 0, master = 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, "Bu Pokemonu Siz Öldürmediniz.")
      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 = {}
    if isPremium(cid) then
    catchinfo.rate = ballcatch[item.itemid].cr + chance_premium
    else
    catchinfo.rate = ballcatch[item.itemid].cr
    end
    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, "Tüm Saffari Ball'larini kullandiniz, yine bekleriz...")
    end

    if getPlayerStorageValue(cid, 98798) >= 1 and getPlayerItemCount(cid, 12971) <= 0 then --alterado v2.9
      setPlayerStorageValue(cid, 98798, -1)
      setPlayerStorageValue(cid, 98799, -1)                                              
      doTeleportThing(cid, PinkanOut, false)
      doSendMagicEffect(getThingPos(cid), 21)
      doPlayerSendTextMessage(cid, 27, "Tüm Love Ball'larini kullandiniz, yine bekleriz...")
    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

    2 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    [13258] = {cr = 10, on = 187, off = 172, ball = {11740, 11740}, send = 51, typeee = "rocket"}, --Rocket Ball v3.2 \/ ok


    el marcado con rojo es el chance



    [Ayuda] ayuda con server de tibia pokemon 8.54 YNU5B25
    2 participantes
    http://www.tibiaface.com

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).