Ir para conteúdo

[Encerrado] [Ajuda] Bug Pokeball FAST PFV


wdot456

Posts Recomendados

To com um bug nas pokeballs que quando o pokemon morre, nas pokeballs ele não fica morto, tipo se eu clicar pra soltar o pokemon de novo ele sai mesmo morto :S Não sei que bug é esse, podem Por favor me ajudar ?

Link para o comentário
Compartilhar em outros sites

Catch.lua

 

 

 

-- CAPTURE SYSTEM BY RAMZA (RICARDO IANELLI) - DO NOT COPY WITHOUT PERMISSION --

local chance = {
['abra'] = 60,
['kadabra'] = 30,
['alakazam'] = 5,
['gastly'] = 60,
['haunter'] = 30,
['gengar'] = 5,
['aipom'] = 50,
['ambipom'] = 5,
['machop'] = 70,
['machoke'] = 35,
['machamp'] = 6,
['bellsprout'] = 100,
['weepinbell'] = 60,
['victreebel'] = 10,
['tentacool'] = 70,
['tentacruel'] = 10,
['geodude'] = 80,
['graveler'] = 36,
['golem'] = 7,
['ponyta'] = 60,
['rapidash'] = 10,
['slowpoke'] = 80,
['slowbro'] = 20,
['magnemite'] = 70,
['magneton'] = 15,
['magnezone'] = 5,
['farfetchd'] = 40,
['doduo'] = 90,
['dodrio'] = 20,
['seel'] = 65,
['dewgong'] = 5,
['grimer'] = 90,
['muk'] = 10,
['shellder'] = 65,
['cloyster'] = 5,
['elekid'] = 50,
['magby'] = 50,
['tyrogue'] = 50,
['pichu'] = 50,
['onix'] = 15,
['drowzee'] = 65,
['hypno'] = 5,
['krabby'] = 100,
['kingler'] = 20,
['corphish'] = 90,
['crawdaunt'] = 15,
['voltorb'] = 80,
['electrode'] = 15,
['exeggcute'] = 60,
['exeggutor'] = 6,
['cubone'] = 80,
['marowak'] = 5,
['hitmonlee'] = 10,
['hitmonchan'] = 10,
['lickitung'] = 30,
['koffing'] = 90,
['weezing'] = 15,
['rhyhorn'] = 50,
['rhydon'] = 5,
['chansey'] = 3,
['tangela'] = 50,
['kangaskhan'] = 25,
['horsea'] = 99,
['seadra'] = 15,
['kingdra'] = 15,
['togepi'] = 60,
['togetic'] = 10,
['shuppet'] = 40,
['banette'] = 15,
['duskull'] = 40,
['dusclops'] = 15,
['goldeen'] = 99,
['seaking'] = 18,
['buizel'] = 1,
['staryu'] = 50,
['starmie'] = 5,
['mime jr'] = 45,
['mr.mime'] = 4,
['scyther'] = 10,
['smoochum'] = 45,
['jynx'] = 10,
['electabuzz'] = 6,
['magmar'] = 8,
['pinsir'] = 40,
['tauros'] = 35,
['magikarp'] = 999,
['gyarados'] = 4,
['lapras'] = 10,
['ditto'] = 1,
['eevee'] = 5,
['vaporeon'] = 7,
['flareon'] = 7,
['jolteon'] = 7,
['porygon'] = 7,
['omanyte'] = 20,
['omastar'] = 7,
['kabuto'] = 20,
['kabutops'] = 7,
['aerodactyl'] = 7,
['snorlax'] = 7,
['articuno'] = 0,
['zapdos'] = 0,
['moltres'] = 0,
['dratini'] = 25,
['dragonair'] = 10,
['dragonite'] = 1,
['celebi'] = 0,
['lugia'] = 0,
['mew'] = 0,
['mewtwo'] = 0,
['beedrill'] = 20,
['bulbasaur'] = 40,
['ivysaur'] = 10,
['venusaur'] = 10,
['charmander'] = 40,
['charmeleon'] = 6,
['charizard'] = 9,
['squirtle'] = 40,
['wartortle'] = 6,
['blastoise'] = 9,
['caterpie'] = 999,
['metapod'] = 75,
['butterfree'] = 20,
['weedle'] = 999,
['kakuna'] = 75,
['pidgey'] = 90,
['pidgeotto'] = 30,
['pidgeot'] = 7,
['rattata'] = 300,
['raticate'] = 60,
['spearow'] = 80,
['fearow'] = 10,
['ekans'] = 60,
['arbok'] = 10,
['pikachu'] = 70,
['raichu'] = 5,
['sandshrew'] = 80,
['sandslash'] = 7,
['nidoran F'] = 80,
['nidorina'] = 10,
['nidoqueen'] = 2,
['nidoran M'] = 80,
['nidorino'] = 10,
['nidoking'] = 2,
['clefairy'] = 38,
['clefable'] = 4,
['vulpix'] = 60,
['ninetales'] = 5,
['jigglypuff'] = 39,
['wigglytuff'] = 5,
['zubat'] = 99,
['golbat'] = 30,
['crobat'] = 3,
['oddish'] = 120,
['gloom'] = 40,
['vileplume'] = 5,
['paras'] = 90,
['parasect'] = 15,
['venonat'] = 70,
['venomoth'] = 9,
['diglett'] = 80,
['dugtrio'] = 15,
['meowth'] = 80,
['persian'] = 35,
['psyduck'] = 60,
['golduck'] = 3,
['mankey'] = 65,
['primeape'] = 9,
['growlithe'] = 50,
['arcanine'] = 2,
['poliwag'] = 85,
['poliwhirl'] = 10,
['politoed'] = 3,
['poliwrath'] = 3,
['riolu'] = 2,
['lucario'] = 2,
['elder charizard'] = 1,
['crystal onix'] = 1,
['red gyarados'] = 1,
['shiny horsea'] = 1,
['shiny abra'] = 1,
['shiny beedrill'] = 1,
['shiny seadra'] = 1,
['shiny krabby'] = 1,
['shiny kingler'] = 1,
['shiny tentacruel'] = 1,
['shiny paras'] = 1,
['shiny parasect'] = 1,
['shiny raticate'] = 1,
['shiny muk'] = 1,
['shiny growlithe'] = 1,
['shiny arcanine'] = 1,
['shiny butterfree'] = 1,
['shiny Zubat'] = 1,
['shiny electrode'] = 1,
['shiny raichu'] = 1,
['shiny venomoth'] = 1,
['shiny jynx'] = 1,
['shiny dratini'] = 1,
['shiny blastoise'] = 1,
['shiny venusaur'] = 1,
['shiny electabuzz'] = 1,
['scizor'] = 1,
['shiny scyther'] = 1,
['chikorita'] = 1,
['fake dialga'] = 0,
['entei'] = 0,
['giratina'] = 0,
['ho oh'] = 0,
['jirachi'] = 0,
['fake palkia'] = 0,
['primal palkia'] = 0,
['raikou'] = 0,
['fake rayquaza'] = 0,
['fake giratina'] = 0,
['fake jirachi'] = 0,
['scizor'] = 1,
['steelix'] = 1,
['suicune'] = 1,
['aggron'] = 1,
['aron'] = 1,
['shiny celebi'] = 0,
['regirock'] = 2,

}



