function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if not isCreature(target) then
doPlayerSendCancel(cid, "You need a target.")
return true
end
local tPos = {x = getThingPos(target).x, y = getThingPos(target).y, z = getThingPos(target).z}
local hp = getCreatureMaxHealth(cid) / 100 * 10
local mana = getCreatureMaxMana(cid) / 100 * 10
doTeleportThing(target, getThingPos(cid))
doTeleportThing(cid, tPos)
doCreatureAddHealth(cid, - hp)
doCreatureAddMana(cid, - mana)
return true
end