• 🏆 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!

Detect units hit by an AOE ability?

Status
Not open for further replies.
Level 9
Joined
Sep 28, 2004
Messages
365
Hi all,

I've did my searching but didn't find anything useful. If i miss out a post that has the same question and solved please let me know.

Is it possible to detect units hit by Blizzard for example? I've only able to detect single targeted unit by an ability being cast but i have no idea how to detect units hit by AOE abilities.

Any help would be much appreciated! Thanks in advance to those who help me.
 
Last edited:
Level 8
Joined
Aug 6, 2008
Messages
451
Dont use normal wc3 blizzard, but trigger your own.

This way you can easily make some custom events for example spell damage taken, or unit gets frozen buff or any stuff like that.

Basicly the more you trigger stuff, the more you have control over it.

So forget those wc3 object editor abilities and start writing your own spells.
 
Answer: UnitGroup

Simply make and unit group around certain area (targeted point of ability being cast)

So it would look like

Set UnitGroup = units within 500 of targeted point of ability being cast matching matching unit is a structure equal to false matching unit is an enemy of owner of triggering unit matching unit is alive equal to true

Group with some basic conditions that might come handy.

Of course this would leak, so use custom script: call DestroyGroup(udg_UnitGroup) (In this case else call DestroyGroup(udg_<YourGroupVar>)

Also if you want more info about it, there are plenty of tutorials e.g. basics of mapping, basics of triggering, things that leak...
 
Level 14
Joined
Aug 31, 2009
Messages
775
Each time you make a group and then carry out some actions on said group, you then need to nullify the variable before reusing the group.

For Chain Lightning detection unfortunately it's a hell of a lot harder.
You'd need to simulate the chain lightning effect yourself by using triggers, adding already hit units to a unit group, picking random units in range to fire the next "bolt" at, then firing randomly again (and repeating for as many jumps as needed) - using dummies to cast the bolts.

From there, your unit group has been defined, and hit by an almost identical chain lightning and you can carry out additional actions on that group from there on.
 
Level 9
Joined
Sep 28, 2004
Messages
365
@Damage

Nullify the var means i destroy it with custom script?

I've also recoded every custom spell i want so that i can track them easily

---------------------
I've another question that came up. How do i exactly detect units infront of my caster? Say if i want to create a cleave spell that is active. I do not want to base it off the passive cleave.
 
Status
Not open for further replies.
Top