Aqui a spell
local time = 3 -- quanto tempo a magia vai dura?
local spelltime = 60 -- em quanto tempo podera solta a magia denovo?
local invisible = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_INVISIBLE)
local outfit = createConditionObject(CONDITION_INVISIBLE, -1, false)
function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 2132312) < os.time () then
doAddCondition(cid, invisible)
doAddCondition(cid, outfit)
setPlayerStorageValue(cid, 2132313, 1)
setPlayerStorageValue(cid, 2132312, os.time () + spelltime)
addEvent(function()
if isPlayer(cid) then
doRemoveCondition(cid, CONDITION_INVISIBLE)
setPlayerStorageValue(cid, 2132313, -1)
doRemoveCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE)
end
end, time * 1000)
else
doPlayerSendCancel(cid, "Voce so pode usar esse magia daqui a "..getPlayerStorageValue(cid, 2132312) - os.time ().." segundos.")
return false
end
return true
end
if getPlayerStorageValue(cid, 2132313) == 1 then
doRemoveCondition(cid, CONDITION_INVISIBLE)
doRemoveCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE)
setPlayerStorageValue(cid, 2132313, -1)
end





info
Grupo: Visconde
Registrado: 21/08/11
Posts: 470
Reputação: +5
Char no Tibia: ...
Preciso de uma magia que faz o player ficar de Ghost por 3 Segundos, só pode usar essa magia a cada 60 segundos.