• 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.

Reduced damage while under spell effect

Status
Not open for further replies.
Level 10
Joined
Jun 6, 2007
Messages
392
I'm making a spell in vJass, which periodically damages enemy units in a line while channelling. That part is done, now I'd like to expand the spell: the damage of all units within that line is reduced by X%. My plan is to add a modified command aura to units (in periodical loop) if they don't have it already, but removing the ability when the unit is no longer under the spell effect causes problems. It's not very difficult to do, but I'm looking for a simple and efficient way. All my solutions contain unit group handling, which may be very inefficient.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Keep a group which saves the units which are currently under the effect of the spell and iterate over it every so often. If you really want you can turn it off if the spell hasn't been cast recently but that isn't necessary. It's efficient enough and there's no way to get around some degree of ugliness.
 
Status
Not open for further replies.
Top