local ID_GREATBALL = 2146
local ID_SUPERBALL = 2147
local ID_ULTRABALL = 2150
local ID_MASTERBALL = 2554
local ID_CAPTUROU = 24
local ID_NAO_CAPTUROU = 23

local pokebolas = {
[2149] = {2531,"Pokeball"},
[2147] = {2653,"Superball"},
[2146] = {2652,"Greatball"},
[2150] = {2654,"Ultraball"},
[2521] = {2195,"Masterball"},
}

local level = {
['abra'] = 11,
['kadabra'] = 40,
['alakazam'] = 80,
['machop'] = 15,
['machoke'] = 40,
['machamp'] = 70,
['bellsprout'] = 5,
['weepinbell'] = 20,
['victreebel'] = 65,
['tentacool'] = 15,
['tentacruel'] = 70,
['geodude'] = 5,
['graveler'] = 40,
['golem'] = 80,
['ponyta'] = 25,
['rapidash'] = 50,
['slowpoke'] = 5,
['slowbro'] = 60,
['magnemite'] = 10,
['magneton'] = 30,
['farfetchd'] = 40,
['duduo'] = 25,
['dodrio'] = 45,
['seel'] = 25,
['dewgong'] = 65,
['grimer'] = 35,
['muk'] = 70,
['shellder'] = 15,
['cloyster'] = 60,
['gastly'] = 15,
['haunter'] = 40,
['gengar'] = 85,
['onix'] = 50,
['drowzee'] = 28,
['hypno'] = 55,
['krabby'] = 5,
['klinger'] = 35,
['voltorb'] = 15,
['electrode'] = 40,
['exeggcute'] = 8,
['exeggutor'] = 35,
['cubone'] = 25,
['marowak'] = 42,
['hitmonlee'] = 80,
['hitmonchan'] = 75,
['lickitung'] = 80,
['koffing'] = 20,
['weezing'] = 40,
['rhyhorn'] = 35,
['rhydon'] = 40,
['chansey'] = 60,
['tangela'] = 30,
['kangaskhan'] = 100,
['horsea'] = 5,
['seadra'] = 15,
['goldeen'] = 5,
['seaking'] = 17,
['staryu'] = 15,
['starmie'] = 25,
['mr.Mime'] = 60,
['scyther'] = 80,
['jynx'] = 65,
['electabuzz'] = 80,
['magmar'] = 80,
['pinsir'] = 85,
['tauros'] = 70,
['magikarp'] = 1,
['gyarados'] = 80,
['lapras'] = 80,
['ditto'] = 100,
['eevee'] = 45,
['vaporeon'] = 50,
['flareon'] = 50,
['jolteon'] = 50,
['porygon'] = 60,
['omanyte'] = 40,
['omastar'] = 80,
['kabuto'] = 40,
['kabutops'] = 80,
['snorlax'] = 100,
['articuno'] = 300,
['zapdos'] = 300,
['moltres'] = 300,
['dratini'] = 30,
['dragonair'] = 60,
['dragonite'] = 80,
['mew'] = 500,
['mewtwo'] = 600,
['beedrill'] = 25,
['bulbasaur'] = 5,
['ivysaur'] = 25,
['venusaur'] = 85,
['charmander'] = 5,
['charmeleon'] = 25,
['charizard'] = 85,
['squirtle'] = 5,
['wartortle'] = 25,
['blastoise'] = 85,
['caterpie'] = 3,
['metapod'] = 5,
['butterfree'] = 35,
['weedle'] = 3,
['kakuna'] = 5,
['pidgey'] = 5,
['pidgeotto'] = 25,
['pidgeot'] = 60,
['rattata'] = 7,
['raticate'] = 20,
['spearow'] = 5,
['fearow'] = 50,
['ekans'] = 10,
['arbok'] = 32,
['pikachu'] = 25,
['raichu'] = 55,
['sandshrew'] = 16,
['sandslash'] = 60,
['nidoranFE'] = 20,
['nidorina'] = 30,
['nidoqueen'] = 50,
['nidoranMA'] = 20,
['nidorino'] = 30,
['nidoking'] = 60,
['clefairy'] = 30,
['clefable'] = 50,
['vulpix'] = 18,
['ninetales'] = 60,
['jigglypuff'] = 12,
['wigglytuff'] = 30,
['zubat'] = 15,
['golbat'] = 25,
['oddish'] = 5,
['gloom'] = 25,
['vileplume'] = 60,
['paras'] = 5,
['parasect'] = 50,
['venonat'] = 15,
['venomoth'] = 50,
['diglett'] = 10,
['dugtrio'] = 35,
['meowth'] = 15,
['persian'] = 40,
['psyduck'] = 18,
['golduck'] = 55,
['mankey'] = 25,
['primeape'] = 50,
['growlithe'] = 18,
['arcanine'] = 80,
['poliwag'] = 5,
['poliwhirl'] = 25,
['poliwrath'] = 60,
}

