So I want to make a hero ability similar to one that League of Legend's Kalista has.
Her ability is called Rend and has a passive effect as well as an activate effect. The passive effect is that her auto attacks store "spears" in the enemies that she strikes, with no limit on how many spears she can stack in them. If she does not attack the target again within several seconds, all the spears in them disappear. This passive does no inherent damage.
However, the active effect is that all enemies with at least 1 "spear" in them consume all the "spear" stacks they have to deal damage (increasing based on how many spears they have) as well as slowing them.
I want to make an ability similar to this, but my WC3 hero has a "passive" ability at level 1 that lets them start stacking these "spears" (in this case called "sins"). I want the hero to stack "Sins" in enemy units struck on each basic attack, stacking infinitely and stacking separately for each unit struck. And if a unit is not attacked within 5 seconds, they lose all the "Sins" stacked on them.
That's the trigger I'm stuck with right now because I have no idea where to begin in doing this. I tried making a boolean variable check true if the unit was attacked, and then after a 5 second wait, set the boolean to false. And then have a separate periodic event trigger (every 0.5 seconds) check all units that might have the boolean = false and to set their number of Sins to 0. But I don't know how to give each unit an individual counter for Sins. I am already using the trigger function Custom Value for something else and I'd rather not use that.
But I feel like my periodic trigger is very bad and will lag the crap out of the game and I don't even think it will work since i dont know how to make the boolean indepedent for each unit.
Please help??
Her ability is called Rend and has a passive effect as well as an activate effect. The passive effect is that her auto attacks store "spears" in the enemies that she strikes, with no limit on how many spears she can stack in them. If she does not attack the target again within several seconds, all the spears in them disappear. This passive does no inherent damage.
However, the active effect is that all enemies with at least 1 "spear" in them consume all the "spear" stacks they have to deal damage (increasing based on how many spears they have) as well as slowing them.
I want to make an ability similar to this, but my WC3 hero has a "passive" ability at level 1 that lets them start stacking these "spears" (in this case called "sins"). I want the hero to stack "Sins" in enemy units struck on each basic attack, stacking infinitely and stacking separately for each unit struck. And if a unit is not attacked within 5 seconds, they lose all the "Sins" stacked on them.
That's the trigger I'm stuck with right now because I have no idea where to begin in doing this. I tried making a boolean variable check true if the unit was attacked, and then after a 5 second wait, set the boolean to false. And then have a separate periodic event trigger (every 0.5 seconds) check all units that might have the boolean = false and to set their number of Sins to 0. But I don't know how to give each unit an individual counter for Sins. I am already using the trigger function Custom Value for something else and I'd rather not use that.
But I feel like my periodic trigger is very bad and will lag the crap out of the game and I don't even think it will work since i dont know how to make the boolean indepedent for each unit.
Please help??