Só não esquece de colocar isso no spells.xml
direction="1"
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_POFF)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, 0, -1, 0)
local area = createCombatArea({
{0, 1, 0},
{0, 1, 0},
{0, 1, 0},
{0, 3, 0},
})
setCombatArea(combat, area)
function onTargetCreature(cid, target)
if not isNpc(target) then
local player_position = getThingPosition(cid)
local target_position = getThingPosition(target)
local x = (target_position.x < player_position.x and -1 or (target_position.x == player_position.x and 0 or 1))
local y = (target_position.y < player_position.y and -1 or (target_position.y == player_position.y and 0 or 1))
local to_position = {x = target_position.x + x, y = target_position.y + y, z = target_position.z}
if doTileQueryAdd(target, to_position) == RETURNVALUE_NOERROR then
doTeleportThing(target, to_position, true)
end
end
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end






info
Grupo: Visconde
Registrado: 10/02/11
Posts: 377
Reputação: +78
Qual jeito mais facil de fazer uma spell q empurra pra onde o player esta olhando
eu ja vi uns tutoriais por ai
mas n consegui fazer funcionar
queria a base
para tentar entender