• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Spell] An Aura that give ability to units

Level 11
Joined
Sep 30, 2017
Messages
169
I want to create somewhat of a basic aura spell; it basically gives the Runed braces item ability to other units and the hero spell damage resistance that scales with levels. Level 1 is 15% spell damage resistance, level 2 is 25%, and level 3 is 35%.

How can I make this aura spell?
 
You'd need a timed event that gathers all units with the Aura buff, check if they are in a Unit Group; if they are not, add them in the Unit Group, then add the Spell Resistance (hidden) ability.

After that, check said Unit Group once again; if they don't have the Aura buff (meaning they are away from the aura), remove the Spell Resiscante ability, then remove them from the Unit Group.

I'd suggest a 0.5 interval timer. This wouldn't be extremely precise, but also won't be too intensive for weaker machines/connections.

The Aura Level issue would be trickier: You'd need either to use multiple buffs (one for each aura level), or store the ability level in a variable (which would be troublesome for beginners).
 
You can easily achieve this using a Damage Detection System without having to add/remove the Runed Bracers ability:

Create a custom ability based on an aura like Devotion Aura
Detect when a unit with this aura buff takes damage from spells
Reduce the damage

Example:
  • Spell Damage Reduction
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to True
      • (DamageEventTarget has buff Devotion Aura) Equal to True
    • Actions
      • Set VariableSet DamageEventAmount = (DamageEventAmount x 0.85)
Since you can't detect the level of buffs unless you know their source, you will need to do what Bender suggested above.
 
I made these in the past:
Note that it's not the most efficient thing in the world, but likely better than using a Damage Engine IF you're not using one already.
 
I tried what Warseeker suggested, and it didn't really work. I tried to download Uncle map but i believe it's for Reforged, and i don't have that; I have v1.31.1

I tested it on a unit and ordered another unit to cast fireball on him, and the damage is still the same.


Update: I have changed the number here and there and set everything again, and it seems to be working really well now. Here are the triggers if anyone wants to see them.

Aura spell resistance:

Code:
Blessings Hero
    Events
        Game - DamageEvent becomes Equal to 1.00
    Conditions
        IsDamageSpell Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (DamageEventTarget has buff Blessings of the Dark Queen (Level +1)) Equal to True
            Then - Actions
                Set DamageEventAmount = (DamageEventAmount x 0.85)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (DamageEventTarget has buff Blessings of the Dark Queen (Level +2)) Equal to True
            Then - Actions
                Set DamageEventAmount = (DamageEventAmount x 0.75)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (DamageEventTarget has buff Blessings of the Dark Queen (Level +3)) Equal to True
            Then - Actions
                Set DamageEventAmount = (DamageEventAmount x 0.65)
            Else - Actions
 
Last edited:
I tried what Warseeker suggested, and it didn't really work. I tried to download Uncle map but i believe it's for Reforged, and i don't have that; I have v1.31.1

I tested it on a unit and ordered another unit to cast fireball on him, and the damage is still the same.


Update: I have changed the number here and there and set everything again, and it seems to be working really well now. Here are the triggers if anyone wants to see them.

Aura spell resistance:

Code:
Blessings Hero
    Events
        Game - DamageEvent becomes Equal to 1.00
    Conditions
        IsDamageSpell Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (DamageEventTarget has buff Blessings of the Dark Queen (Level +1)) Equal to True
            Then - Actions
                Set DamageEventAmount = (DamageEventAmount x 0.85)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (DamageEventTarget has buff Blessings of the Dark Queen (Level +2)) Equal to True
            Then - Actions
                Set DamageEventAmount = (DamageEventAmount x 0.75)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (DamageEventTarget has buff Blessings of the Dark Queen (Level +3)) Equal to True
            Then - Actions
                Set DamageEventAmount = (DamageEventAmount x 0.65)
            Else - Actions
A nice optimization would be to drag the bottom two If Then Elses into the Else section above each of them. That way you aren't guaranteed to ask three questions every single time a unit takes damage. You'll also want to order it so the most powerful buffs (higher level) have priority. Here's how it'd look:
  • Blessings Hero
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventTarget has buff Blessings of the Dark Queen (Level +3)) Equal to True
        • Then - Actions
          • Set DamageEventAmount = (DamageEventAmount x 0.65)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DamageEventTarget has buff Blessings of the Dark Queen (Level +2)) Equal to True
            • Then - Actions
              • Set DamageEventAmount = (DamageEventAmount x 0.75)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (DamageEventTarget has buff Blessings of the Dark Queen (Level +1)) Equal to True
                • Then - Actions
                  • Set DamageEventAmount = (DamageEventAmount x 0.85)
                • Else - Actions
With this design you'll ask anywhere from 1 to 3 questions (conditions) depending on which buff the unit has. This also prevents DamageEventAmount from being Set more than once if the unit ends up with multiple different level buffs.

Also, you posted your GUI trigger as code. You can rewrite CODE and /CODE to TRIGGER, /TRIGGER to have it appear properly.
 
Last edited:
Back
Top