Ir para conteúdo

Juninhofdb

Membro
  • Registro em

  • Última visita

Solutions

  1. Juninhofdb's post in (Resolvido)Summon Spell (Check) was marked as the answer   
    resolvi pode fechar o tópico. segue anexo script corrigido
     
    local t = {
    storage = 9998, -- poe numero de storage aqui que não tenha no servidor
    timer =  2, -- tempo em segundos sem poder usar dinovo
    quant = 1, -- quantidade de monstros sumonados
    summon = "emberwing",  -- poe nome aki
    nMin = 15, -- tempo em minutos aqui da creatura sumir
    effect = CONST_ME_MAGIC_RED
    }
    function onCastSpell(cid, var)
        if exhaustion.check(cid, t.storage) == false then
            if #getCreatureSummons(cid) < t.quant then
                exhaustion.set(cid, t.storage, t.timer * 1)
                local pos = getThingPos(cid)
                local mons = doSummonMonster(cid, t.summon)    
                    if #getCreatureSummons(cid) == 1 then
                        local remover = getCreatureSummons(cid)[1] 
                            addEvent(function()
                            if isCreature(cid) == true then
                            addEvent(doRemoveCreature, 1, remover)    
                            end
                            end, t.nMin * 60 * 1000)
                        
                            doPlayerSendTextMessage(cid, 27, "O summon sera removido em 15 minutos. aproveite!")
                    else
                        for i = 1,#getCreatureSummons(cid) do
                        local remover = getCreatureSummons(cid)                 
                            addEvent(function()
                            if isCreature(cid) == true then
                            addEvent(doRemoveCreature, 1, remover)    
                            end
                            end, t.nMin * 60 * 1000)
                        end
                        doPlayerSendTextMessage(cid, 27, "O summon sera removido em 15 minutos. aproveite!")
                    end
                doSendMagicEffect(pos, t.effect) 
            else
                doPlayerSendTextMessage(cid, 27, "Voce ja tem criatura summonada")
            return false 
            end    
        else
            doPlayerSendCancel(cid, "Pode summonar outro em :  " ..exhaustion.get(cid, t.storage).." segundos.")
            return false  
        end
    return true
    end
     
     

Informação Importante

Confirmação de Termo