• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

I need formulas/constants!!!

Status
Not open for further replies.
Level 9
Joined
Oct 11, 2009
Messages
477
As the title says.... I need formula for real values for the following:

a. damage improvement on unit as it gets closer to the target point.
b. magnitude of camera shaking for each player based on the distance of current camera view of player from target point.
c. when a unit got caught in an explosion, it's flying height(thrown away by the explosion) increases as it gets closer to the origin of the explosion.



THANKS IN ADVANCE!!! :D :D :D
 
For A, B, C just calculate the distance of the unit from the target point using the Squareroot(x*x + y*y) and do whatever you want
JASS:
local real dx = GetUnitX(Unit) - GetSpellTargetX()
local real dy = GetUnitY(Unit) - GetSpellTargetY()
local real DamageFactor = 1 - (SquareRoot(dx*dx + dy*dy))/[MaxDistance or Radius]
//this will make it stronger as the unit gets close, just multiply damage by damagefactor but it can only be 100% if the unit is in the target point
//anyway its just an example, basically you just need to get the distance between the unit and the target point and do what you want with it


and oh, you're pinoy too...
 
Status
Not open for further replies.
Top