Hey just decided to implement such passive skill and found that this is pretty difficult task. So the concept is: for each attacker that uses weapon against unit it(unit) gets +5 damage bonus (or some other stat boosts). This bonus should be canceled immediately after attacker stops attacking. So i have problems with this cancellation of bonuses and how to determine conditions for this action. Help anyone? :)
Something similar could be achieved through the data editor using a damage response buff. Basically, every time the unit takes damage, execute an effect which applies the stacking stat boost behavior (which only lasts around 1-2 seconds.) This would come into effect more from the volume of attacks than the number of attacking units. I'm not sure exactly how complex you need it to be.
Going with triggers to do this may be a bit more straightforward than you think. It would be similar to this, with perhaps a little tweaking:
Thanks man this almost work. But i have 1 stack of behaviour always remain why is that?
Besides, even if enemies just chasing my hero with this abil he still has this bonus which is undesirable :/
Thanks man this almost work. But i have 1 stack of behaviour always remain why is that? Besides, even if enemies just chasing my hero with this abil he still has this bonus which is undesirable :/
In that case you can add a condition in the while loop which checks the distance between the attacking unit and your special unit. That would be the simple solution.
The complex solution is to add another effect to the attacking unit's weapon which adds an invisible buff to the target. Give the buff a duration equal to the weapon's period. Then you just need to check to see if the target has the new invisible buff - if so, then the target is being fired at, if not, then the attacker is out of range or otherwise unable to attack.
I'm not sure why 1 stat boost buff is staying on the unit. Check to make sure no other units are currently ordered to attack it. Also check what the special unit's custom value 0 is. The number of buff stacks on the unit should always equal whatever its custom value 0 is.
Thats something i made from start (with weapon period) :) but this approach is not that polished as i wanted (random delay on weapon, missile speed, movers, etc) anyway thanks for your aid.
Hey just decided to implement such passive skill and found that this is pretty difficult task. So the concept is: for each attacker that uses weapon against unit it(unit) gets +5 damage bonus (or some other stat boosts). This bonus should be canceled immediately after attacker stops attacking. So i have problems with this cancellation of bonuses and how to determine conditions for this action. Help anyone? :)
@abvdzh: Go
Something similar could be achieved through the data editor using a damage response buff. Basically, every time the unit takes damage, execute an effect which applies the stacking stat boost behavior (which only lasts around 1-2 seconds.) This would come into effect more from the volume of attacks than the number of attacking units. I'm not sure exactly how complex you need it to be.
Going with triggers to do this may be a bit more straightforward than you think. It would be similar to this, with perhaps a little tweaking:
Thanks man this almost work. But i have 1 stack of behaviour always remain why is that? Besides, even if enemies just chasing my hero with this abil he still has this bonus which is undesirable :/
In that case you can add a condition in the while loop which checks the distance between the attacking unit and your special unit. That would be the simple solution.
The complex solution is to add another effect to the attacking unit's weapon which adds an invisible buff to the target. Give the buff a duration equal to the weapon's period. Then you just need to check to see if the target has the new invisible buff - if so, then the target is being fired at, if not, then the attacker is out of range or otherwise unable to attack.
I'm not sure why 1 stat boost buff is staying on the unit. Check to make sure no other units are currently ordered to attack it. Also check what the special unit's custom value 0 is. The number of buff stacks on the unit should always equal whatever its custom value 0 is.
Thats something i made from start (with weapon period) :) but this approach is not that polished as i wanted (random delay on weapon, missile speed, movers, etc) anyway thanks for your aid.