Ir para conteúdo
  • 0

[Resolvido] Ajuda com ADDON SISTEM! (Centurion Base)


lucasweich

Pergunta

Olá pessoal. Estou querendo uma ajuda, com o sistema de addons dos pokemons.

Uso como base o centurion v8, e nele contem o sistema de addon, Que aparentemente funciona... MAS... quando eu sumono o pokemon, apos usar o item de addon, ele continua "Normal", sem o addon. Gostaria de um help, em relação a isso.

 

vou postar aqui meu addon.lua...

 

 

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

local addons = {
[12731] = {pokemon= "Cubone" , looktype = 1730, count = 5},
[12730] = {pokemon= "Bulbasaur" , looktype = 1729, count = 1},
[12743] = {pokemon= "Bulbasaur" , looktype = 1738, count = 1},
[12870] = {pokemon= "Clefable" , looktype = 1731, count = 1},
[12871] = {pokemon= "Wigglytuff" , looktype = 1732, count = 1},
[12876] = {pokemon= "Bulbasaur" , looktype = 1737, count = 1},
[12878] = {pokemon= "Charmander" , looktype = 1740, count = 1},
[12880] = {pokemon= "Butterfree" , looktype = 1742, count = 1},
[12881] = {pokemon= "Meowth" , looktype = 1743, count = 1},
[12882] = {pokemon= "Caterpie" , looktype = 1744, count = 1},
[12883] = {pokemon= "Pidgey" , looktype = 1745, count = 1},
[12884] = {pokemon= "Pidgey" , looktype = 1746, count = 1},
[12885] = {pokemon= "Pidgey" , looktype = 1747, count = 1},
[12886] = {pokemon= "Squirtle" , looktype = 1748, count = 1},
[12887] = {pokemon= "Squirtle" , looktype = 1749, count = 1},
[12888] = {pokemon= "Pidgeotto" , looktype = 1750, count = 1},
[12892] = {pokemon= "Rattata" , looktype = 1779, count = 1},
[12893] = {pokemon= "Pikachu" , looktype = 1780, count = 1},
[12895] = {pokemon= "Nidoqueen" , looktype = 1782, count = 1},
[12897] = {pokemon= "Dugtrio" , looktype = 1784, count = 1},
[12898] = {pokemon= "Diglett" , looktype = 1785, count = 1},
[12899] = {pokemon= "Diglett" , looktype = 1786, count = 1},
[12900] = {pokemon= "Diglett" , looktype = 1787, count = 1},
[12901] = {pokemon= "Raticate" , looktype = 1788, count = 1},
[12902] = {pokemon= "Golbat" , looktype = 1789, count = 1},
[12905] = {pokemon= "Golduck" , looktype = 1792, count = 1},
[12906] = {pokemon= "Golduck" , looktype = 1793, count = 1},
[12911] = {pokemon= "Marowak" , looktype = 1798, count = 1},
[12913] = {pokemon= "Mr. Mime" , looktype = 1800, count = 1},
[12915] = {pokemon= "Abra" , looktype = 1802, count = 1},
[12916] = {pokemon= "Mankey" , looktype = 1803, count = 1},
[12921] = {pokemon= "Farfetch'd" , looktype = 1808, count = 1},
[12922] = {pokemon= "Marowak" , looktype = 1809, count = 1},
[12926] = {pokemon= "Haunter" , looktype = 1813, count = 1},
[12930] = {pokemon= "Hypno" , looktype = 1817, count = 1},
[12931] = {pokemon= "Hypno" , looktype = 1818, count = 1},
[12932] = {pokemon= "Ponyta" , looktype = 1819, count = 1},
[12939] = {pokemon= "Tangela" , looktype = 1829, count = 1},
[12940] = {pokemon= "Tangela" , looktype = 1830, count = 1},
[12942] = {pokemon= "Pikachu" , looktype = 1832, count = 1},
[12879] = {pokemon= "Charmander" , looktype = 1741, count = 1},
[12872] = {pokemon= "Electabuzz" , looktype = 1733, count = 1},
[12873] = {pokemon= "Chansey" , looktype = 1734, count = 1},
[12874] = {pokemon= "Alakazam" , looktype = 1735, count = 1},
[12875] = {pokemon= "Electabuzz" , looktype = 1736, count = 1},
[12877] = {pokemon= "Venusaur" , looktype = 1739, count = 1},
[12889] = {pokemon= "Charizard" , looktype = 1751, count = 1},
[12890] = {pokemon= "Blastoise" , looktype = 1777, count = 1},
[12891] = {pokemon= "Blastoise" , looktype = 1778, count = 1},
[12894] = {pokemon= "Kangaskhan" , looktype = 1781, count = 1},
[12896] = {pokemon= "Nidoking" , looktype = 1783, count = 1},
[12903] = {pokemon= "Sandslash" , looktype = 1790, count = 1},
[12904] = {pokemon= "Sandslash" , looktype = 1791, count = 1},
[12907] = {pokemon= "Primeape" , looktype = 1794, count = 1},
[12909] = {pokemon= "Alakazam" , looktype = 1796, count = 1},
[12910] = {pokemon= "Poliwrath" , looktype = 1797, count = 1},
[12912] = {pokemon= "Machamp" , looktype = 1799, count = 1},
[12914] = {pokemon= "Poliwrath" , looktype = 1801, count = 1},
[12917] = {pokemon= "Machamp" , looktype = 1804, count = 1},
[12918] = {pokemon= "Arcanine" , looktype = 1805, count = 1},
[12919] = {pokemon= "Golem" , looktype = 1806, count = 1},
[12920] = {pokemon= "Muk" , looktype = 1807, count = 1},
[12923] = {pokemon= "Scyther" , looktype = 1811, count = 1},
[12924] = {pokemon= "Chansey" , looktype = 1812, count = 1},
[12925] = {pokemon= "Weezing" , looktype = 1812, count = 1},
[12927] = {pokemon= "Gengar" , looktype = 1814, count = 1},
[12928] = {pokemon= "Gengar" , looktype = 1815, count = 1},
[12929] = {pokemon= "Cloyster" , looktype = 1816, count = 1},
[12933] = {pokemon= "Exeggutor" , looktype = 1821, count = 1},
[12934] = {pokemon= "Weezing" , looktype = 1822, count = 1},
[12935] = {pokemon= "Jynx" , looktype = 1823, count = 1},
[12936] = {pokemon= "Jynx" , looktype = 1828, count = 1},
[12937] = {pokemon= "Magmar" , looktype = 1826, count = 1},
[12938] = {pokemon= "Lickitung" , looktype = 1827, count = 1},
[12941] = {pokemon= "Snorlax" , looktype = 1831, count = 1},
[12943] = {pokemon= "Raichu" , looktype = 1833, count = 1},
[12944] = {pokemon= "Raichu" , looktype = 1834, count = 1},
}
if #getCreatureSummons(cid) > 0 then
doPlayerSendCancel(cid, "Please back your pokemon.")
return false
end
local numero = addons[item.itemid].looktype
local count = addons[item.itemid].count
local pb = getPlayerSlotItem(cid, 8).uid
local pk = addons[item.itemid].pokemon
if pb <= 0 then
doPlayerSendCancel(cid, "Desculpe, você não tem um "..pk.." no slot")
return false
end
if getItemAttribute(pb,"poke") ~= pk then
doPlayerSendCancel(cid, "Desculpe, você não pode usar esse addon nesse pokemon.")
return false
end
if getItemAttribute(pb,"addon") < 1 then
if(doRemoveItem(item.uid, count)) then
doPlayerSendTextMessage(cid, 27, "Parabéns, você executou isso com sucesso. Para remover seu addon diga !addons remove")
doSetItemAttribute(pb,"addon", numero)
else
doPlayerSendCancel(cid, "Você não tem o necessário para adicionar no seu "..pk..".")
end
return true
end
return true
end

 

