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

Need help with a vJass ability

Status
Not open for further replies.
Level 3
Joined
Nov 28, 2008
Messages
24
Hi. I'm currently learning vJass. I want to make an ability called 'Bouncing Shot' but I don't know how to get started with the trigger. I want to make this ability using vJass. Here's a description of the ability :

Bouncing Shot
When auto-casting is enabled, every arrow she shoots bounces 3 times. Her arrows deal 2 x her agility to the first unit and the damage halves for every successive bounce.

This ability can be auto-cast by right clicking on the icon
Here's what I came up with so far :

Bouncing Shot
*Trigger detects damage is taken by the attacked unit (a). This gives me a headache -.-
*Damages the attacked unit for 2 x Ranger's agility.
*A dummy unit is created at position of (a) to cast the dummy Bouncing Shot ability to a random enemy unit (b) within 400 AoE (If no enemy units are found within the area, arrow will not bounce).
*When the arrow hits (b), it deals 1/2 of 2 x Ranger's agility.
*Another dummy unit is created at position of (b) to cast the dummy Bouncing Shot ability to a random enemy unit (c) within 400 AoE.
*When the arrow hits (c), it deals 1/4 of 2 x Ranger's agility.
*This process continues for up to 3 bounces to make it look like as if it's bouncing.

The Dummy Bouncing Shot ability is used for showing the projectile (the arrow)
1. I couldn't figure out how to use vJass to detect damage is taken by the attacked unit. So, please show me in vJass, how to detect damage is taken by the attacked unit.

2. Can the whole thing be made into just 1 trigger? If so, how to do it?

Help will be appreciated.
 
Level 4
Joined
Aug 8, 2011
Messages
84
I've made something similar to this using dummies who cast an acid bomb based spell as an arrow projectile.

Basically just create a number of dummy units on top of the target unit, the dummies then cast their arrow at adjacent targets, then repeat for targets hit.
 
Level 4
Joined
Aug 8, 2011
Messages
84
It can be done using a timer that waits an amount of time based on target distance/missile speed.

Obviously there may be some small inconsistencies with targets that are far away and moving away, but it allows to handle the situation relatively easily.
 
Level 3
Joined
Nov 28, 2008
Messages
24
Thanks Ameranth and Adiktuz. I think I've got the solution :). Thanks again...oh, and added rep;)
 
Status
Not open for further replies.
Top