• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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 64
Joined
Jan 18, 2005
Messages
27,217
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