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

[Solved] Area of effect damage help

Status
Not open for further replies.
Level 5
Joined
Jun 13, 2012
Messages
113
  • Unit - Cause Caster to damage circular area after 0.10 seconds of radius 400.00 at (Position of Target), dealing 500.00 damage of attack type Spells and damage type Normal
it deals 500 damage to all units i just want it to damage the enemy unit how can i do that?
 
Level 10
Joined
Jan 20, 2011
Messages
492
You would have to create a loop using Pick Every Unit within your region, then put an if statement within it, and have a condition stating if picked unit is an enemy, then deal the damage, to the picked unit.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
  • Actions
    • Set TempLoc = (Position of (Triggering unit))
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units within 600.00 of TempLoc matching (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
    • Custom script: call RemoveLocation(udg_TempLoc)
The custom script action is to clean the Unit Group leak.
For 'TempLoc', it is to clean the Point leak.
And use Damage Target instead of Damage Area

That trigger above will damage any enemy unit within 600 AOE around the Caster for 500 damage.
 
Status
Not open for further replies.
Top