• 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.

Distance between caster and target

Status
Not open for further replies.
Level 2
Joined
Aug 10, 2010
Messages
17
Hi guys!

So I'm making my map and I want to do a triggered spell so I can make custom damage depending on the units stats. I made a trigger that calculates the distance between the caster and the target and it does damage to the target but it's not working correctly. I want to know if there is a way to make it working.

Here's my trigger:
  • Fireball
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Casting unit) Equal to Evelyn_Willow
      • (Ability being cast) Equal to Fireball - Evelyn ================
    • Actions
      • Set Evelyn_Target = (Target unit of ability being cast)
      • Wait (((Distance between (Position of Evelyn_Willow) and (Position of Evelyn_Target)) / 1500.00) - 0.20) seconds
      • Unit - Cause Evelyn_Willow to damage Evelyn_Target, dealing (150.00 + ((Evelyn_Fireball_Skill x Evelyn_Inteligence) + ((Random real number between 1.50 and 2.00) x Evelyn_Elementalism))) damage of attack type Spells and damage type Normal
Can anybody help me with it?


Please?
 
Level 4
Joined
May 25, 2009
Messages
100
so you want to wait a bit, depending on the distance?
I guess, that the (distant / 1500) is smaller than the 0.2 secs so you wait a negative time (Which isn't working, except you invented timetravel^^) and it just stops executing the following code
 
Level 2
Joined
Aug 10, 2010
Messages
17
Thanks! I didn't thought about that. I added a condition to the wait that if the distance between the two units is less than 300 then don't wait at all just do the damage, and it works now.
Thanks again :) +Rep
 
Status
Not open for further replies.
Top