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

Detecting damage type

Status
Not open for further replies.
Level 8
Joined
Nov 9, 2008
Messages
502
Hi,
I'm designing an ability that when unit takes damage while ability 'block' is active he will counter attack with a stunning strike.

The problem I'm having is I have laid out damage detection but if the unit is damaged by a persistent source like poison he will continuously counter attack. Also it's my intention to counter only melee attacks so say of the damage type normal.

I can't find in any conditions a way to determine the damage type of damage source. I could do a unit type check on the source but that wouldn't solve the problem of a poisoning attack from a melee unit. I want him to simply counter the melee attack, not the poison effect or other spell based attacks.

Any suggestions?

EDIT:
I use a dummy to cast edited entangling roots on order issue 'defendon' to prevent blocking unit from attacking or moving.
When unit takes damage I play attack animation and order dummy unit to cast edited storm bolt to stun and damage attacker.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
Use an attack damage detection system. Run that with a distance check system and then it should work perfectly.

The attack damage detection system will only run when he takes damage from an attack, and if the unit is further away than X, then it must be ranged.
 
Status
Not open for further replies.
Top