Testa esse:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
function getDamage(cid, level, magic)
return -(level * 5 + magic * 12), -(level * 5 + magic * 12 + 55)
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getDamage")
function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if target <= 1 then
doPlayerSendCancel(cid, "You need a target.")
return false
end
if not isSightClear(getThingPos(cid), getThingPos(target), false) then
doPlayerSendCancel(cid, "You can't reach that place.")
return false
end
local targetPos = getThingPos(target)
local directions = {0, 1, 2, 3, 4, 5, 6, 7}
local teleportPos = {}
for _ = 1, #directions do
local random = math.random(#directions)
local dir = directions[random]
table.remove(directions, random)
local newPos = getPosByDir(targetPos, dir)
if doTileQueryAdd(cid, newPos, 0, false) == 1 then
teleportPos = newPos
break
end
end
if teleportPos.x and doTileQueryAdd(cid, teleportPos, 0, false) == 1 then
doCombat(cid, combat, var)
doTeleportThing(cid, teleportPos, false)
return true
end
doPlayerSendCancel(cid, "You cannot teleport there.")
return false
end




info
Grupo: Visconde
Registrado: 06/04/11
Posts: 350
Reputação: +8
Char no Tibia: Mulekepirado
galera, a muito tempo estou procurando um spell de teleport que acerta dano, tipo o player ta 4 sqm de distancia do oponente ai o player ataka o oponente e usa a spell, o player é teleportado para o sqm do oponente e acerta dano, eu to com script aki que esta mais ou menos do jhon992, mais ele esta com varios bugs, tipo nao esta gastando mana e nem tirando dano, script:
cara encontrei aki no xtibia um script seu, é um spell de teleport que acerta dano, queria que voce mim ajuda-se pq ela nao esta acertando o dano no oponente, script:
ajude se possivel é claro..