Ir para conteúdo

[Action] Adicionar Mais Slots De Pokeball {Doitemsetattribute(Getplayerslotitem(Cid,8)}


Posts Recomendados

Queria saber oque como faço pra colocar mais slots de pokeball, no caso só tem no "Pé" queria que ela ficasse na "legs,armor e cabeça", o basico já sei que é alteração no item.xml, porém o pokémon não morre e quando sai da pokeball a imagem não altera.

 

 

doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Pokeball")

 

Não tenho certeza mas o (cid,8) se refere ao pé acho que se colocasse mais números o poderia dar certo mais não sei como fazer da maneira correta.

 

 

Desde já agradeço pela ajuda.

Cara cada slot tem seu numero entao voce teria que usar um getPlayerSlotItem(cid,8) pra cada slot:

 

doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Pokeball")
doItemSetAttribute(getPlayerSlotItem(cid,1).uid,"name", poke_name .." Pokeball")
doItemSetAttribute(getPlayerSlotItem(cid,4).uid,"name", poke_name .." Pokeball")
doItemSetAttribute(getPlayerSlotItem(cid,7).uid,"name", poke_name .." Pokeball")

 

1 = HEAD

2 = NECKLACE (COLAR)

3 = BACKPACK

4 = BODY (ARMOR)

5 = LEFT HAND (MÃO ESQUERDA)

6 = RIGHT HAND (MÃO DIREIRA)

7 = LEGS

8 = FEET (PÉ)

9 = RING (ANEL)

10 = AMMUNITION (AONDE POEM AS FLECHAS QUANDO ESTA USANDO ARCO)

 

 

Esperto ter ajudado,

yahooABC

Editado por yahooABC

Deu certo, porém quando solta a pokeball tanto oque está no slot "FEET" quanto oque está no slot "LEGS" ficam com ela apagada.

 

 

Sabe como resolver isso? se não de qualquer forma obrigado.

Tá ai o script. Espero muito que consiga.

 

 

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('(.-) Digitama')

local summons = getCreatureSummons(cid)

local action_id = getItemAttribute(item.uid, "aid")

----- Config -----

if getItemAttribute(item.uid, "aid") == -1 then

return doPlayerSendCancel(cid, "Seu agumon está morto.")

end

 

if getPlayerStorageValue(cid, 25000) == 5 then

return doPlayerSendCancel(cid, "You are riding.")

end

if getPlayerStorageValue(cid, 23000) == 5 then

return doPlayerSendCancel(cid, "You are flying.")

end

 

if(table.maxn(summons) < MaximoSummon) then -- no summons

creature = doSummonCreature(poke_name, getCreaturePosition(cid))

doConvinceCreature(cid, creature)

registerCreatureEvent(creature, "DiePokeAgumon")

registerCreatureEvent(cid, "PlayerPokeDeathAgumon")

registerCreatureEvent(cid, "LogoutPoke")

doPlayerSay(cid, "Go,"..poke_name.."!!", TALKTYPE_ORANGE_1)

doSendMagicEffect(getCreaturePosition(creature), 188)

doTransformItem(getPlayerSlotItem(cid,8).uid, 2219, 1)

doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Digitama")

doTransformItem(getPlayerSlotItem(cid,7).uid, 2219, 1)

doItemSetAttribute(getPlayerSlotItem(cid,7).uid,"name", poke_name .." Digitama")

doTransformItem(getPlayerSlotItem(cid,1).uid, 2219, 1)

doItemSetAttribute(getPlayerSlotItem(cid,1).uid,"name", poke_name .." Digitama")

doTransformItem(getPlayerSlotItem(cid,4).uid, 2219, 1)

doItemSetAttribute(getPlayerSlotItem(cid,4).uid,"name", poke_name .." Digitama")

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, 2218, 1)

doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Digitama")

doTransformItem(getPlayerSlotItem(cid,7).uid, 2218, 1)

doItemSetAttribute(getPlayerSlotItem(cid,7).uid,"name", poke_name .." Digitama")

doTransformItem(getPlayerSlotItem(cid,1).uid, 2218, 1)

doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Digitama")

doTransformItem(getPlayerSlotItem(cid,4).uid, 2218, 1)

doItemSetAttribute(getPlayerSlotItem(cid,7).uid,"name", poke_name .." Digitama")

end

end

end

return true

end

 

Editado por otaviogfl
  • Quem Está Navegando   0 membros estão online

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