Postado Agosto 1, 2015 9 anos 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) Editado Agosto 1, 2015 9 anos por kaleudd (veja o histórico de edições)
Postado Dezembro 9, 2015 9 anos Em 01/08/2015 16:19:07, kaleudd disse: 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) Opa eu sei como resolver, vou deixar o link do post ensinando a por Addon System, como vc já possui só quer arrumar a cd bar, basta alterar o goback.lua e o some functions.lua pelo do post no link abaixo: http://www.tibiaking.com/forum/topic/65407-addon-system-funcional-20152016/ Se Ajudei, Rep+ Editado Dezembro 9, 2015 9 anos por samlecter (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.