• 🏆 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] Detecting Damage Type

Status
Not open for further replies.
Level 7
Joined
Mar 13, 2008
Messages
228
well, Unit - A Unit Takes Damage is only availble in GUI in the WEU, but thats not recommended. And making a damage detection sustem in GUI is haaaaard, espesially making it leak free and mui.
Allthoug it is postet damage detection system on the nett somewhere in Jass, dunno the site though.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
well, Unit - A Unit Takes Damage is only availble in GUI in the WEU, but thats not recommended. And making a damage detection sustem in GUI is haaaaard, espesially making it leak free and mui.
Allthoug it is postet damage detection system on the nett somewhere in Jass, dunno the site though.

Damage detection in GUI isn't really hard and most of the time, they don't leak (?)
Maybe you can add a standard ability for every damage type (aura or something that you can check and doesn't do anything), then create a damage detection system (unit enters map area, add event to "damage trigger" unit - unit takes damage).

Then, inside the damage trigger, you can add a few if/then/else-actions that check which ability the attacking unit has (use "Damage source").

If you want me to eplain it further, I will... but this should be understandable :)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Point is, i wanted to check if the damage was spell-based damage or just regular :p

Do you mean whether it's a spell, or spell damage (like the... you know, damage with the spell icon :p).
Well, it's the same idea I guess, but then you only need to create 1 ability, call it "Spell Damage" or something (I'm thinking you can better use the attribute bonus, since you can hide that icon).

Then create only 1 if/then/else, that checks if the unit has the ability, if he doesn't, just don't do anything, if he does... do whatever you want :p
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
Do you want to check if the source of the damage was a spell? If so, you could check the current order of the damaging unit. If it's "attack" or "smart" it's an attack, if not, it's a spell.
 
Level 13
Joined
Mar 16, 2008
Messages
941
That will bug if the attack damage is a projectile and you start a spell afterwards.
The best solution imo is a damage detection system and give an orb ability (frostorb without %-effects (0), a duration of 0.01s and black32.blp as icon) to all units that are able to attack. Just check for the orb effect (buff) in the damage event :)
The biggest problem with this is, that it requires an orb and since most of them don't stack, it limits the possibilities in your map.
 
Status
Not open for further replies.
Top