-- Vá adicionando mais acima, como está ali ""
local function capturou(params)
doSendMagicEffect(getCreaturePosition(params.cid), 173)
doPlayerSendTextMessage(params.cid, 25, 'Uha Peguei o ('..params.monster..').')
item = doCreateItemEx(params.ball)
doItemSetAttribute(item, "name", ""..params.monster.." "..params.ball2)
doItemSetAttribute(item, "level", params.level)
doItemSetAttribute(item, "aid", params.hp)
doPlayerAddItemEx(params.cid, item, true)
end

local function naocapturou(params)

end

function onUse(cid, item, fromPosition, itemEx, toPosition)


local monster = getItemName(itemEx.uid):match("dead (.*)")
if item.itemid == ID_GREATBALL then
chances = (chance[monster]) * 3
elseif item.itemid == ID_SUPERBALL then
chances = (chance[monster]) * 4
elseif item.itemid == ID_ULTRABALL then
chances = (chance[monster]) * 5
elseif item.itemid == ID_MASTERBALL then
chances = (chance[monster]) * 1000
else
chances = chance[monster]
end


if not chance[monster] then
return doPlayerSendTextMessage(cid, 23, 'Você não pode capturar este pokemon!')
end

if math.random(1,1000) <= chances then
if item.itemid == 2149 then
doSendMagicEffect(toPosition, 24)
elseif item.itemid == 2147 then
doSendMagicEffect(toPosition, 202)
elseif item.itemid == 2146 then
doSendMagicEffect(toPosition, 198)
elseif item.itemid == 2150 then
doSendMagicEffect(toPosition, 200)
elseif item.itemid == 2521 then
doSendMagicEffect(toPosition, 24)
end


