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

[Trigger] Can this be done?

Status
Not open for further replies.
Level 28
Joined
Jan 26, 2007
Messages
4,789
The event "A unit is attacked" is launched when a unit receives an attack order.
This means that at that moment, no damage has been dealt yet and thus it's impossible to know the damage (you can calculate the damage, armor, buffs and abilities of the attacking/attacked unit, but really: that's not worth the pain).

Anyway, if you want to get only an attacking unit (when damage is received) and not a casting unit, I guess you could iflter it with order strings.
 
So you actually need a physical damage detection system. There are plenty of systems that make comparisons (in Jass, this function doesn't exist in GUI), but your main purpose is to get the "attacktype". If this attacktype Equals to 0, which, be default, the AttackType(0) = ATTACK_TYPE_NORMAL, then this is your physical detection system, not flawless, but it will do the job for you.
 
Status
Not open for further replies.
Top