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

[Trigger] Count when attack occurs

Status
Not open for further replies.
Level 4
Joined
Mar 23, 2008
Messages
90
is there a way to see when the damage is done cause i got an unit that when he attacks a explosion occurs at the attacked units place.i cant find a unit takes damage event.
i got these triggers
  • Zoanthrope
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Zoanthrope
    • Actions
      • Unit - Cause (Attacking unit) to damage circular area after 2.00 seconds of radius 300.00 at (Position of (Attacked unit)), dealing 100.00 damage of attack type Siege and damage type Poison
      • Wait 1.50 seconds
      • Special Effect - Create a special effect at (Position of (Attacked unit)) using war3mapImported\EarthNova.mdx
      • Wait 1.00 seconds
      • Special Effect - Destroy (Last created special effect)
 
Level 10
Joined
Sep 6, 2008
Messages
423
Here you have a way of detecting when a unit is damaged.
  • Detect Damage Enter
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to Detect Damage <gen> the event (Unit - (Triggering unit) Takes damage)
  • Damage Detect
    • Events
    • Conditions
    • Actions
      • Floating Text - Create floating text that reads (String((Damage taken))) above (Triggering unit) with Z offset 0.00, using font size 9.00, color (100.00%, 0.00%, 0.00%), and 20.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 120.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
Note that this is just an example and all the actions you want to happen should be put inside Trigger #2.
 
Level 7
Joined
Oct 14, 2008
Messages
340
also, if you use the wait depending on distance between them, if the target is moving away it will trigger early, if the target is moving toward it will trigger late, and it will trigger on misses, damage detection system is the only way to really take care of that problem :/
 
Status
Not open for further replies.
Top