• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

getPath

vyctor17

Member
Joined
Oct 17, 2010
Messages
79
Reaction score
13
Can someone help me, I'm trying to make a function that gram showed the path that a distance effect is to be able to script a bow

thanks.
 
Do you mean, just checking if you can attack from position A to B, or having a function return the path between position A and B?
 
I need a function returns the path between the position of A and B to have a distance effect the player stop and hit the player to get in front I already did something similar using more isWalkable function works only in straight lines
 
So if i am player A and attacking player B and there is a distance between us u need to get the walkable path between player A and player B? You want this path for moving creature in it or another purpose.
 
I's an example of what I do, I use the item and throw in a post at x if any man enter in front of the distance effect for the effect distace player and I walk in front takes the hit
Sorry for bad English

another axample:
function onCastSpell(cid, var)
local level = getPlayerLevel(cid)
local mg = getPlayerMagLevel(cid)
local min = -(level *0.28 + mg * 2.34 * 1.0)
local max = -(level * 0.34 + mg * 2.34 * 1.0)

if isCreature(getCreatureTarget(cid)) then
local creaturePos = getCreaturePosition(getCreatureTarget(cid))
creaturePos.stackpos = 255
addEvent(function() if getCreatureTarget(cid) ~= nil then doTargetCombatHealth(cid,getThingfromPos(creaturePos).uid, 1, min, max, 17) doSendDistanceShoot(getCreaturePosition(cid), creaturePos, 31) doSendMagicEffect(creaturePos, 17) return TRUE end end, 17)
return TRUE
else

local n = 6

for i = 1, n do
local newPos = getPositionByDirection(getCreaturePosition(cid), getCreatureLookDirection(cid), i)
newPos.stackpos = 255
if not isWalkable(newPos, false, true, true) or isCreature(getThingfromPos(newPos).uid) or i == n then
doSendDistanceShoot(getCreaturePosition(cid), newPos, 31)
addEvent(function() if isCreature(getThingfromPos(newPos).uid) then
doTargetCombatHealth(cid,getThingfromPos(newPos).uid, 1, min, max, 17)
doSendMagicEffect(newPos, 17) return TRUE else
doSendMagicEffect(newPos, 17) end end, 140)
break
end
end
end
end
use the spell without giving target

the problem and that way she just goes straight I need vah possiçoes at all possible to use in an action
 
Last edited:
okay, I think I get you, explaining better for other posters(correct me if I'm wrong)

He wants a function that'll return every tile an animation moves thru between 2 positions, so that when he casts a spell on a far away creature, if something stands in the middle of them, that something gets the hit, did I got it right?

Ontopic:
the animation doesn't exactly walk over tiles, so there isnt an easy way to do it, the best way would be to use a pathfinding function to get every tile a player would have to walk from point X(the player) to point Y(the target)
 
Yes I think you understand, what I want to do is the same spell so they can use in any direction not only in straight lines
 
Back
Top