• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Triggers for aura

Status
Not open for further replies.
Level 12
Joined
Jun 20, 2017
Messages
959
I wanted to make an aura that would increase the attack damage of friendly units as well as increase their health regen so I thought you could just tweak command aura and set up a trigger that enhances the regen rate depending on the level.

Now I could set up a trigger that detects if a unit has the aura buff and gives that unit a small health regen bonus, but is it possible to determine the level of the aura to give the units a bonus the degree of which depends on the level of the aura?
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
You can use different buffs for different levels of the aura.

If you know from which unit the aura comes, you can detect it's level. You can always find out from which unit it comes, but that might not be very efficient.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Yes. Buff level is always displayed, if the ability has multiple levels. Only problem is, that if you level up from 1->2 you will have buff 2 and buff 1 for a short time. You could detect it though and use a unit group to remove all level 1 buffs (same for level 2->3).

Edit: didn't see the above post
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
It's the easiest solution, but it would lead to two buffs. If you don't mind two buffs, you should use it.
 
Level 12
Joined
Jun 20, 2017
Messages
959
I just realized how what I thought was gonna be a relatively straightforward ability has now turned into a huge headache... :(
 
If you plan to do the regen by yourself how you could do it:
  • Find the Moment an Unit recives the buff.
    • Add it to a global Group containing affected Units.
    • Add regen-ability/ set regenbonus both way works. first reduces the group loop to simple exit state; second allows more complex regeneration.
  • Loop the global group Periodicly
    • Check still affected?
    • No
      • remove regen skill ( if you base regen bonus an regeneration skill)
      • kick out of affected group.
    • yes and based on value
      • heal it.
 
Object Editor
Abilities
Neutral Hostile
Units
Life Regeneration Aura (Neutral)

This is the ability that Healing Fountains and Healing Wards use which stacks and does not use a buff. Just remember to modify Targets Allowed or you'll be healing enemies as well.

Use triggers to level the aura up or down along with the attack damage aura. It can heal in percentages or an amount.
 
Status
Not open for further replies.
Top