- Joined
- May 27, 2020
- Messages
- 22
Hello, I've been working on a spell in my map, an item spell to be specific. I've been having troubles with the MUI System.
This is how should my item spell work:
1. When a Hero attacks an enemy (either another Hero or just a unit) with 'this' item, he gains bonus attack speed (I created a custom ability that gives passive attack speed).
2. The bonus attack speed should last for only 5 seconds.
3. After the attack speed buff, there should be a cooldown to prevent gaining another attack speed buff.
These are my triggers:
I am using a Damage Detection System by looking_for_help: [vJASS] - [System] Physical Damage Detection
and the Dynamic Indexing by PurgeandFire: Visualize: Dynamic Indexing
I need help because the Duration and Cooldown of buff doesn't seem to be working right.
This is how should my item spell work:
1. When a Hero attacks an enemy (either another Hero or just a unit) with 'this' item, he gains bonus attack speed (I created a custom ability that gives passive attack speed).
2. The bonus attack speed should last for only 5 seconds.
3. After the attack speed buff, there should be a cooldown to prevent gaining another attack speed buff.
These are my triggers:
-
MacheteAtk
-

Events
-


Game - PDD_damageEventTrigger becomes Equal to 1.00
-
-

Conditions
-


PDD_damageType Equal to PDD_PHYSICAL
-


(PDD_source has an item of type Machete) Equal to True
-


Machete_IsOnCD[Machete_Index] Equal to False
-
-

Actions
-


Set Machete_Index = (Machete_Index + 1)
-


Set Machete_Attacker[Machete_Index] = PDD_source
-


Unit - Add AS (200%) (Machete) to Machete_Attacker[Machete_Index]
-


Set Machete_Duration[Machete_Index] = 5.00
-


Set Machete_CD[Machete_Index] = 30.00
-


Set Machete_IsOnCD[Machete_Loop] = True
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




Machete_Index Equal to 1
-
-



Then - Actions
-




Trigger - Turn on MacheteLoop <gen>
-
-



Else - Actions
-
-
-
-
MacheteLoop
-

Events
-


Time - Every 0.10 seconds of game time
-
-

Conditions
-

Actions
-


For each (Integer Machete_Loop) from 1 to Machete_Index, do (Actions)
-



Loop - Actions
-




Set Machete_Duration[Machete_Loop] = (Machete_Duration[Machete_Loop] - 0.10)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






Machete_Duration[Machete_Loop] Less than or equal to 0.00
-
-





Then - Actions
-






Unit - Remove AS (200%) (Machete) from Machete_Attacker[Machete_Loop]
-






Set Machete_Attacker[Machete_Loop] = Machete_Attacker[Machete_Index]
-






Set Machete_Duration[Machete_Loop] = Machete_Duration[Machete_Index]
-






Set Machete_CD[Machete_Loop] = (Machete_CD[Machete_Loop] - 0.10)
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








Machete_CD[Machete_Loop] Equal to 0.00
-
-







Then - Actions
-








Set Machete_IsOnCD[Machete_Loop] = False
-








Set Machete_IsOnCD[Machete_Loop] = Machete_IsOnCD[Machete_Index]
-








Set Machete_Index = (Machete_Index - 1)
-








Set Machete_Loop = (Machete_Loop - 1)
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










Machete_Index Equal to 0
-
-









Then - Actions
-










Trigger - Turn off (This trigger)
-
-









Else - Actions
-
-
-







Else - Actions
-
-
-





Else - Actions
-
-
-
-
-
I am using a Damage Detection System by looking_for_help: [vJASS] - [System] Physical Damage Detection
and the Dynamic Indexing by PurgeandFire: Visualize: Dynamic Indexing
I need help because the Duration and Cooldown of buff doesn't seem to be working right.
Last edited:



