• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] detecting destructible count in an area

Status
Not open for further replies.
Level 13
Joined
Sep 29, 2008
Messages
672
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