• 🏆 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!

Addition to Brilliance Aura issue

Status
Not open for further replies.
Level 6
Joined
Aug 5, 2017
Messages
251
I based the code of mine on the Blood Aura from the Fel Orc race. I added the code right, except I added the variable Aura_Unit1 = Unit. Not only that I want Brilliance Aura to give mana regeneration to friendly units, but I also want the aura to decrease mana regeneration from enemy unit. Any help? Here's the code:
The aura's second effect:
  • Brilliance Aura addition
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Brilliance Aura) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Brilliance Aura for Aura_Unit1) Equal to 1
                • Then - Actions
                  • Unit - Add Mana Reduction (1) to (Picked unit)
                  • Unit - Remove Mana Reduction (2) from (Picked unit)
                  • Unit - Remove Mana Reduction (3) from (Picked unit)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Brilliance Aura for Aura_Unit1) Equal to 2
                • Then - Actions
                  • Unit - Remove Mana Reduction (1) from (Picked unit)
                  • Unit - Add Mana Reduction (2) to (Picked unit)
                  • Unit - Remove Mana Reduction (3) from (Picked unit)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Brilliance Aura for Aura_Unit1) Equal to 3
                • Then - Actions
                  • Unit - Remove Mana Reduction (1) from (Picked unit)
                  • Unit - Remove Mana Reduction (2) from (Picked unit)
                  • Unit - Add Mana Reduction (3) to (Picked unit)
                • Else - Actions
            • Else - Actions
The aura's deactivation:
  • Brilliance Aura addition off
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Brilliance Aura) Equal to False
            • Then - Actions
              • Unit - Remove Mana Reduction (1) from (Picked unit)
              • Unit - Remove Mana Reduction (2) from (Picked unit)
              • Unit - Remove Mana Reduction (3) from (Picked unit)
            • Else - Actions
 
Level 6
Joined
Aug 5, 2017
Messages
251
Okay, I did what you suggested:
  • Bonus Variables
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • If ((Unit-type of (Entering unit)) Equal to Archmage) then do (Unit Group - Pick every unit in (Units of type Archmage) and do (Set Aura_Unit1 = (Picked unit))) else do (Do nothing)
Still, I don't know how to make the aura affect enemy units. Still, you said the trigger leaks.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Maybe a different approach would be better. Use two abilities for your aura and hide one. One ability for enemies and one for allies.
You can make the tooltip for the enemy ability red manually and it won't matter if enemies have a positive buff, because you can't dispel it anyway. This way you do not need much of triggers (only add second ability and level it up)
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
what u should do is use the spell book ability

create your negative brilliance aura (must use a different buff). to make it effect enemy change the targets allowed to enemy then put it in the custom spell book

have your standard brilliance aura

then trigger giving the spell book with the negative aura when the hero lvls it up

this will make it so the spell book wont show on the hero
  • brilliance hide
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Disable brilliance aura(spellbook) for (Picked player)


then for when your hero learns brilliance aura

  • brilliance aura learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to brilliance aura
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of brilliance aura(spellbook) for (Triggering unit)) Equal to 0
        • Then - Actions
          • Unit - Add brilliance aura(spellbook) to (Triggering unit)
        • Else - Actions
          • Unit - Set level of brilliance aura(spellbook) for (Triggering unit) to (Level of brilliance aura for (Triggering unit))
  • [trigger]
 
Level 13
Joined
May 10, 2009
Messages
868
Okay, I did what you suggested:
  • Bonus Variables
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • If ((Unit-type of (Entering unit)) Equal to Archmage) then do (Unit Group - Pick every unit in (Units of type Archmage) and do (Set Aura_Unit1 = (Picked unit))) else do (Do nothing)
Still, I don't know how to make the aura affect enemy units. Still, you said the trigger leaks.

That wouldn't be a good idea, because you have only one variable that can refer up to one unit. So, you are basically overwriting it every time a unit enters the playable map area.

Did you consider using a spell book for hiding your passive spells - One for enemies and other for allies?
 
Level 13
Joined
May 10, 2009
Messages
868
Create 2 spells based off Brilliance aura. One you change the targets allowed to enemy units, and the other for allies only. Use negative values for your enemies. The next thing to do is create a spell book and add, for example, the negative brilliance aura ability to it. Now add the positive brilliance to your hero. At last, the spell book must be disabled via triggers - That's a good old trick that people use for hiding certain abilities from the UI. There's also a new way to hide an ability from the UI, changing their Art - X and Y positions, respectively, to 0 and -11.

