Ir para conteúdo

Featured Replies

Postado

Olá pessoal, quando eu uso um pokemon pela pokebar, ela remove a addon do pokemon

Script

 

function createBallByStatus(cid, status, id)
slot = getPlayerSlotItem(cid, 8)
if slot.uid == 0 then
item = doPlayerAddItem(cid, id) 
else
item = addItemInFreeBag(getPlayerSlotItem(cid, 3).uid, id, 1)
end
setStatusPokeballByStatusStr(item, status)
end
 
 
function getPokemonByName(cid, pokemon)
local arraypoke = {}
local container = getPlayerSlotItem(cid, 3).uid
local pokeballs = getPokeballsInContainer(container) 
for i =1, #pokeballs do
name = getItemAttribute(pokeballs[i], "poke") 
if pokemon == name then
table.insert(arraypoke, pokeballs[i])
return arraypoke[1]
end
end
return false
end
 
function tranfBallInShiny(pokeball)
doItemSetAttribute(pokeball, "shiny", "shiny")
return true
end
 
function getShinyByPokeball(pokeball)
local shiny = getItemAttribute(pokeball, "shiny") 
return shiny == "shiny" and true or false
end
 
 
function getShinyNameByPokeball(pokeball)
local shiny = getItemAttribute(pokeball, "shiny") 
return shiny and "Shiny "..getItemAttribute(pokeball, "poke").."" or getItemAttribute(pokeball, "poke")
end
 
 
function setStatusPokeballByStatusStr(pokeball, status)
local attr = string.explode(status, ",")
local x = {"poke", "hp", "offense", "defense", "speed", "vitality", "specialattack", "happy", "gender", "hands", "description", "fakedesc", "boost", "ball", "defeated", "shiny", "level"}
for i =1, #attr do
doItemSetAttribute(pokeball, x[i], attr[i])
end
end
 
 
function copieAllStatusBalls(pokeball)
local x = {"poke", "hp", "offense", "defense", "speed", "vitality", "specialattack", "happy", "gender", "hands", "description", "fakedesc", "boost", "ball", "defeated", "shiny", "level"}
str = ""
sep = ","
for i =1, #x do
local attr = getItemAttribute(pokeball, x[i]) or 0
local t = attr ..sep
str = str..t
end
 
return str 
end
 
 
 
function atualizaPokes(cid)
local item = getPlayerSlotItem(cid, 8)
if item.uid <= 0 then return true end
if not getItemAttribute(item.uid, "poke") then
return true
end    
for i, x in pairs(fotos) do
if string.lower(getItemAttribute(item.uid, "poke")) == string.lower(i) then
doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos[i])
if useOTClient then
doPlayerSendCancel(cid, '12//,show')
end
if useKpdoDlls then
useOTClient = true
useKpdoDlls = true
doUpdateMoves(cid)
end
 
end
end
end
 
 
 
function doSendPokemon(cid, pokemon)
 
 
if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 
or getPlayerStorageValue(cid, 75846) >= 1 or getPlayerStorageValue(cid, 5700) >= 1  then    --alterado v1.9 <<
return true                                                                                                                        
end
 
if exhaustion.get(cid, 6666) and exhaustion.get(cid, 6666) > 0 then return true end
 
 
if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 212124) <= 0 then     --alterado v1.6
if getPlayerStorageValue(cid, 637501) == -2 or getPlayerStorageValue(cid, 637501) >= 1 then  
BackTeam(cid)       
end
end   
 
if #getCreatureSummons(cid) > 0 then
t = getPlayerSlotItem(cid, 8)
local btype = getPokeballType(t.itemid)
local effect = pokeballs[btype].effect or 21 
 
doReturnPokemon(cid, getCreatureSummons(cid)[1], t,effect)
end
 
t = getPlayerSlotItem(cid, 8)
if t.uid ~= 0 then
pokeslot = getItemAttribute(t.uid, "poke") 
 
 
if pokeslot == pokemon then
t = getPlayerSlotItem(cid, 8)
doGoPokemon(cid, t)
atualizaPokes(cid)
return true
end
 
