komapatient
New Member
- Reaction score
- 10
Okay, I need some help. Currently I am working on a project where barrack-type units gain XP by either attacking or killing enemy units.
I got the basic triggers working and doing fine with one small issue I noticed.
To detect if a unit attacks another unit and earns itself a bit of XP I use the General Unit event 'A unit is attacked'.
The issue I discovered is whenever a unit has a respectively long charge attack time (fiends or mountain giants take a long time to actually finish their attack) a player is able to retreat the unit from attacking in the last part of the striking blow so that the General unit event trigger rolls but actually no damage is dealt. Good players can abuse this to level up their units on a simple level 1 creep with no effort and I bet they will and this would render my map unplayable!
The event says: 'A unit is attacked'. So I assumed it will be damaged - unfortunately it seems to mean: 'A unit is about to be attacked'.
How can I check if a unit actually got hurted by a strike of an attacker so my trigger can pay XP to the attacker only when actually damage was dealt?
I got the basic triggers working and doing fine with one small issue I noticed.
To detect if a unit attacks another unit and earns itself a bit of XP I use the General Unit event 'A unit is attacked'.
The issue I discovered is whenever a unit has a respectively long charge attack time (fiends or mountain giants take a long time to actually finish their attack) a player is able to retreat the unit from attacking in the last part of the striking blow so that the General unit event trigger rolls but actually no damage is dealt. Good players can abuse this to level up their units on a simple level 1 creep with no effort and I bet they will and this would render my map unplayable!
The event says: 'A unit is attacked'. So I assumed it will be damaged - unfortunately it seems to mean: 'A unit is about to be attacked'.
How can I check if a unit actually got hurted by a strike of an attacker so my trigger can pay XP to the attacker only when actually damage was dealt?