- Joined
- Aug 18, 2013
- Messages
- 71
How to Apply Timed Buff to Unit Group? SOLVED
Solved my Own Problem, I was doing what the ability already does (duration). Silly Me
Hi Guys, after the discovery of MUI ability making via Indexing, I'm trying to make all my abilities work in this fashion. I'm currently attempting to create an ability that applies a buff to units in a target area. But am getting confused on how I should continue.
I want the buff (The buff is applied by the spell), to be removed when the counter reaches 4 and level of "Blood Mana Curse" equals 1, or when the counter reaches 5 and level of "Blood Mana Curse" equals 2, and so forth.
I'm slowly adding code and understanding what I need to do next, but its a very tedious process to do all the calculations in my head.
Could someone point me in the right direction.
-
Blood Mana Catch
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Blood Mana Curse
-
Actions
- Set BloodManaCurse_Max_Index = (BloodManaCurse_Max_Index + 1)
- Set BloodMana_Caster[BloodManaCurse_Max_Index] = (Casting unit)
- Set BloodMana_Counter[BloodManaCurse_Max_Index] = 0
- Set BloodMana_TargetUnitGroup[BloodManaCurse_Max_Index] = (Units within 400.00 of (Target point of ability being cast) matching (((Matching unit) belongs to an enemy of (Owner of BloodMana_Caster[BloodManaCurse_Max_Index])) Equal to True))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- BloodManaCurse_Max_Index Equal to 1
-
Then - Actions
- Trigger - Turn on Blood Mana Loop <gen>
- Else - Actions
-
If - Conditions
-
Events
-
Blood Mana Loop
-
Events
- Time - Every 1.00 seconds of game time
- Conditions
-
Actions
-
For each (Integer BloodManaCurse_Current_Index) from 1 to BloodManaCurse_Max_Index, do (Actions)
-
Loop - Actions
- Set BloodMana_Counter[BloodManaCurse_Current_Index] = (BloodManaCurse_Current_Index + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Blink_Counter[Blink_Current_Index] Equal to 4
- (Level of Blood Mana Curse for BloodMana_Caster[BloodManaCurse_Current_Index]) Equal to 1
-
Then - Actions
- Unit - Remove Blood Mana Curse (Level 1) buff from BloodMana_Temp_Unit[(Integer B)]
- -------- Cleanup below --------
- Set BloodMana_Counter[BloodManaCurse_Current_Index] = BloodMana_Counter[BloodManaCurse_Max_Index]
- -------- --------
- Custom script: call DestroyGroup(udg_BloodMana_TargetUnitGroup[udg_BloodManaCurse_Current_Index])
- -------- Do I need this ^^ to prevent leaks? --------
- -------- --------
- Set BloodMana_TargetUnitGroup[BloodManaCurse_Current_Index] = BloodMana_TargetUnitGroup[Blink_Max_Index]
- Set BloodManaCurse_Max_Index = (BloodManaCurse_Max_Index - 1)
- Set BloodManaCurse_Current_Index = (BloodManaCurse_Current_Index - 1)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Blink_Max_Index Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Loop - Actions
-
For each (Integer BloodManaCurse_Current_Index) from 1 to BloodManaCurse_Max_Index, do (Actions)
-
Events
I'm slowly adding code and understanding what I need to do next, but its a very tedious process to do all the calculations in my head.
Could someone point me in the right direction.
Solved my Own Problem, I was doing what the ability already does (duration). Silly Me
Last edited by a moderator: