Ir para conteúdo

Featured Replies

Postado

Queria colocar um  exaust nessa spell

Mostrar conteúdo oculto

 

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

Resolvido por Crypter

Ir para solução
Postado
function onCastSpell(cid, var)
	local cooldown_stg = 90852 -- storage
    local cooldown_time = 10 -- 1 = 1 second
    local numerodehit = 5
    local drena = 1000

    if isMonster(getCreatureTarget(cid))then
        return false
    end

	if exhaustion.check(cid, cooldown_stg) == false then
		exhaustion.set(cid, cooldown_stg, cooldown_time)
		for x=1,numerodehit do
			if isPlayer(getCreatureTarget(cid)) then
			doCreatureAddMana(getCreatureTarget(cid), -drena)
			end
		end
	else
    	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        doPlayerSendCancel(cid, "Spells is on cooldown [" ..exhaustion.get(cid, cooldown_stg).."s].")
        return false
	end
end

 

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

Postado
  • Autor
  Em 11/02/2018 em 19:21, Zanrix disse:

function onCastSpell(cid, var)
	local cooldown_stg = 90852 -- storage
    local cooldown_time = 10 -- 1 = 1 second
    local numerodehit = 5
    local drena = 1000

    if isMonster(getCreatureTarget(cid))then
        return false
    end

	if exhaustion.check(cid, cooldown_stg) == false then
		exhaustion.set(cid, cd_stg, cd_time)
		for x=1,numerodehit do
			if isPlayer(getCreatureTarget(cid)) then
			doCreatureAddMana(getCreatureTarget(cid), -drena)
			end
		end
	else
    	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        doPlayerSendCancel(cid, "Spells is on cooldown [" ..exhaustion.get(cid, cd_stg).."s].")
        return false
	end
end

 

[11/02/2018 16:37:31] [Error - Spell Interface] 
[11/02/2018 16:37:31] data/spells/scripts/sasuke/drenamana.lua:onCastSpell
[11/02/2018 16:37:31] Description: 
[11/02/2018 16:37:31] data/lib/034-exhaustion.lua:28: attempt to perform arithmetic on local 'time' (a nil value)
[11/02/2018 16:37:31] stack traceback:
[11/02/2018 16:37:32]     data/lib/034-exhaustion.lua:28: in function 'set'
[11/02/2018 16:37:32]     data/spells/scripts/sasuke/drenamana.lua:12: in function <data/spells/scripts/sasuke/drenamana.lua:1>

Postado
  • Solução
  Citar

function onCastSpell(cid, var)
    local numerodehit = 5
	local hit_speed = 100 --- quando mais baixo mais rapido
    local drena = 1000
	local tempo_recarga = 1.0
	local storage = 13957
	
	if exhaustion.check(cid, storage) then
		doPlayerSendCancel(cid, "Aguarde "..  exhaustion.get(cid, storage) .." segundos para usar novamente")
		return false
	end
	
    if isMonster(getCreatureTarget(cid))then
        return false
    end

    for x=1,numerodehit do
        if isCreature(cid) and isCreature(getCreatureTarget(cid)) and isPlayer(getCreatureTarget(cid)) then
			addEvent(function()
				doCreatureAddMana(getCreatureTarget(cid), -drena)
			end, x*hit_speed )
        end
    end
	
	return true,exhaustion.set(cid, storage, tempo_recarga)
end

 

Gosto da minha script ne safado, dei uma melhorada nela pra ti, bom uso

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

 

Te ajudei ?? Que tal fazer uma contribuição ?

Doar

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