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á
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á
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.
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):
<instant name="Invisible" words="invisible" lvl="100" mana="100" prem="0" event="script" value="spellinvisivel.lua"></instant>
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.
Bem, erro no console não da, mais o player não fica invisível literalmente, outros jogadores podem ver e atacar e também o invisible não sai, só sai quando eu o ataco. Gostaria que ele ficasse imune por 3 segundos sendo que invisível.
Você tentou com 2 "players" ? Porque se você estiver em algum membro da staff ele vai ver o personagem.
E qual versão do tfs está usando ?
Você tentou com 2 "players" ? Porque se você estiver em algum membro da staff ele vai ver o personagem.
E qual versão do tfs está usando ?
Sim estou tentando com outro 2 "jogadores", ele fica como se eu estivesse usando a magia utana vid e um outro jogador pode atacá-lo.
Estou usando o console OTX server - The OTX Server Version: (2.90 - 4644)
Modifique o arquivo spellinvisivel.lua:
local time = 3
local spelltime = 60
local invisible = createConditionObject(CONDITION_GAMEMASTER, -1, true, GAMEMASTER_INVISIBLE)
local outfit = createConditionObject(CONDITION_INVISIBLE, -1, true)
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
Modifique o arquivo spellinvisivel.lua:
local time = 3
local spelltime = 60
local invisible = createConditionObject(CONDITION_GAMEMASTER, -1, true, GAMEMASTER_INVISIBLE)
local outfit = createConditionObject(CONDITION_INVISIBLE, -1, true)
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
Continua da mesma forma vou te mandar um script para voce que funcionou, só que eu gostaria que não aparece no default o nome /ghost, não sei se tem como mais vou te pedir assim mesmo.
Segue ai:
function onCastSpell(cid, var)parameters = {cid=cid}setPlayerGroupId(cid, 2)doCreatureExecuteTalkAction(cid, "/ghost", TRUE)addEvent(talk, 3000, parameters) return trueendfunction talk(parameters)doCreatureExecuteTalkAction(parameters.cid, "/ghost", TRUE)setPlayerGroupId(parameters.cid, 1)endend
Sobeeee , ajuda ai meu povo
( risos )
Up
Upp
Tambem to precisando
Pode fechar o tópico ja consegui. , vou fazer um tutorial pra ajuda a comunidade rs.
Tópico movido para dúvidas / pedidos resolvidos.
Antenciosamente, Mudrock
Mensagens privadas somente sobre outros assuntos!
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.
MudrockAprova#
- EkzGuard