I need to make an aura that reduces the magic resistance of nearby enemies by 10/20/30/40/50 percent. The easy part is giving enemies who come within range of the "caster" (aura owner, whatever you want to call him) the unit ability based on that runed bracers item thing, with negative values, and leveling it to the level of the aura - that's easy.
Now the part I'm having trouble with is taking that invisible unit ability away once they leave range of the aura, because there isn't a "unit leaves range" event. The suggestions in the old threads about this say to add units coming within range into a group, then check every 0.01 seconds, and if the enemy is not in the aura's AoE anymore (they've moved away from the aura owner) then take away the negative magic resist.
Now I was wondering, is there a more elegant way to handle this? I really hate using brute force periodic triggers, especially with such small time values. On the other hand, setting the timer higher can result in the enemy eating a boatload of extra damage (that they shouldn't have suffered) from an untimely nuke since the trigger was a few fractions of a second too late taking away the negative magic resist.
Ideas?
P.S. Any way to possibly manipulate this with buff checking?
Now the part I'm having trouble with is taking that invisible unit ability away once they leave range of the aura, because there isn't a "unit leaves range" event. The suggestions in the old threads about this say to add units coming within range into a group, then check every 0.01 seconds, and if the enemy is not in the aura's AoE anymore (they've moved away from the aura owner) then take away the negative magic resist.
Now I was wondering, is there a more elegant way to handle this? I really hate using brute force periodic triggers, especially with such small time values. On the other hand, setting the timer higher can result in the enemy eating a boatload of extra damage (that they shouldn't have suffered) from an untimely nuke since the trigger was a few fractions of a second too late taking away the negative magic resist.
Ideas?
P.S. Any way to possibly manipulate this with buff checking?