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

[Trigger] detecting destructible count in an area

Status
Not open for further replies.
Level 13
Joined
Sep 29, 2008
Messages
671
I was making a spell that damages a unit equal to the nearby trees around the target unit. More of nature's wrath. I don't know how I can detect the destructible count in the:
Destructible - Pick every destructible within 300.00 of (Position of Target Unit of Ability Being Casted) and do (Actions)
Loop - Actions
 
Level 7
Joined
Jul 20, 2008
Messages
377
  • Set TargetPos = Position of (Target unit of ability being cast)
  • Destructible - Pick every destructible within 300.00 of TargetPos and do (Actions)
    • Loop - Actions
      • Set counter = (counter + 1)
  • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing (Real(counter)) damage of attack type Spells and damage type Normal
 
Level 13
Joined
May 11, 2008
Messages
1,198
that's probably ok but don't forget to reset it to zero at the end so when you cast it again the damage isn't cumulative with each cast doing more damage than before assuming trees are around. he's setting it plus every time so you'll need to reset it to 0 at the end. unless of course you want the spell to get more powerful everytime you cast it.
 
Status
Not open for further replies.
Top