OLa,bem estou com um problema no addon system que achei,é o seguinte,ele funciona de boa ao usar item talz,porem unico problema é que a Cdbar dos attacks somen,dai ele fica sem nenhum attack
ESTOU USANDO ESSE SCRIPT
funcionou Quase que perfeitamente. Não consegui configurar a cod bar para funcionar com o addon (se usar o addon todos os moves somen,ele fica sem).
Alguem saberia como fazer?
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)
Pergunta
kaleudd 200
OLa,bem estou com um problema no addon system que achei,é o seguinte,ele funciona de boa ao usar item talz,porem unico problema é que a Cdbar dos attacks somen,dai ele fica sem nenhum attack
ESTOU USANDO ESSE SCRIPT
funcionou Quase que perfeitamente. Não consegui configurar a cod bar para funcionar com o addon (se usar o addon todos os moves somen,ele fica sem).
Alguem saberia como fazer?
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)UP URGENTEEEEEEEEEE
UPPP
Link para o comentário
https://xtibia.com/forum/topic/235924-resolvido-addon-system-poketibia/Compartilhar em outros sites
9 respostass a esta questão
Posts Recomendados