TO
pedido

Spell da imortalidade!

Por totonho18, 26 de jan. de 2014 em Scripts

4
2.4k
totonho18T
26 de janeiro de 2014 às 22:16

o nome da diz,uma spell que deixe o player imortal por 5 segundos,e ele só poderá usar outra vez 20 segundos depois!

zipter98Z
26 de janeiro de 2014 às 23:26

Suponho que você saiba fazer a tag da spell.

data/spells/você decide:

local msg = "During %d you'll be imortal."
local STORAGE = 91811 
local imortal_time = 5  --Segundos.
function onCastSpell(cid, var)
    if getPlayerStorageValue(cid, STORAGE) > os.time() then
        return doPlayerSendCancel(cid, "Você já está imortal.")
    else
        setPlayerStorageValue(cid, STORAGE, os.time() + imortal_time)
        doPlayerSendTextMessage(cid, 27, msg:format(imortal_time))
    end
    return true
end
data/creaturescripts/scripts:
--[[
    Tags no creaturescripts.xml:
    <event type="statschange" name="Imortal" event="script" value="nome do arquivo.lua"/>
    <event type="login" name="ImortalLogin" event="script" value="nome do arquivo.lua"/>
]]--
local STORAGE = 91811 
function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) then
        if getPlayerStorageValue(cid, STORAGE) > os.time() then
            return false
        end
    end
    return true
end
 
function onLogin(cid)
    registerCreatureEvent(cid, "Imortal")
    return true
end

Editado Janeiro 26 por zipter98

totonho18T
27 de janeiro de 2014 às 19:07

Logo você zipter? pensei que não sabia das spells,mas enfim ficou perfeito kra,e vc kda dia se superando em?

parabéns kra,já n sei nem mais de onde tirar REP+ pra vc,pq vc ta em todas KRA!!!!

 

mas guardei o seu lek,REP+

zipter98Z
27 de janeiro de 2014 às 19:08

Hehe :D

Movido para resolvidos.