Hello guys I need help with my trigger, its doing what it should but not completely. What am I trying to achieve here is that when a hero with a buff (Infused Daggers) attacks 3 times, the buff will be removed on him and on the 3rd attack will slow the enemy unit. That part is okay, the part that is not working is when the hero didn't attack 3 times and the buff dissapear, the variable Set Infused_Count[TempInteger] = 0 doesn't set to 0. So when the hero has the buff again his 1st attack will slow the enemy and the buff is gone.
-
Infused Dagger Damage
-
Events
-
Game - DamageEvent becomes Equal to 1.00
-
-
Conditions
-
(DamageEventSource has buff Infused Daggers ) Equal to True
-
IsDamageSpell Equal to False
-
-
Actions
-
-------- ------------------------------------------------------------------------------------------------- --------
-
-------- Getting the Spell constants --------
-
-------- ------------------------------------------------------------------------------------------------- --------
-
Set Temp_Unit = DamageEventSource
-
Set TempInteger1 = (Custom value of Temp_Unit)
-
Set Infused_Count[TempInteger] = (Infused_Count[TempInteger] + 1)
-
-------- ------------------------------------------------------------------------------------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Infused_Count[TempInteger] Equal to 3
-
-
Then - Actions
-
Set Temp_Target = DamageEventTarget
-
Set TempPlayer = (Owner of Temp_Unit)
-
Set Temp_Location = (Position of Temp_Target)
-
Set TempAbility = All Purpose Slow (Dummy Ability)
-
Unit - Create 1 Dummy Unit for TempPlayer at Temp_Location facing Default building facing degrees
-
Set Temp_Dummy = (Last created unit)
-
Unit - Add a 1.50 second Generic expiration timer to Temp_Dummy
-
Unit - Add TempAbility to Temp_Dummy
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Temp_Target is alive) Equal to True
-
(Temp_Target is A structure) Not equal to True
-
(Temp_Target is Magic Immune) Not equal to True
-
-
Then - Actions
-
Unit - Order Temp_Dummy to Human Sorceress - Activate Slow
-
Unit - Order Temp_Dummy to Human Sorceress - Slow Temp_Target
-
Set Infused_Count[TempInteger] = 0
-
Unit - Remove Infused Daggers buff from Temp_Unit
-
Custom script: call RemoveLocation(udg_Temp_Location)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Temp_Unit has buff Infused Daggers ) Equal to False
-
-
Then - Actions
-
Set Infused_Count[TempInteger] = 0
-
-
Else - Actions
-
-
-
-
-
Else - Actions
-
-
-