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

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