• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] How to Apply Timed Buff to Unit Group?

Status
Not open for further replies.
Level 4
Joined
Aug 18, 2013
Messages
71
How to Apply Timed Buff to Unit Group? SOLVED

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.

  • 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
  • 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
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.

Solved my Own Problem, I was doing what the ability already does (duration). Silly Me :goblin_boom:
 
Last edited by a moderator:
Status
Not open for further replies.
Top