• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Multi shot using auto cast ability

Status
Not open for further replies.
Level 20
Joined
Aug 13, 2013
Messages
1,696
Is it possible to trigger the auto cast ability with a multi shot? Like cold arrows or searing fire but released on a multi shot? Also the mana spent is based on how many arrows are released.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
I uploaded a map with a multishot ability that I created. The ability can be toggled on and off and will cost additional mana for each target hit. When toggled on it will split the archer's attacks hitting up to 3 targets, dealing bonus damage and applying a slow. You can even manually cast the ability yourself for the same effect.

It doesn't work perfectly but I think it should lead you in the right direction.

It requires the latest patch and uses Bribe's Damage Detection System (which supports both JASS and Lua).



Some issues/notes:
1) Normal arrows will apply the multishot slow effect if the multishot ability is toggled on at the time of impact. This is because the slow is applied using the DDS and the DDS checks whether or not the source of the Damage is in the Multishot Unit Group (which it will be if the ability is toggled on). I don't know how to avoid this but I'm sure there's a way.

2) When calculating the mana cost of the ability in situations against moving targets you'll notice that it doesn't always work properly. That's because I rely on triggers using the "a unit is attacked" and "a unit begins casting an ability" to do this. The problem with those Events is that they go off before the arrow is actually launched so there's a small window of time in which the units/targets can change. If you can figure out a way to detect how many targets there are at the exact moment of launching the arrow then you can fix this issue.

3) I wasn't sure on how to properly calculate the range for the Pick every unit within range function. Currently I add the Archer's collision size (32) + Attack Range (600) but in some cases this doesn't work. Maybe someone knows how this is normally calculated?

4) You'll want to remove any Units using this ability from the Multishot Unit Group when they die. This will help with performance and fix a bug for dying/reviving heroes using the ability.

5) Multiple Shot Ability Here's a link to how Barrage works.
 

Attachments

  • Multishot.w3x
    52.2 KB · Views: 51
Last edited:
Status
Not open for further replies.
Top