Lua 0.3.7 Checking time for distance effect to reach it's intended destination

Xikini

I whore myself out for likes
Joined
Nov 17, 2010
Messages
3,925
Reaction score
2,046
Lua:
local a = getCreaturePosition(cid)
local b = getCreaturePosition(target)
doSendDistanceShoot(a, b, CONST_ANI_CAKE)
A to B could be 5 tiles, or it can be 100 tiles

There is definitely a time difference depending on the distance traveled.

How do I calculate the time required to traverse the distance?
or
Is there some sort of 'trigger' I can use to tell me when the effect has reached it's destination?
 

Erexo

Kage
Joined
Mar 27, 2010
Messages
677
Reaction score
107
Location
Pr0land
Engine itself doesn't give a damn about the distance, it is not calculated there, this is the client job.
Try to follow that doSendDistanceShoot effect in the TFS, you'll probably end at the protocolgame sending the opcode, coordinates and effect id.
Client will receive that info and parse it accordingly, so no, per se you are unable to get notification about missle reaching its destination. Unless you program client to send such notification to the server (or calculate the time needed for projectile to reach desired tile inside engine).
 
Last edited:
Top