• It's time to dig through Hive's model database and dust off some oldie but goldie models and enter Hive's Texturing Contest #31 : Repurposing! Click here to enter!
  • 🏆 Hive's 5th HD Modeling Contest: Creep Camp is now open! Click here to enter!

Detecting damage type

Level 8
Nov 9, 2008
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?

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
Jan 18, 2005
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.