• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

A fix for A unit is attacked event

Status
Not open for further replies.
Level 6
Joined
Aug 5, 2017
Messages
251
I know there are fixes for the event mentioned at the title. Sure, it works, but it's also buggy. I want a damage detection system that's easy to use and a spell with an example with this dds will help me with this. I hope that spell is MUI. Can anyone help?
 
Level 15
Joined
Feb 7, 2020
Messages
397
If you want something pre-baked, I would take the time to experiment with a system like this Damage Engine 5.5.0.0 which allows complete GUI utilization of damage detection.

The real event that changes on damage is DamageEventAmount == 1.00, which you would use to replace your "unit was attacked" event. You can even get fancy and do things before damage occurs with DamageEventModifider == 1.00 as the real event.

You can check for isDamageSpell == true or DamageEventAttackT == ATTACK_TYPE_HERO etc. to determine attack types.

In your trigger, these values reference the respective units:

DamageEventTarget = unit that was damaged by the attack.
DamageEventSource = unit that attacked.

In your "was attacked" trigger, you could do things for the attacker (DamageEventSource) or the target (DamageEventTarget) by simply using those as the unit variables. If you only want to run a trigger for a specific unit that is attacking, you would include DamageEventSource == [yourDesiredUnitHere] in the trigger condition.

Again, all of these variables are available in the damage engine via GUI.
 
Status
Not open for further replies.
Top