mmm there is no event for a unit recives a buff, and the damage system will only work for the debuffs that does damage.
i belive that the only way is checking that every time a unit finishes the effect of an ability. Make a list of all abilitys that have a debuff and if the ability being cast is in that list you remove all debuff from the target of the ability being cast.
I Quote: "I'm making a passive ability which when learned, it removes all debuffs (stun, purge, etc) from the unit. For example, if you casted storm bolt on this unit, the unit will still take damage from the stormbolt but will no be stunned from it."
Purge does not do damage, he only give an example with storm bolt.
Merlinds i don't see your point, you stated something entirely irrelevant, plus the example on storm bolt makes pretty clear that abilities that place buffs will do the damage, but the buff will be removed anyways.
Sadly there's no such thing as "unit gains buff" event, if you want your ability to be passive or have a specific duration you would have to do the periodic timer that removes all harmful buffs.
Another way to make things more accurate is removing the harmful buffs from the unit when it takes damage because most (not every) buff is applied that way.
Maybe you could make your passive ability more interesting, instead of it being constant, make it proc-based. So there is like a 50% chance whenever the hero takes damage to remove all negative buffs, or something like that. :thup:
Dirac, i was answering to gfreak, using a damage detect system will not work because some debuffs does not deal damage.
And again, it is not "accurate" if it does not applies to all debuffs.
So, please read before posting.
And in my opinion the most accurated way is to check when the effect of the ability starts. It will take more work, but will work for every debuff.
I'm on a page about incorrect corrections, and spent the better part of like two hours trying to get someone to understand that -5^2 = -25, not 25, and then that post had comments get reposted because that group is self sustaining, and that person was in turn trying to explain what I just explained to them. And I'm taking that as a victory
I will be AFK for a couple of days you guys hold down the fort while I am gone. I will be checking in on my phone but that will severly limit me. Be back saturday!