• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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