[Spell] Help make trigger. Chance to pierce through unit.

I require help creating a trigger for an ability for a ranged Unit.

Impaling Shot:
(Passive) When attacking there is a 10% chance to pierce through and damage to the units within 100 radius behind it. If Impaling shot activates on an organic target level 3 or lower will have its armour reduced by 1. It has a 3 second unit duration and a 1.5 second hero duration.

I'm using Bribes damage system if that helps. What I primarily need help with is acquiring the units behind the primary target and dealing damage
 
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
If you want that armor reduction to stack multiple times you'll have to trigger the reduction yourself. Otherwise you can use Faerie Fire or a negative armor Inner Fire cast by a dummy onto appropriate targets.

What have to do here is largely an exercise in grabbing more units than you need and filtering down to the correct ones. To that end, what you mean by "within 100 radius behind it" changes your approach. Do you mean a half-circle behind the target? Do you mean a line 100 units long behind the target? Do you mean a smaller angle than half-circle?
 
The damage reduction shouldn't be too hard I've done similar stuff with dummies in the passed.

"within 100 radius behind it" - I want it to damage units in a 60~ degree angle within 100~ distance(similar to cleave but in a line) behind the attacked unit.
I'm going to make a diagram. Might be easier to explain what I want that way.

--x x x Blue is my unit. Green is unaffected units.
0x(x)x Red is the attacked unit.
--x x x Orange is the unit I want to damage.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
"within 100 radius behind it" - I want it to damage units in a 60~ degree angle within 100~ distance(similar to cleave but in a line) behind the attacked unit.
I'm going to make a diagram. Might be easier to explain what I want that way.
 

Remixer

Map Reviewer
Level 33
Joined
Feb 19, 2011
Messages
2,112
I want it to damage units in a 60~ degree angle within 100~ distance(similar to cleave but in a line) behind the attacked unit.
In such scenario we have quite a nice set of elements / objects to work with.
First of all, we have the attacking unit (attacker) and the target unit (target). In addition, we have the angle between the units (angle) as well as radius (radius), as well as accepted diversion from the angle (60).

So, essentially what you want to do, is to group up units around the (target) and check which ones of those are in the accepted area - behind the (target) from the (attacker) perspective within (range) and accepted (radius).

Now what makes your situation a lot more difficult is that you are making the splash for a ranged unit, meaning that if your unit uses a missile for attack, you need to store the angle of attack into the missile, and then use that angle to calculate the impale area upon impact. If however, your attack is instantaneous (like rifleman attacks), then we do not need to that, as the attack lands the moment it is fired.

So, the question becomes what kind of attacks does your attacking unit do? If you want to use a missile, you will need to use a custom missile system.
 
Top