Boa Tarde / Bom Dia / Boa Noite
Eu tava Aqui vendo o Sistema de Addon Poke ...
ai eu Adicionei no meu Server pra Testar , ele ate funcionou certo ....
Eu Não sei se foi so comigu , pq n vi ninguem reclamando no forum ...
Mais eu Achei 2 bugs aqui depois que adicionei.
1º Quando eu Adiciono por exemplo addon no Machop , e Evoluo ele para Machamp ..
o Machamp Fica com o Addon do Machop.
e 2º Quando adicionei , as Balls Dava Para Tirar do Slot com Pokemon Solto ...
Não da nenhum erro , só acontece isso ai /\
Sistema Que eu Usei \/
• Script Dos Addon - Creditos RicardoSohnn •
Em actions.xml adicione a seguinte tag:
<action itemid="xxxx" event="script" value="addons.lua"/>
Sendo, xxxx o id do item que vai dar o addon.
addons.lua
function onUse(cid, item, fromPosition, itemEx, toPosition)
local addons = {
[xxxx] = {pokemon= "Scyther" , looktype = 510}, --xxxx = id do item do addon --- "Scyther" = nome do pokemon --- looktype = 1 é o looktype do pokemon com addon
}
if #getCreatureSummons(cid) > 0 then
doPlayerSendCancel(cid, "Please back your pokemon.")
return false
end
local numero = addons[item.itemid].looktype
local pb = getPlayerSlotItem(cid, 8).uid
local pk = addons[item.itemid].pokemon
if getItemAttribute(pb,"poke") ~= pk then
doPlayerSendCancel(cid, "Sorry, you can't use this addon on this poke.")
return false
end
if getItemAttribute(pb,"addon") < 1 then
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, 27, "Congratulations! Now your pokemon will use the addon.")
doSetItemAttribute(pb,"addon",numero)
return true
end
return true
end
---------------------------------------------
Na action do goback, no finalzinho antes de
else
doPlayerSendCancel(cid, "This pokemon is fainted.")
end
Coloque:
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
-----------------------------------
Agora em data/lib/catch system.lua
Depois de:
doItemSetAttribute(item, "description", description)Coloque:
doItemSetAttribute(item, "addon", 0)
--------------------------------
Depois em data/talkactions/scripts/createpokeball.lua depois de:
doItemSetAttribute(item, "description", "Contains a "..name..".")Coloque:
doItemSetAttribute(item, "addon", 0)
Se Alguem poder Ajudar , Agradeço ...