local hpmax = 0
local ball = pokebolas[item.itemid]
addEvent(capturou, 4000, {cid = cid, monster = monster, ball = ball[1], ball2 = ball[2], level = level[monster], hp = hpmax})
doRemoveItem(itemEx.uid, 1)
doRemoveItem(item.uid, 1)
else
if item.itemid == 2149 then
doSendMagicEffect(toPosition, 23)
elseif item.itemid == 2147 then
doSendMagicEffect(toPosition, 201)
elseif item.itemid == 2146 then
doSendMagicEffect(toPosition, 197)
elseif item.itemid == 2150 then
doSendMagicEffect(toPosition, 199)
elseif item.itemid == 2523 then
doSendMagicEffect(toPosition, 203)
end
doRemoveItem(itemEx.uid, 1)
doRemoveItem(item.uid, 1)
end
return TRUE
end

 

 

 

goback.lua

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
function getPokemonMaxLife(name)
local file = io.open('data/monster/monsters.xml','r')
local arquivo = file:read(-1):lower():match('<monster name="'..name:lower()..'" file="(.-)"/>')
file:close()
local data = io.open('data/monster/'..(arquivo or ''),'r')
if not data then
return 100
end
local maximo = data:read(-1):match('max%s*=%s*"(%d+)"')
data:close()
return maximo
end
----- Config -----
local MaximoSummon = 1
local nome = getItemName(item.uid)
local poke_name = nome:match('(.-) Pokeball')
local summons = getCreatureSummons(cid)
local action_id = getItemAttribute(item.uid, "aid")
----- Config -----
if getItemAttribute(item.uid, "aid") == -1 then
return doPlayerSendCancel(cid, "Seu pokemon está morto.")
end

if getPlayerStorageValue(cid, 25000) == 5 then
return doPlayerSendCancel(cid, "Você está montando.")
end
if getPlayerStorageValue(cid, 23000) == 5 then
return doPlayerSendCancel(cid, "Você está voando.")
end
local summons = getCreatureSummons(cid)
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
doPlayerSendCancel(cid, "Para Soltar seus pokemons, coloque-os no slot da pokeball.")
return TRUE
end
if(table.maxn(summons) < MaximoSummon) then -- no summons
creature = doSummonCreature(poke_name, getCreaturePosition(cid))
doConvinceCreature(cid, creature)
registerCreatureEvent(creature, "DiePoke")
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(cid, "LogoutPoke")
doPlayerSay(cid, "Go,"..poke_name.."!!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(creature), 188)
doTransformItem(getPlayerSlotItem(cid,8).uid, 2531, 1)
doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Pokeball")
if action_id ~= 0 then
doCreatureAddHealth(creature, -(tonumber(getPokemonMaxLife(poke_name) - action_id)))
else
doCreatureAddHealth(creature, getPokemonMaxLife(poke_name))
end

else
for _, pid in ipairs(summons) do
if (table.maxn(summons) >= 1) then
doItemSetAttribute(item.uid, "aid", getCreatureHealth(summons[1]))
doSendMagicEffect(getCreaturePosition(getCreatureSummons(cid)[1]), 188)
doPlayerSay(cid, "Back,"..poke_name..".", TALKTYPE_ORANGE_1)
doRemoveCreature(pid)
doTransformItem(getPlayerSlotItem(cid,8).uid, 2532, 1)
doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Pokeball")
end
end
end
return true
end

 

 


Ainda preciso de ajuda aki


Eu ainda preciso de ajuda, e MUITA.

Link para o comentário
Compartilhar em outros sites

Wdot456,

 

Preste mais atenção antes de postar, você postou no local errado, logo, procure antes de postar.

A seção onde deveria postar suas dúvidas, seria aqui:

 

Pedidos e dúvidas - Scripting

 

Tópico movido!

Atenciosamente,
Moderação XTibia

Editado por Mophus
Link para o comentário
Compartilhar em outros sites

  • 3 weeks later...
  • 4 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...