So I'm making a spell where, every 4 attacks the hero attacking will be given the barrage skill and it will be taken away after shooting. I'm currently using integers to count the attacks in a trigger and it works for the most part, however, I'm using Bribes damage engine to detect when the attacks land to count and 2 triggers for the task. One to count and the other to give the ability and check when the play has attacked to remove it and re-enable the counter.
The issue is that, since barrage counts as auto-attacks it counts every instance of barrage firing off as a counter towards the next cycle of the trigger. Eg. If there are 3 units around the hero and it fires an attack, it counts all 3 heroes towards the next cycle of 4 attacks, meaning that the hero could, if there are 4 units around, have barrage for every attack.
Is there something I can add to this to remove the extra attacks from being counted, or use a different method of counting?
The issue is that, since barrage counts as auto-attacks it counts every instance of barrage firing off as a counter towards the next cycle of the trigger. Eg. If there are 3 units around the hero and it fires an attack, it counts all 3 heroes towards the next cycle of 4 attacks, meaning that the hero could, if there are 4 units around, have barrage for every attack.
-
CR RisingWinds Count
-
Events
-
Game - DamageEvent becomes Equal to 1.00
-
-
Conditions
-
And - All (Conditions) are true
-
Conditions
-
IsDamageRanged Equal to True
-
DamageEventSource Equal to UnitPlayerCaster[20]
-
(UnitPlayerCaster[20] has buff Rising Winds ) Equal to True
-
-
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
PulsesInteger[5] Less than 3
-
-
Then - Actions
-
Set VariableSet PulsesInteger[5] = (PulsesInteger[5] + 1)
-
Game - Display to (All players) the text: (String(PulsesInteger[5]))
-
-
Else - Actions
-
Game - Display to (All players) the text: Barrage
-
Unit - Add Rising Winds (CR) to UnitPlayerCaster[20]
-
Unit - Set level of Rising Winds (CR) for UnitPlayerCaster[20] to (Level of Rising Winds (CR) for UnitPlayerCaster[20])
-
Trigger - Turn off CR RisingWinds Count <gen>
-
Trigger - Turn on CR RisingWinds Barrage <gen>
-
-
-
-
-
CR RisingWinds Barrage
-
Events
-
Game - DamageEvent becomes Equal to 1.00
-
-
Conditions
-
And - All (Conditions) are true
-
Conditions
-
IsDamageRanged Equal to True
-
DamageEventSource Equal to UnitPlayerCaster[20]
-
(UnitPlayerCaster[20] has buff Rising Winds ) Equal to True
-
-
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
PulsesInteger[5] Greater than or equal to 4
-
-
Then - Actions
-
Game - Display to (All players) the text: Barrage
-
Unit - Remove Rising Winds (CR) from UnitPlayerCaster[20]
-
Set VariableSet PulsesInteger[5] = 0
-
Custom script: call GameTimeWait(.10)
-
Trigger - Turn off (This trigger)
-
Trigger - Turn on CR RisingWinds Count <gen>
-
-
Else - Actions
-
-
-