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

Evasion Aura

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
150? thats melee range...

you could just enum every 0.25 seconds and add the abil and save to group and if the unit goes away remove it

or use damage event and check if the unit is within range of a unit within the aura and random int between 1 and 4 is 1 than remove damage
 
Level 10
Joined
May 25, 2021
Messages
376
@Pyrogasm

Hello there! I download this Spell somewhere I don't remember.

The trigger below is not original from its creator, I changed it from a hero's learning ability to a unit's ability.

Evasion Aura:
  • Evasion Aura
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set EvasionGroup = (Units in (Entire map) matching (((Matching unit) has buff EvasionBuff ) Equal to True))
      • Set NotEvasionGroup = (Units in (Entire map) matching (((Matching unit) has buff EvasionBuff ) Not equal to True))
      • Unit Group - Pick every unit in EvasionGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • EvasionLevel Equal to 1
            • Then - Actions
              • Unit - Remove Evasion (Spell Book) from (Picked unit)
              • Unit - Add Evasion (Spell Book) to (Picked unit)
              • Unit - Set level of Evasion (Passive) for (Picked unit) to 1
              • Player - Disable Evasion (Spell Book) for (Owner of (Picked unit))
            • Else - Actions
              • Do nothing
Evasion Aura Level:
  • Evasion Aura Level
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) has buff EvasionBuff ) Equal to True
    • Actions
      • Set EvasionLevel = 1
It works fine but not perfectly. I mean, it makes Units and Heroes in its range of effect unable to target their abilities, and Heroes alone unable to pick new abilities. Within its vicinity, everytimes I click the red plus button of a hero, it goes back to the basic UI right away; and everytimes I click an available ability of a unit or hero, it's unclicked automatically.

FYI: The original spell is attatched.
 

Attachments

  • Evasion Aura 2.w3x
    18.8 KB · Views: 6
Level 42
Joined
Feb 27, 2007
Messages
5,298
There is so much wrong here. Like almost literally every single line of both triggers is either: not doing what you think it is, unnecessary, has no functional purpose, doesn't achieve the goal of an evasion aura, or ignores something important. Instead of trying to fix it I'll give you the cliffs notes:
  • Don't use Entire Map, use Playable Map Area; a unit will never be out of this area.
  • Every unit on the map is in one of the two groups, so you might as well just subtract the evasion group from the group of all units in the map instead of searching over them all twice.
  • Should just store the evasion group and re-use it for the next cycle, since those are all the units that will have the evasion ability next time you check (to remove the ability from those without the buff).
  • Both groups leak.
  • EvasionLevel is never set to anything besides 1 so what's the point of the condition that checks it?
  • The evasion spellbook is removed and then immediately re-added, serving no purpose except making the evasion permanent on all units that were ever affected when this periodic trigger ran.
  • Evasion passive is set to level 1 instead of matching the level of the aura bestowing it (requires a unique buff for each level so you know which level of the evasion aura a unit is currently affected by).
  • Abilities can be hidden from the UI by setting their button position to (0,-11), instead of having to put it inside a disabled spellbook.
  • Abilities can be hidden from the UI directly with a trigger action now (this does not disable the ability, only hides it), removing the need for a disabled spellbook.
  • The appropriate abilities should be disabled for all players one time on map init, not in the periodic trigger which will do it hundreds of times per second for no reason.
  • Do Nothing is pointless and should never be used anywhere.
  • The "a unit is attacked" event fires when the animation for the attack begins, not when damage occurs or when the projectile launches/impacts. This can be abused by ordering a unit to attack and pressing stop, repeatedly firing the event. If you want to detect attacks you will need to use something like Damage Engine 5.9.0.0.
  • You should have no need to manually evade attacks by detecting them, anyway. That's what the evasion passive is for.

With that in mind, I'll instead refer you to @Uncle's aura template and suggest that you simply modify it to bestow Evasion:
 
Status
Not open for further replies.
Top