| 05-05-2004, 05:15 AM | #1 |
I've been trying to create a passive hero ability that will return a % of damage inflicted on the hero from a targeted spell. The hero still takes full damage - no spell damage reduction. For example: My hero has the (tentatively named) Backdraft skill at Level 1, which is 15% damage return. If someone casts a 100-damage firebolt at me, I take regular damage from it, and the caster of the firebolt takes 15 damage (15% of 100). I've tried a couple of methods of achieving this, but have yet to succeed. I really don't want to set up a bunch of variable arrays to store the damage for every spell in my map and then just use a trigger to detect the spell that is cast. Is it possible to use the "takes damage" Specific Unit Event (adding it for the specific hero via another trigger if the hero is chosen) and somehow make it recognize the damage source? Can I make it tell the difference between a targeted spell dealing damage versus a regular attack or an Area of Effect spell? P.S. If something similar is answered in a previous post, I apologize, but my forum search didn't turn up the info I needed. |
| 05-05-2004, 06:05 PM | #2 |
I don't think that is possible. The only workaround I can think of isn't realy a good one, but I think it will work. You can detect when the hero is targeted by a spell, then store his life in a variable and wait 0.1 seconds and the set the damage variable to be the life variable - the current life of the hero. It isn't very good, because if another source deals damage in the 0.1 seconds, the damage variable is increased. |
