• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Bolt Spell deal custom damage on impact

Status
Not open for further replies.
Level 4
Joined
Aug 13, 2009
Messages
57
Hi everyone,
basically ive made a spell based on stormbolt called Gungnir (a spear tossed into the air, falling on a target) where projectile arc is increased to 0.80, and with missile speed on 400.

i want the spell to deal damage ON IMPACT, however in GUI i cant seem to find an event or anything to suit.

i want damage based on hero attributes.

Since the time taken for the spell to hit varies on range, a simple wait dosn't work.

my nearest attempt is a
  • Wait ((Distance between (Position of (Casting unit)) and (Position of (Target unit of ability being cast))) / 200.00) seconds
Any alternatives?
 
Level 8
Joined
Jul 25, 2006
Messages
177
It will work, at least roughly. Save the Caster and Target to unit variables and make 4 real variables: cx, cy, tx, ty. Set cx = Unit - X of Unit with the unit being the caster variable do this for target and repeat with Y of unit now use a custom script action where your wait is and put this in for the custom script.

JASS:
call TriggerSleepAction(SquareRoot(( (udg_tx - udg_cx)  * (udg_tx - udg_cx) ) + ( (udg_ty - udg_cy)  * (udg_ty - udg_cy) ) )) / 400.)

This is not MUI but probably the leakless way to do it without giving you a long lesson.

Your alternative would be to keep what you have just divide by 400 but you will be leaking 2 locations which can get nasty later game if that spell is being cast a lot.

Always divide the distance by projectile speed if you're going to do a very simple impact wait like that.
 
Status
Not open for further replies.
Top