[Spell] Mana Draining Aura

Level 17
Joined
Nov 11, 2010
Messages
1,975
How would I create an aura that drains the enemies mana?
If there is triggering involved, please post it.
I prefer GUI/MUI.
Thanks for your time.
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,141
GUI MUI -> best here will be Bride's Unit Indexer found here.

  • init
    • Events
      • Unit - A unit gains new ability
    • Conditions
      • (Hero skill learned) Equal to DrainManaAura
    • Actions
      • Set key = (Custom value of (Triggering unit))
      • Set i = (Level of DrainManaAura) for (Triggering unit)
      • Set BaseDrain = 3.00
      • Set AoE[key] = 900.00
      • Set Drain[key] = (BaseDrain + (i x 3)
      • Unit Group - Add (Triggering unit) to AuraGroup
      • Trigger - Turn of loop <gen>
  • loop
    • Events
      • Time - Every 0.05 seconds of game
    • Conditions
    • Actions
      • Unit Group - Pick every unit in AuraGroup and do Actions
        • Loop - Actions
          • If (All conditions are true) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked unit) is Alive Equal to True
            • Then - Actions
              • Set tempunit = (Picked unit)
              • Set key = (Custom value of tempunit)
              • Set tempp = (Position of tempunit)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units in AoE[key] of tempp matching ((Matching unit) is an enemy to (Owner of tempunit)) and ((Matching unit) is alive Equal to True) and ((Matching unit) is Building Equal to False) and <other conditions if needed>)
                • Loop - Actions
                  • If (All conditions are true) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to No unit
                    • Then - Actions
                      • Unit - Set Mana of (Picked unit) to (Mana of (Picked unit) - (Drain[key]/200)
                    • Else - Actions
              • Custom script: call RemoveLocation(udg_tempp)
            • Else - Actions
      • If (All conditions are true) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (AuraGroup is empty) Equal to True
        • Then - Actions
          • Trigger - Trun off (this trigger)
        • Else - Actions
Customize formula and area of effect, those are just egzamples.
 
Top