Author Topic: Scripting Reference: Spell Projectiles (Homing & Ballistic)  (Read 156 times)

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
Scripting Reference: Spell Projectiles (Homing & Ballistic)
« on: March 18, 2011, 10:11:09 pm »


               Just an brief reference for scripters that might be working with spell projectiles.  I figured these out by way of reading the old forums plus some experimentation.  If anyone else comes up with more accurate numbers, feel free to post updated equations.

Useful for when you want to time a spell's effect to a projectile (without the projectile actually carrying the effect along like with fireball).  In my testing I was able to match up the striking of a projectile with the application of a visual effect on the target quite nicely.

Projectile Type (ProjType): homing
Delay between casting and hitting target:
float fDistance = GetDistanceBetween(oCaster, oTarget);
float fDelay = 0.3 + (fDistance * 0.03);

Projectile Type (ProjType): ballistic
Delay between casting and hitting target:
float fDistance = GetDistanceBetween(oCaster, oTarget);
float fDelay = (fDistance/(3.0 * log(fDistance) + 2.0)) + 0.045;