Ir para conteúdo

Featured Replies

Postado

Ae galera, ja rodei o forum todo, mais não acho um tópico claro e eu não sou expert em scripts, mais to aprendendo aos poucos, porém não consigo fazer com que pegue minha script, tenho uma dúvida, é em relação ao tempo de evolução de um certo pokemon, baseada na script da Shiny Stone que tem aqui no fórum, como eu coloco tempo no caso no poke que tá pra evoluir? Segue a script:

local evo = {
["Charizard"] = {"Charizardite X", 1},
}
local balls = {
[14233] = {newBall = 14233},
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
          local monster = getCreatureName(itemEx.uid)
          if evo[monster] then  
                 if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then
                    doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!")
                    local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
                    doSendMagicEffect(getThingPos(itemEx.uid), 18)
                    doRemoveCreature(itemEx.uid)
                    doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1)
                    doRemoveItem(item.uid, 1)
                    doSummonMonster(cid,evo[monster][1])
                    local pokeball = getPlayerSlotItem(cid, 8)
                    doItemSetAttribute(pokeball.uid, "poke", evo[monster][1])
                    doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level)
                    doItemSetAttribute(ball, "hp", 1)
                    doItemSetAttribute(ball, "happy", 110)
                    local pk = getCreatureSummons(cid)[1]
                    local getShinyPokeballs = balls[getPlayerSlotItem(cid, 8).itemid]
                    doTransformItem(getPlayerSlotItem(cid, 8).uid, getShinyPokeballs.newBall)
                    adjustStatus(pk, pokeball.uid, true, false, true)
                    return TRUE
                 else
                    return doPlayerSendTextMessage(cid, 27, "You need atleast ".. evo[monster][2] .." stones to do it!")
                 end
          end
end
return FALSE
end

Como eu consigo colocar um certo tempo para ele ficar evoluido como o charizardite x no caso ?

Se puderem, rep++

Editado por togi90 (veja o histórico de edições)

  • Respostas 7
  • Visualizações 337
  • Created
  • Última resposta

Top Posters In This Topic

Postado

Se usa assim:

addEvent(FUNCTION, TEMPO-EM-MILISEGUNDOS)

Aí essa function, eu aconselho vc declarar ela como uma "variável" e aí só coloca o nome da function ai no local certo e o tempo, que vc ñ terá maiores dificuldades.

 

Aqui no fórum tem alguns tutoriais explicando sobre essa função.

https://www.google.com/url?q=http://www.tibiaking.com/forum/topic/33870-como-usar-addevent/&sa=U&ei=CFPJVOT9GaOy7Qbsh4GgBQ&ved=0CAYQFjAA&client=internal-uds-cse&usg=AFQjCNGkkkg5pM---Keh6PhygGJASdH2Cw

 

https://www.google.com/url?q=http://www.tibiaking.com/forum/topic/17990-addeventsem-bugs/&sa=U&ei=E1PJVJjzLtKT7Qb50oDoDw&ved=0CAgQFjAB&client=internal-uds-cse&usg=AFQjCNEr762xJXhnEYlmg7Lu4fk8dL4aEA

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

Postado
  • Autor

Se usa assim:

addEvent(FUNCTION, TEMPO-EM-MILISEGUNDOS)

Aí essa function, eu aconselho vc declarar ela como uma "variável" e aí só coloca o nome da function ai no local certo e o tempo, que vc ñ terá maiores dificuldades.

 

Aqui no fórum tem alguns tutoriais explicando sobre essa função.

https://www.google.com/url?q=http://www.tibiaking.com/forum/topic/33870-como-usar-addevent/&sa=U&ei=CFPJVOT9GaOy7Qbsh4GgBQ&ved=0CAYQFjAA&client=internal-uds-cse&usg=AFQjCNGkkkg5pM---Keh6PhygGJASdH2Cw

 

https://www.google.com/url?q=http://www.tibiaking.com/forum/topic/17990-addeventsem-bugs/&sa=U&ei=E1PJVJjzLtKT7Qb50oDoDw&ved=0CAgQFjAB&client=internal-uds-cse&usg=AFQjCNEr762xJXhnEYlmg7Lu4fk8dL4aEA

 

 

Então ficaria assim ?

local evo = {
["Charizard"] = {"Charizardite X", 1},
}
local balls = {
[14233] = {newBall = 14233},
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
          local monster = getCreatureName(itemEx.uid)
          if evo[monster] then  
                 if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then
                    doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!")
                    local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
                    doSendMagicEffect(getThingPos(itemEx.uid), 18)
                    doRemoveCreature(itemEx.uid)
                    doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1)
                    doRemoveItem(item.uid, 1)
                    doSummonMonster(cid,evo[monster][1])
                    local pokeball = getPlayerSlotItem(cid, 8)
                    doItemSetAttribute(pokeball.uid, "poke", evo[monster][1])
                    doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level)
                    doItemSetAttribute(ball, "hp", 1)
                    doItemSetAttribute(ball, "happy", 110)
                    local pk = getCreatureSummons(cid)[1]
                    local getShinyPokeballs = balls[getPlayerSlotItem(cid, 8).itemid]
                    doTransformItem(getPlayerSlotItem(cid, 8).uid, getShinyPokeballs.newBall)
                    adjustStatus(pk, pokeball.uid, true, false, true)
                    addEvent(getPlayerItemCount, 8000)  <- assim ?
					return TRUE
                 else
                    return doPlayerSendTextMessage(cid, 27, "You need atleast ".. evo[monster][2] .." stones to do it!")
                 end
          end
end
return FALSE
end

Editado por togi90 (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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo