• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

How do i make an aura that affects a specific unit type/s?

Status
Not open for further replies.
Level 4
Joined
Oct 2, 2015
Messages
74
Let's say i want an aura that only affects troll headhunters and grunts, but doesn't affect any other unit type near it. Is it possible to do that? if so, then i'd like to know how.

Thanks in advance.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,579
It's not that complicated. Here's a triggered Aura I made a little while ago that adds attack speed to nearby allied ranged units.

It can be adjusted to add any effect to any type of nearby units:

This adds the Heroes to the Celerity_SourceGroup (the unit group that contains the units that have the Aura ability) and turns on the Loop if needed.
  • Celerity Aura Learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Celerity Aura (Hero)
      • (Level of Celerity Aura (Hero) for (Triggering unit)) Equal to 1
    • Actions
      • Unit Group - Add (Triggering unit) to Celerity_SourceGroup
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Celerity Aura Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Celerity Aura Loop <gen>
        • Else - Actions
This is the periodic trigger that will search for nearby eligible targets for the aura. Targets are contained in the Celerity_TargetGroup.
  • Celerity Aura Loop
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Celerity_TargetGroup and do (Actions)
        • Loop - Actions
          • Set VariableSet Celerity_Target = (Picked unit)
          • Unit - Remove Celerity Aura (Attack Speed) from Celerity_Target
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Celerity_Target is in Celerity_SourceGroup.) Equal to False
            • Then - Actions
              • Special Effect - Destroy Celerity_Sfx[(Custom value of Celerity_Target)]
            • Else - Actions
      • -------- --------
      • Unit Group - Pick every unit in Celerity_SourceGroup and do (Actions)
        • Loop - Actions
          • Set VariableSet Celerity_Source = (Picked unit)
          • Set VariableSet Celerity_Level = (Level of Celerity Aura (Hero) for Celerity_Source)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Celerity_Source is alive) Equal to True
              • Celerity_Level Greater than 0
            • Then - Actions
              • Set VariableSet Celerity_Point = (Position of Celerity_Source)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within 900.00 of Celerity_Point.) and do (Actions)
                • Loop - Actions
                  • Set VariableSet Celerity_Target = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Celerity_Target is alive) Equal to True
                      • (Celerity_Target belongs to an ally of (Owner of Celerity_Source).) Equal to True
                      • (Celerity_Target is A structure) Equal to False
                      • (Celerity_Target is Mechanical) Equal to False
                      • (Celerity_Target is A melee attacker) Equal to False
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Level of Celerity Aura (Attack Speed) for Celerity_Target) Equal to 0
                        • Then - Actions
                          • Unit - Add Celerity Aura (Attack Speed) to Celerity_Target
                          • Unit - Set level of Celerity Aura (Attack Speed) for Celerity_Target to Celerity_Level
                          • Unit Group - Add Celerity_Target to Celerity_TargetGroup
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Celerity_Target is in Celerity_SourceGroup.) Equal to False
                            • Then - Actions
                              • Special Effect - Create a special effect attached to the origin of Celerity_Target using Abilities\Spells\Other\GeneralAuraTarget\GeneralAuraTarget.mdl
                              • Set VariableSet Celerity_Sfx[(Custom value of Celerity_Target)] = (Last created special effect)
                            • Else - Actions
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Celerity_Level Greater than (Level of Celerity Aura (Attack Speed) for Celerity_Target)
                            • Then - Actions
                              • Unit - Set level of Celerity Aura (Attack Speed) for Celerity_Target to Celerity_Level
                            • Else - Actions
                      • Unit - For Celerity_Target, Ability Celerity Aura (Attack Speed), Disable ability: True, Hide UI: False
                      • Unit - For Celerity_Target, Ability Celerity Aura (Attack Speed), Disable ability: False, Hide UI: False
                    • Else - Actions
              • Custom script: call RemoveLocation (udg_Celerity_Point)
            • Else - Actions
              • Unit Group - Remove Celerity_Source from Celerity_SourceGroup.
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Celerity_SourceGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off Celerity Aura Loop <gen>
        • Else - Actions
This trigger adds the Heroes back to the Celerity_SourceGroup after they revive.
  • Celerity Aura Revive
    • Events
      • Unit - A unit Finishes reviving
    • Conditions
      • (Level of Celerity Aura (Hero) for (Triggering unit)) Greater than or equal to 1
    • Actions
      • Unit Group - Add (Triggering unit) to Celerity_SourceGroup
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Celerity Aura Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Celerity Aura Loop <gen>
        • Else - Actions
This is fully MUI. Note that it's designed for Hero Auras, but it can be modified to work for non-Hero Auras as well.

EDIT: Found some bugs, uploaded a fixed version (v.3).
 

Attachments

  • Celerity Aura v.3.w3m
    26.8 KB · Views: 36
Last edited:
Status
Not open for further replies.
Top