LUA:
function onCastSpell(cid, var)
if isPathable(getCreaturePosition(getCreatureTarget(cid))) then
doMoveCreature(variantToNumber(var), Player(cid):getDirection())
end
return doCombat(cid, combat, var)
end
The second line:
isPathable(pos) needs to check for the position behind the target, but so far I can only get the position of the target.
It has to be based on the player direction, so if the player is north from target, it will push them south. And so it happens that I have this line here
Player(cid):getDirection()
But I have no clue how to implement that together in the if statement.
Just to be clear:
doMoveCreature - works fine
if isPathable - it does not work as intended; it needs to check for the position behind the target based on the player:getDirection
TFS 1.0
any help appreciated guys