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

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 14
Joined
Feb 7, 2020
Messages
387
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