Ir para conteúdo

Featured Replies

Postado

este script esta funcionando porem eu gostaria que o efeito que ele solta fique ativo por 10 segundos

 

Spoiler

local effect = 169                                 
local function func(cid, position, corpseid, effect)
      if not isCreature(cid) then return true end
      local corpse = getTileItemById(position, corpseid).uid
      if corpse <= 1 then return end
      if not isContainer(corpse) then return true end
      for slot = 0, (getContainerSize(corpse)-1) do
          local item = getContainerItem(corpse, slot)
          if item.uid <= 1 then return end
          if isStone(item.itemid) then
             return doSendMagicEffect(getThingPos(cid), effect)
          end
      end
end
function onKill(cid, target, lastHit)

    if not ehMonstro(target) then return true end
    local corpse = getMonsterInfo(getCreatureName(target)).lookCorpse
    
    addEvent(func, 5, getCreatureSummons(cid)[1], getThingPos(target), corpse, effect)
return true
end

 outra coisa tambem é que nesta linha eu eu quero poder especificar os ids dos itens que ativaram o efeito
if isStone(item.itemid) then
 

ficando algo mais ou menos assim de um jeito funcional claro

 if (item.itemid) = {12401, 12402, 12403, 12404, 12405, 12406, 12407, 12408, 12409, 12410, 12411, 12412, 12413, 12414} then

Postado
local effect = 169
local items = {2173,2160}                                 
function SendCorpseEffect(cid, position, corpseid, effect, delay)
      if not isCreature(cid) then return true end
      local corpse = getTileItemById(position, corpseid).uid
      if corpse <= 1 then return end
      if not isContainer(corpse) then return true end
      for slot = 0, (getContainerSize(corpse)-1) do
          local item = getContainerItem(corpse, slot)
          if item.uid <= 1 then return end
          if isInArray(items,item.itemid) then
           doSendMagicEffect(getThingPos(cid), effect)
	if delay > 0 then
		addEvent(SendCorpseEffect, 1000, cid, position, corpseid, effect, delay-1)
	end
	break
          end
      end
end
function onKill(cid, target, lastHit)
    if not ehMonstro(target) then return true end
    local corpse = getMonsterInfo(getCreatureName(target)).lookCorpse
    SendCorpseEffect(getCreatureSummons(cid)[1], getThingPos(target), corpse, effect, 10)
return true
end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Postado
  • Autor
Em 23/06/2016 at 16:50, Vodkart disse:

local effect = 169
local items = {2173,2160}                                 
function SendCorpseEffect(cid, position, corpseid, effect, delay)
      if not isCreature(cid) then return true end
      local corpse = getTileItemById(position, corpseid).uid
      if corpse <= 1 then return end
      if not isContainer(corpse) then return true end
      for slot = 0, (getContainerSize(corpse)-1) do
          local item = getContainerItem(corpse, slot)
          if item.uid <= 1 then return end
          if isInArray(items,item.itemid) then
           doSendMagicEffect(getThingPos(cid), effect)
	if delay > 0 then
		addEvent(SendCorpseEffect, 1000, cid, position, corpseid, effect, delay-1)
	end
	break
          end
      end
end
function onKill(cid, target, lastHit)
    if not ehMonstro(target) then return true end
    local corpse = getMonsterInfo(getCreatureName(target)).lookCorpse
    SendCorpseEffect(getCreatureSummons(cid)[1], getThingPos(target), corpse, effect, 10)
return true
end

 

por algum motivo não aconteceu nada, sem erro, sem efeito sem nada


fui mechendo e deixei o script assim e funcionou agora falta apenas o timer para pro efeito ser executado por 10 segundos

Spoiler

local items = {11447,11446,12245}     
local effect = 169                                 
local function func(cid, position, corpseid, effect)
      if not isCreature(cid) then return true end
      local corpse = getTileItemById(position, corpseid).uid
      if corpse <= 1 then return end
      if not isContainer(corpse) then return true end
      for slot = 0, (getContainerSize(corpse)-1) do
          local item = getContainerItem(corpse, slot)
          if item.uid <= 1 then return end
          if isInArray(items,item.itemid) then
             return doSendMagicEffect(position, effect)
        
             end
      end
end
function onKill(cid, target, lastHit)

    if not ehMonstro(target) then return true end
    local corpse = getMonsterInfo(getCreatureName(target)).lookCorpse
    
    addEvent(func, 5, getCreatureSummons(cid)[1], getThingPos(target), corpse, effect)
return true
end

 


 

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

Informação Importante

Confirmação de Termo