1º - Crie um arquivo .lua em Data / Spells / Scripts com o nome spellinvisivel e cole isso dentro:
local time = 3
local spelltime = 60
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)
setPlayerGroupId(cid, 2)
setPlayerStorageValue(cid, 2132313, 1)
setPlayerStorageValue(cid, 2132312, os.time () + spelltime)
addEvent(function()
if isPlayer(cid) then
doRemoveCondition(cid, CONDITION_INVISIBLE)
setPlayerStorageValue(cid, 2132313, -1)
setPlayerGroupId(cid, 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
2º - Adicione esta tag em seu spells.xml (data / spells):
3º - Adicione esta tag em seu login.lua (data / creaturescripts / scripts):
if getPlayerStorageValue(cid, 2132313) == 1 then
doRemoveCondition(cid, CONDITION_INVISIBLE)
doRemoveCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE)
setPlayerStorageValue(cid, 2132313, -1)
end
Qualquer erro ou dúvida me informe aqui.







info
Grupo: Visconde
Registrado: 28/06/11
Posts: 356
Reputação: +26
Char no Tibia: Akor Rysea
Olá galera do Xtibia,
Estou aqui novamente enchendo o saco de vocês e novamente preciso de outra Spell.
- A condição da Spell tem que deixar o player invisível por determinado segundos, como se fosse um GM.
Agradeço desde já