EDIT: In order to disable the spellbook, do what Millzy said. He also mentioned a way to add the spellbook to your hero (with the negative brilliance)
 
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
That's just a cosmetic thing, you can give most hero and/or item abilities to units, and do the other way around. In order to keep it simple, change the brilliance aura to units (instead of hero), now you can add it to a spellbook easily.
 
Level 6
Joined
Aug 5, 2017
Messages
251
I should have requested this aura. Just trying to set it. Ugh. It's simple, but the rest just seems out of reach. I'll post my requests in the Request a Resource forum. Can someone post the code for the Brilliance/Ignorance Aura(mana regeneration/draining aura)?
 
Level 11
Joined
Jan 25, 2017
Messages
213
No need to make a request- just follow what blood soul says- and don't double post.

You should have 2 auras. The first (positive regen) is a hero ability (targets allies), the second (negative regen) should be a unit ability (targets enemies). We don't want both to show up on the hero so we disable the ability icon by putting it in a disabled spellbook like BloodSoul said. Unit abilities can level up too so there should be zero issues.

Then make a trigger where when a hero learns/levels up (researches I guess) the brilliance aura ability to also enable/level up the 2nd hidden brilliance aura ability.
 
Level 6
Joined
Aug 5, 2017
Messages
251
I actually made the suggestions Alethos said and added a second buff, because millzy suggested it. Here's what I did(I missed something):
I created the aura called Shining Crystal Aura that acts like Blizzard Aura and after that, created a 2nd aura named Shining Crystal Aura-negative.
In the 2nd made aura, I changed the mana regeneration rate to values with minus: Lv1 - -0.75, Lv2 - -1.50, Lv3 - -2.25 and changed the Targets Allowed ststs: Air, Enemy, Ground, Invulnerable, Vulnerable. After those 2 creations, I copied a spellbook from a nightborne map and pasted in my map and named it: Shining Crystal Aura Spelllbook (BOOK) and added Shining Crystal Aura-negative to Data - Spell List. I changed the Art - X and Y positions(of the buttons), courtesy of BloodSoul to 0, respectively -11.
After that, I went into Trigger Editor and copied what millzy posted.
Here's the problem: When I approach an enemy, they also have mana regeneration raised. Is there a way to solve this?
 
Level 11
Joined
Jan 25, 2017
Messages
213
Make sure 'Shining Crystal Aura' (the positive one) has Targets Allowed set to 'allies' and not enemy- also don't put the two auras in the same spellbook together- just the negative one (I don't know if you're doing this but I wanted to make sure that isn't the issue).
 
Level 6
Joined
Aug 5, 2017
Messages
251
I put the Shining Crystal Aura-negative in my spellbook and that's it. As for Targets Allowed, you might want to check:
Shining Crystal Aura - Targets Allowed: Air, Ground, Friend, Self, Invulnerable, Vulnerable
Shining Crystal Aura-negative - Targets Allowed: Air, Ground, Enemy, Invulnerable, Vulnerable
 
Level 6
Joined
Aug 5, 2017
Messages
251
Now i have another problem here. I didn't notice it with the Archmage, so I had to make the paladin use Aura of Defense with works, but when the Paladin/Archmage reaches Level 3 and beyond, they stick to the level 1 ability of their aura, instead of moving on with the ability. Is there a way to fix it? The Paladin's Aura of Defense uses the same code millzy suggested.
 
Level 7
Joined
Jan 23, 2011
Messages
350
Spellbooks don't need 3 levels and 3 abilities, you can level up the aura inside the spellbook with no problem.

But upgrades and level-ups works differents

Millzy triggers are for LEVELING UP YOUR AURA USING THE "+" BUTTON FROM THE COMMAND PANEL

If you are using upgrades, the trigger is different.
What you want is a double aura, that levels up everytime you research an upgrade for it, via some research building?
 
Level 13
Joined
May 10, 2009
Messages
868
This is a little bit weird... You don't have to level up the spellbook. The "negative brilliance" ability is the one which must be leveled up instead. When a hero learns the "positive brilliance", you give the spellbook to it, which already contains the "negative brilliance"; Whenever a "positive brilliance" ability is leveled up, you should set the "negative one" level to the same value as the positive one.

I'm saying this because what if you were to add to multiple spells in a spell book, and not all of them are related to a very same main ability. You woud end up leveling all of them up at once.
 
Status
Not open for further replies.
Top