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

Attack Dealt Damage Detect

Status
Not open for further replies.
Level 9
Joined
Aug 7, 2009
Messages
380
How to detect damage of attacked unit when attacked by attacker? You can see.. the war3 understand attacker is a unit that preparing to launch projectile, not when it hurted the attacked unit. So, i'm having a spell which have a % that knockback attacked unit. But my problem is: if that unit does not have enough condition, i'll stop that unit when it's attack. But war3 still get that unit as a attacker, so attacker still not launch the projectile but... attacked unit got knock back. How to fix this? Feel free to ask if not understand :D
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Test map attached.
I mean use the test map attached as your basic trigger
Still, if you want me to trigger the full spell, I can do it for you
I'm doing this to actually let you earn something
 

Attachments

  • Detect Damage.w3x
    12.4 KB · Views: 112
Level 9
Joined
Aug 7, 2009
Messages
380
It's still having problem: When my hero (have that passive skill) attacked a unit, and others unit around attack that unit, it also get knockback. So, i think that is a best solution that you make me a simple spell :) Thanks for advance
 
Level 9
Joined
Aug 7, 2009
Messages
380
I put it already :vw_wtf: but by another way :

  • Trigger 1
  • Events
    • Unit - A unit Is attacked
  • Conditions
    • (Level of Knockback for (Attacking unit)) Greater than 0
    • (Random integer number between 1 and 100) Less than or equal to 15
    • ((Triggering unit) is A structure) Equal to False
  • Actions
    • Trigger - Add to Knockback <gen> the event (Unit - (Attacked unit) Takes damage)
Edit: I already test when attacker does not launched the projectile (does not match condition => stop unit) but still... problem
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Use this trigger:
  • Learn Ability
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • ((Triggering unit) is in DD_Group) Equal to False
      • (Learned Hero Skill) Equal to *ability*
    • Actions
      • Unit Group - Add (Triggering unit) to DD_Group
      • Trigger - Add to *damage detection trigger* the event (Unit - (Triggering unit) Takes damage)
This makes it work for units that have the ability already when map starts:
  • Add2
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Level of *ability* for (Matching unit)) Greater than 0)) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to DD_Group
          • Trigger - Add to *damage detection trigger* the event (Unit - (Picked unit) Takes damage)
 
Status
Not open for further replies.
Top