if getPokemonByName(cid, pokemon) then
local poke = getPokemonByName(cid, pokemon)
local attr = copieAllStatusBalls(t.uid)
local id = t.itemid
doRemoveItem(t.uid)
local attr2 = copieAllStatusBalls(poke)
local id2 = getThing(poke).itemid
doRemoveItem(getPokemonByName(cid, pokemon))
createBallByStatus(cid, attr2, id2)
createBallByStatus(cid, attr, id)
t = getPlayerSlotItem(cid, 8)
doGoPokemon(cid, t)
atualizaPokes(cid)
return true
end
end
 
 
if getPokemonByName(cid, pokemon) then
local id = getThing(getPokemonByName(cid, pokemon)).itemid
local attr = copieAllStatusBalls(getPokemonByName(cid, pokemon))
doRemoveItem(getPokemonByName(cid, pokemon))
createBallByStatus(cid, attr, id)
t = getPlayerSlotItem(cid, 8)
doGoPokemon(cid, t)
atualizaPokes(cid)
return true
end
return false
end
 
 
function sendPokeInfo(cid)
local activeimg = true
local poke = getPlayerSlotItem(cid, 8)
local pokeslot = getItemAttribute(poke.uid, "poke") 
local pokeboost = getItemAttribute(poke.uid, "boost") or 0
local pokehappy = getPlayerStorageValue(getCreatureSummons(cid)[1], 1008) or 1 
doPlayerSendCancel(cid, "NewInfo/"..pokeslot.."/"..pokeboost.."/"..pokehappy.."")
if activeimg then
local img = "ShowPoke/"
doPlayerSendCancel(cid, img..pokeslot)
end
end
 
function sendAudio(cid, audio)
 
local function getSpectatorsFromArea(fromPosition, toPosition, multifloor)
    local lenght = ((math.max(fromPosition.x, toPosition.x) - math.min(fromPosition.x, toPosition.x)) * 0.5) + 1
    local width = ((math.max(fromPosition.y, toPosition.y) - math.min(fromPosition.y, toPosition.y)) * 0.5) + 1
 
    if multifloor == true then
        local ret = {}
        for f = math.min(fromPosition.z, toPosition.z), math.max(fromPosition.z, toPosition.z) do
            local tmp = getSpectators({x = math.min(fromPosition.x, toPosition.x) + lenght, y = math.min(fromPosition.y, toPosition.y) + width, z = f}, lenght, width, false)
            for k = 1, #tmp do
table.insert(ret, tmp[k])
end
        end
        return ret
    end
    return getSpectators({x = math.min(fromPosition.x, toPosition.x) + lenght, y = math.min(fromPosition.y, toPosition.y) + width, z = fromPosition.z}, lenght, width, false)
end
 
local pos = getThingPos(cid)
 
 
local pos = getThingPos(cid)
local t = 5
local pos1 = {x = pos.x-t, y = pos.y-t, z = pos.z}
local pos2 = {x = pos.x+t, y = pos.y+t, z = pos.z}
for _, pid in pairs(getSpectatorsFromArea(pos1, pos2, true)) do
if isPlayer(pid) then
doPlayerSendCancel(pid, "Audio "..audio.."")
end
end
end
 
function doShowSelectChar(cid)
doPlayerSendCancel(cid, "ShowChar")
end
 
function doCloseSelectChar(cid)
doPlayerSendCancel(cid, "CloseChar")
end
 
function doShowLookPlayer(cid, target, msg)
doPlayerSendCancel(cid, "ShowLook/"..getPlayerStorageValue(target, 21121).."/"..msg.."")
end
 
function doCloseInfoPoke(cid)
local activeimg = true
doPlayerSendCancel(cid, "InfoClosed")
if activeimg then
local close = "ClosePoke"
doPlayerSendCancel(cid, close)
end
end
 
function sendAllPokemonsBarPoke(cid)
local container = getPlayerSlotItem(cid, 3).uid
local pokes = "Pokebar"
local t = getPlayerSlotItem(cid, 8)
if t.uid ~= 0 then
pokeslot = getItemAttribute(t.uid, "poke") 
pokes = pokes.."/"..pokeslot..""
end
local pokeballs = getPokeballsInContainer(container) 
for i =1, #pokeballs do
pokemons = getItemAttribute(pokeballs[i], "poke") 
pokes = pokes.."/"..pokemons..""
end
doPlayerSendCancel(cid, pokes)
end

 

Editado por Gnius (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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 520.1k

Informação Importante

Confirmação de Termo