E uma imagem, do devido "bug" ...

 

 

 

Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0

Bom, tentei algo aqui e deu certo. Assim como acreditava que o "bug" não era no sistema dos addons, adicionei uma função no go/back, e funcionou. xD

Ficando assim...

 

 

local hitmonchans = {

["Hitmonchan"] = {
[0] = {out = 559, eff = 112, type = FIGHTINGDAMAGE}, --outfit normal
[1] = {out = 1075, eff = 35, type = FIREDAMAGE}, --outfit fogo
[2] = {out = 1077, eff = 48, type = ELECTRICDAMAGE}, --outfit raio
[3] = {out = 1078, eff = 43, type = ICEDAMAGE}, --outfit gelo
[4] = {out = 1076, eff = 140, type = GHOSTDAMAGE} --outfit ghost
},
["Shiny Hitmonchan"] = {
--aconcelho trocar a outfit do shiny hitmonchan pela do elite hitmonchan do PO...
[0] = {out = 837, eff = 112, type = FIGHTINGDAMAGE}, --outfit normal
[1] = {out = 1080, eff = 35, type = FIREDAMAGE}, --outfit fogo
[2] = {out = 1081, eff = 48, type = ELECTRICDAMAGE}, --outfit raio
[3] = {out = 1082, eff = 43, type = ICEDAMAGE}, --outfit gelo
[4] = {out = 1079, eff = 140, type = GHOSTDAMAGE} --outfit ghost
}
}
function onUse(cid, item, frompos, item2, topos)
if exhaustion.get(cid, 6666) and exhaustion.get(cid, 6666) > 0 then return true end
local owner = getItemAttribute(item.uid, "firstpoke")
if owner and owner ~= getCreatureName(cid) then
doPlayerSendCancel(cid, "Esse pokemon é do "..owner..", é seu primeiro pokemon, devolva ele para seu dono, por favor.")
return true
end
if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then
return true
end
local btype = getPokeballType(item.itemid)
local effect = pokeballs[btype].effect
if not effect then
effect = 21
end
if item.itemid == pokeballs[btype].use then
if getPlayerStorageValue(cid, 990) == 1 then -- GYM
doPlayerSendCancel(cid, "Você não pode fazer seu pokemon retornar em batalhas de ginasio.")
return true
end
if #getCreatureSummons(cid) <= 0 then
if isInArray(pokeballs[btype].all, item.itemid) then
doTransformItem(item.uid, pokeballs[btype].off)
doItemSetAttribute(item.uid, "hp", 0)
doPlayerSendCancel(cid, "Esse pokemon desmaiou.")
return true
end
end
local z = getCreatureSummons(cid)[1]
if getCreatureCondition(z, CONDITION_INVISIBLE) and not isGhostPokemon(z) then
return true
end
doReturnPokemon(cid, z, item, effect)
elseif item.itemid == pokeballs[btype].on then
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
doPlayerSendCancel(cid, "Coloque seu pokemon no local correto!!")
return TRUE
end
local thishp = getItemAttribute(item.uid, "hp")
if thishp <= 0 then
if isInArray(pokeballs[btype].all, item.itemid) then
doTransformItem(item.uid, pokeballs[btype].off)
doItemSetAttribute(item.uid, "hp", 0)
doPlayerSendCancel(cid, "Esse pokemon desmaiou.")
return true
end
end
local pokemon = getItemAttribute(item.uid, "poke")
if not pokes[pokemon] then
return true
end
local x = pokes[pokemon]
if getPlayerLevel(cid) + pokemonMaxLevelAbovePlayer < getItemAttribute(item.uid, "level") then
doPlayerSendCancel(cid, "Seu pokemon é level maior que você, upe até o level dele que você poderá usa-lo.")
return true
end
doSummonMonster(cid, pokemon)
local pk = getCreatureSummons(cid)[1]
if not isCreature(pk) then return true end
------------------------passiva hitmonchan------------------------------
if isSummon(pk) then
--local e = getCreatureMaster(cid)
local nameHIT = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke")
local hands = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "hands")
if nameHIT == "Shiny Hitmonchan" or nameHIT == "Hitmonchan" then
if getItemAttribute(getPlayerSlotItem(cid, 8).uid, "hands") then
doSetCreatureOutfit(pk, {lookType = hitmonchans[nameHIT][hands].out}, -1)
else
doPlayerSendTextMessage(cid, 27, "Contact a GameMaster! Error in passive system! Attribute \"hands\" missing")
end
end
end
-------------------------------------------------------------------------
if getCreatureName(pk) == "Ditto" then
local left = getItemAttribute(item.uid, "transLeft")
local name = getItemAttribute(item.uid, "transName")
if left and left > 0 then
setPlayerStorageValue(pk, 1010, name)
doSetCreatureOutfit(pk, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1)
addEvent(deTransform, left * 1000, pk, getItemAttribute(item.uid, "transTurn"))
doItemSetAttribute(item.uid, "transBegin", os.clock())
else
setPlayerStorageValue(pk, 1010, "Ditto")
end
end
if isGhostPokemon(pk) then doTeleportThing(pk, getPosByDir(getThingPos(cid), math.random(0, 7)), false) end
doCreatureSetLookDir(pk, 2)
adjustStatus(pk, item.uid, true, false, true)
doAddPokemonInOwnList(cid, pokemon)
doTransformItem(item.uid, item.itemid+1)
local pokename = getItemAttribute(item.uid, "nick") or getCreatureName(pk)
local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)
doCreatureSay(cid, mgo, TALKTYPE_SAY)
doSendMagicEffect(getCreaturePosition(pk), effect)
local pk = getCreatureSummons(cid)[1]
local pb = getPlayerSlotItem(cid, 8).uid
local look = getItemAttribute(pb,"addon")
if not look then
doSetItemAttribute(pb,"addon",0)
return false
end
if look > 0 then
doSetCreatureOutfit(pk, {lookType = look}, -1)
return true
end
else
doPlayerSendCancel(cid, "Esse pokemon desmaiou.")
end
if useKpdoDlls then
doUpdateMoves(cid)
end
return true

end

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

  • 0
  • Administrador
A questão neste tópico de suporte foi respondida e/ou o autor do tópico resolveu o problema. Este tópico está fechado e foi movido para Suporte - Resolvidos. Se você tiver outras dúvidas, crie um novo tópico.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...