Aller au contenu

Photo

Scripting Reference: Spell Projectiles (Homing & Ballistic)


  • Veuillez vous connecter pour répondre
Aucune réponse à ce sujet

#1
The Amethyst Dragon

The Amethyst Dragon
  • Members
  • 1 878 messages
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;