- Joined
- Jul 19, 2008
- Messages
- 37
hi. 
well i created a spell that heals all nearby allies in an area. the closer they are, the greater the heal ( from 50% heal if unit is in max range ( in this case, 300 ), to 150% heal if the unit is dead center ). i havent found the correct formula to do this and it really bugs me that i can figure this out.
My current formula is :
this formula i made seems to be working backwards as if the unit is farther the effect is stronger, im aiming for the opposite...
any ideas?
well i created a spell that heals all nearby allies in an area. the closer they are, the greater the heal ( from 50% heal if unit is in max range ( in this case, 300 ), to 150% heal if the unit is dead center ). i havent found the correct formula to do this and it really bugs me that i can figure this out.
My current formula is :
JASS:
set d = SquareRoot( Pow( GetUnitX( u ) - s.tx, 2 ) + Pow( GetUnitY( u )- s.ty, 2 ) )
set h = 0.5 - ( d / 300 ) // the factor of the heal
any ideas?