local newPos1 = {x = 0, y = 0, z = 0} --pos pra onde sera levado o caster da spell
local newPos2 = {x = 242, y = 1056, z = 4} --pos pra onde sera levado o target
local time = 20 --tempo pra teleporta devolta, em segs
local function teleport(cid, pid, pos, pos2)
if isCreature(pid) then
doTeleportThing(pid, getClosestFreeTile(pid, pos2 or pos))
doSendMagicEffect(getPlayerPosition(pid), 75)
end
end
function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if not isCreature(target) or not isPlayer(target) then
return doPlayerSendTextMessage(cid, 27, "Voce So Pode Usar Essa Spell Em Players e Fora de Exames,Arenas,Quests")
end
if getPlayerStorageValue(cid, 33333) < os.time () then
local target = getCreatureTarget(cid)
local posCid = getPlayerPosition(cid)
local posTarget = getPlayerPosition(target)
setPlayerStorageValue(cid, 33333, os.time () + 200)
doSendMagicEffect(posCid, 30)
doSendMagicEffect(posTarget, 196)
teleport(cid, target, newPos1, newPos2)
addEvent(teleport, time*1000, cid, target, posCid, posTarget)
else
doPlayerSendCancel(cid, " VOCE SÓ PODE USAR DAKI A "..getPlayerStorageValue(cid, 33333) - os.time ().." SEGUNDOS ")
end
return true
end
Nesse
local DESTINO = {x = 1109, y = 581, z = 7}
local TEMPO_PARA_VOLTAR = 20 * 1000 -- em ms
local events = {}
local dbfunc = db and type(db.executeQuery) == "function" and db.executeQuery or
db and type(db.query) == "function" and db.query or error
local function teleport_back(guid, position)
local cid = getPlayerByGUID(guid)
if isCreature(cid) then
doTeleportThing(cid, position)
doSendMagicEffect(position, CONST_ME_TELEPORT)
else
dbfunc("UPDATE players SET posx = "..position.x..", posy = "..position.y..", posz = "..position.z.." WHERE id = "..guid)
end
events[guid] = nil
end
function onCastSpell(cid)
local pos, guid = getThingPos(cid), getPlayerGUID(cid)
if events[guid] then
return not doPlayerSendCancel(cid, "You can't cast this spell now!")
end
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
doTeleportThing(cid, DESTINO)
doSendMagicEffect(DESTINO, CONST_ME_TELEPORT)
events[guid] = addEvent(teleport_back, TEMPO_PARA_VOLTAR, guid, pos)
return true
end
Pergunta
SkyDarkyes 104
Teria como colocar um Exasted igual desse SCRIPT:
Nesse
Link para o comentário
https://xtibia.com/forum/topic/221048-colocar-exausted/Compartilhar em outros sites
5 respostass a esta questão
Posts Recomendados