Ir para conteúdo
  • Cadastre-se

(Resolvido)[ACTION] - Ao clicar no item ganha bless?!


Ir para solução Resolvido por f.silva,

Posts Recomendados

Uma action que o ao clicar no item ganha bless, e aparece uma mensagem "Parabéns, agora você tem bless!", e se ja estiver com bless "Você ainda não morreu, ainda está com bless!, o item some depois de ser utilizado 100 vezes (configurável)

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

Link para o post
Compartilhar em outros sites
  • Solução

script faz com que quando dar use no Item você ganhe todas as Bless.

Em actions.xml adicione:

<action itemid="8977" event="script" value="actionbless.lua"/>

actionbless.lua

local cfg = {
bless = { 1, 2, 3, 4, 5 },
level = 8
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
for i = 1, table.maxn(cfg.bless) do
     if(getPlayerBlessing(cid, cfg.bless[i])) then
         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
         doCreatureSay(cid, "You have already been blessed.", TALKTYPE_ORANGE_1)
         return true
     end
end
if getPlayerLevel(cid) >= cfg.level then
     for i = 1, table.maxn(cfg.bless) do
         doPlayerAddBlessing(cid, cfg.bless[i])
     end
     doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
     doSendAnimatedText(getCreaturePosition(cid), "BLESSED!", TEXTCOLOR_RED)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been blessed by the gods.")
end
return true
end


Créditos: DataPack GlobalWar 

Link para o post
Compartilhar em outros sites
  • 2 years later...

@robi123, você reviveu um tópico antigo com uma mensagem sem relação ao mesmo, leia as regras:
http://www.tibiaking.com/forum/forums/topic/1281-regras-gerais/

 

Sobre seu pedido, crie um tópico na seção de pedidos > scripts:
http://www.tibiaking.com/forum/forums/forum/363-scripts/

 

Link para o post
Compartilhar em outros sites
  • 1 year later...
Em 28/12/2014 em 16:39, f.silva disse:

script faz com que quando dar use no Item você ganhe todas as Bless.

Em actions.xml adicione:


<action itemid="8977" event="script" value="actionbless.lua"/>

actionbless.lua


local cfg = {
bless = { 1, 2, 3, 4, 5 },
level = 8
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
for i = 1, table.maxn(cfg.bless) do
     if(getPlayerBlessing(cid, cfg.bless[i])) then
         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
         doCreatureSay(cid, "You have already been blessed.", TALKTYPE_ORANGE_1)
         return true
     end
end
if getPlayerLevel(cid) >= cfg.level then
     for i = 1, table.maxn(cfg.bless) do
         doPlayerAddBlessing(cid, cfg.bless[i])
     end
     doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
     doSendAnimatedText(getCreaturePosition(cid), "BLESSED!", TEXTCOLOR_RED)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been blessed by the gods.")
end
return true
end


Créditos: DataPack GlobalWar 

cade onde configura pra usar 1 vez é sumir o item?

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo