Ir para conteúdo
  • Cadastre-se

(Resolvido)Colocar Exaust em spell


Ir para solução Resolvido por Crypter,

Posts Recomendados

Queria colocar um  exaust nessa spell

Spoiler


function onCastSpell(cid, var)
    local numerodehit = 5
    local drena = 1000

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


    for x=1,numerodehit do
        if isPlayer(getCreatureTarget(cid)) then
        doCreatureAddMana(getCreatureTarget(cid), -drena)
        end
    end
end

 

Editado por bismarkzika
fs (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
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)
Link para o post
Compartilhar em outros sites
17 minutos atrás, 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>

Link para o post
Compartilhar em outros sites
  • 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

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