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

Discussion in 'Support' started by Xikini, Aug 13, 2018 at 2:16 AM.

  1. Xikini

    Xikini I whore myself out for likes

    Nov 17, 2010
    Likes Received:
    Best Answers:
    Code (Lua):
    1. local a = getCreaturePosition(cid)
    2. local b = getCreaturePosition(target)
    3. 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?
    Is there some sort of 'trigger' I can use to tell me when the effect has reached it's destination?
  2. Best Answer:
    Post #2 by Erexo, Aug 14, 2018 at 9:07 PM
  3. Erexo

    Erexo Kage

    Mar 27, 2010
    Likes Received:
    Best Answers:
    Best Answer
    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: Aug 14, 2018 at 9:50 PM
    Xikini likes this.

Share This Page