+ Maximum HP Aura Ability

jedi8955

New Member
Reaction score
4
This time around, I'm trying to make an aura that adds to a unit's maximum hp, preferably as a percentage. As usual, I can't find a good analogue in the default abilities. Here's the ability as designed:

Inspiration-
Inspired by the sight of a true champion, the surrounding allied units are able to withstand more damage.

Level 1: Adds +30% to max HP.
Level 2: Adds +40% to max HP.
Level 3: Adds +50% to max HP.

This ability is going to be on 3 different units, each unit will have one of the 3 levels of the aura. They also need to *not stack*. I'd guess that the best way to avoid stacking issues is to make 3 different abilities, one that adds +30%, then two that add +10% that stack, then just give the highest level unit all 3 abilities. But, that's just a guess, I really don't know.

I thought about dealing with this in a trigger, but I couldn't find a way to change a unit's maximum hps as an action, just their current hp.

Any help would be greatly appreciated. Thanks!
 

Genkora

Frog blast the vent core!
Reaction score
92
there are item abilities that increase max health, not sure exactly what it's called though. You could check if a unit has a specific buff and add the ability to the unit if it does.

like,

every 5 seconds

actions
pick every unit with buff


or something like that. To prevent it from stacking, you could add the unit to a unit group if it has the buff, if a unit is in this unit group, then don't add the ability. I'll post a trigger in a sec. hold on.

edit - I posted the trigger but noticed an error with it. I'll fix it real quick.

ok, this should work

Trigger:
  • Life Aura
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set UnitGroup = (Units in (Playable map area) matching (((Matching unit) has buff Life Aura) Equal to True))
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in LifeGroup) Equal to True
            • Then - Actions
              • Do nothing
            • Else - Actions
              • Unit - Add Life Bonus to (Picked unit)
              • Unit Group - Add (Picked unit) to LifeGroup
      • Custom script: call DestroyGroup (udg_UnitGroup)
      • Set UnitGroup = (Units in (Playable map area) matching ((((Matching unit) has buff Life Aura) Equal to False) and (((Matching unit) is in LifeGroup) Equal to True)))
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Remove Life Bonus from (Picked unit)
          • Unit Group - Remove (Picked unit) from LifeGroup
      • Custom script: call DestroyGroup (udg_UnitGroup)


I just realized you wanted increases of a percentage of health. I don't know of any way to do that, I don't think there are any abilities or functions that do that.
 

jedi8955

New Member
Reaction score
4
Cool, thanks! I'll put it into the editor and test it out in a little bit.

So, I'll just make one of these for each version of the ability, and just change the level 2 and level 3 to add an effective 10%, so they don't stack.

And thanks for the heads up on the percentages....what I'm going to do is just add what should be x% of a unit's life at the level where they get the ability. It'll make things a little strangly balanced, but not brokenly so.

Thanks again!
 

Rainther

I guess I should write something of value here...
Reaction score
61
I think that you could have the Life Bonus ability to work with % if you do like this:
Make about 4-5 of that ability and everyone should have 9 levels.
1st one would have 1,2,3... to 9 value,
2nd one would have 10,20,30... to 90 value,
3rd one would have 100,200,300... to 900 value,
and so on. I Haven't tried this method, but think it might work.

If you'd increase health with 1304 it'd be
1st ability on level 4, 2nd not used, 3rd on lvl 3 and 4th on lvl 1

It'd probably be easier to make in Jass though.
 

Lumograph090

New Member
Reaction score
22
Not sure how you would go about adding percents but I have made a passive aura in the past based off of Blood Pact from WoW.

I'm sure its a little clunky in that it can probably be made in a much more simple manner than I have but it adds to a units max HP.

The ability has 5 levels, I'll post the first level to give you an example of how I did it. If you're interested, I'll host my map as a whole and you can just extract everything.

Trigger:
  • Learn Blood Pact
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to (==) Summon Scamp
    • Actions
      • Trigger - Turn on Blood Pact Off Rank 1 <gen>
      • Trigger - Turn on Blood Pact Rank 1 <gen>
      • Trigger - Turn off (This trigger)


Trigger:
  • Blood Pact Rank 1
    • Events
      • Time - Every 1.50 seconds of game time
    • Conditions
    • Actions
      • Set MyUnitGroup = (Units in (Entire map) matching (((Matching unit) has buff Blood Pact ) Equal to (==) True))
      • Unit Group - Pick every unit in MyUnitGroup and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to (==) False
            • Then - Actions
              • Set P = (Position of (Picked unit))
              • Unit - Add Blood Pact (+75 HP Rank 1) to (Picked unit)
              • Custom script: call RemoveLocation(udg_P)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_MyUnitGroup)


Trigger:
  • Blood Pact Off Rank 1
    • Events
      • Time - Every 1.50 seconds of game time
    • Conditions
    • Actions
      • Set MyUnitGroup = (Units in (Entire map) matching (((Matching unit) has buff Blood Pact ) Equal to (==) False))
      • Unit Group - Pick every unit in MyUnitGroup and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to (==) False
            • Then - Actions
              • Set P = (Position of (Picked unit))
              • Unit - Remove Blood Pact (+75 HP Rank 1) from (Picked unit)
              • Custom script: call RemoveLocation(udg_P)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_MyUnitGroup)


Basically, it adds all units into a group, etc. If they have the Blood Pact buff it will apply the bonus hit points. Every 1.5 seconds it checks to see that the units have the buff, if they do not it will remove the bonus health.

Mine adds a bonus 75, 105, 135, 165, & 195 hit points.
 

Axe.killer

New Member
Reaction score
24
This time around, I'm trying to make an aura that adds to a unit's maximum hp, preferably as a percentage. As usual, I can't find a good analogue in the default abilities. Here's the ability as designed:

Inspiration-
Inspired by the sight of a true champion, the surrounding allied units are able to withstand more damage.

Level 1: Adds +30% to max HP.
Level 2: Adds +40% to max HP.
Level 3: Adds +50% to max HP.

This ability is going to be on 3 different units, each unit will have one of the 3 levels of the aura. They also need to *not stack*. I'd guess that the best way to avoid stacking issues is to make 3 different abilities, one that adds +30%, then two that add +10% that stack, then just give the highest level unit all 3 abilities. But, that's just a guess, I really don't know.

I thought about dealing with this in a trigger, but I couldn't find a way to change a unit's maximum hps as an action, just their current hp.

Any help would be greatly appreciated. Thanks!

You should just make a dummy unit cast a shield equivilant to the %HP you want... when it gets aura. That would be more viable.
 

jedi8955

New Member
Reaction score
4
Well, I've run into a snag trying to get this to work. I've based the ability off of Genkora's code, but with one change. The buff needs to work on buildings, as this is for a Tower Defense variant I'm working on. The problem is, the aura simply isn't showing up!

None of the buildings are accepting the buff. The ability and the buff are based off of Brilliance Aura. The ability has the following targets:

Air, Friend, Ground, Invulnerable, Self, Structure, Vulnerable


Further more, the other aura I'm using, Life Regeneration Aura (the one from the Fountain of Life, only thing changed was adding Structure as a target and the amount healed) isn't showing up either. Are buildings just not affected by auras?

Edit:

I've done some further testing. 1st off, the Life Regen aura had to be scrapped, and rebased off of Healing Ward Aura, which is affecting things properly. It doesn't show up in any Status: fields, but I dunno why. It works though, and is targeting structures.

However, the +HP Aura is borked. It's not even giving creatures the buff, and since the entire thing is based off of the buff, everything's going down the tubes. I'll have to look into it more.
 

Lumograph090

New Member
Reaction score
22
Well, I've run into a snag trying to get this to work. I've based the ability off of Genkora's code, but with one change. The buff needs to work on buildings, as this is for a Tower Defense variant I'm working on. The problem is, the aura simply isn't showing up!

None of the buildings are accepting the buff. The ability and the buff are based off of Brilliance Aura. The ability has the following targets:

Air, Friend, Ground, Invulnerable, Self, Structure, Vulnerable


Further more, the other aura I'm using, Life Regeneration Aura (the one from the Fountain of Life, only thing changed was adding Structure as a target and the amount healed) isn't showing up either. Are buildings just not affected by auras?

Edit:

I've done some further testing. 1st off, the Life Regen aura had to be scrapped, and rebased off of Healing Ward Aura, which is affecting things properly. It doesn't show up in any Status: fields, but I dunno why. It works though, and is targeting structures.

However, the +HP Aura is borked. It's not even giving creatures the buff, and since the entire thing is based off of the buff, everything's going down the tubes. I'll have to look into it more.

The system / Triggers I linked work 100% perfect :confused:
 

Teach101

New Member
Reaction score
4
I didn't check out all the posts... but if it has to be a percentage, then you can use triggers. The amount of hp to add would be this formula (your variable)/100 x Hp.
---
your variable would be 10%xLevelofXXXspell for XXxUnit. (this is a formula for 10% hp on level 1 and 20% on lv two and 30% on lv three and so on.
---
 

Axe.killer

New Member
Reaction score
24
Ok listen good to this approach...
U know that upgrade that increases HP, make it researchable for all units.

When a unit enters your aura, store it in an integer variable

integer lol = Max HP of unit getting buff * .1 (for 10 %)

Then you do this

For int A 1 to 10
If(integer lol < 100 * int A )
Research HP UPPER for player of unit getting buff level int [A]
 

Lumograph090

New Member
Reaction score
22
Ok listen good to this approach...
U know that upgrade that increases HP, make it researchable for all units.

When a unit enters your aura, store it in an integer variable

integer lol = Max HP of unit getting buff * .1 (for 10 %)

Then you do this

For int A 1 to 10
If(integer lol < 100 * int A )
Research HP UPPER for player of unit getting buff level int [A]

Then what happens when the unit leaves the affects of that aura? You can't undo a research.
 

Rainther

I guess I should write something of value here...
Reaction score
61
That doesn't sound like a waterproof method
 

Lumograph090

New Member
Reaction score
22
Then have another upgrade that minuses hp.

Ha ha. That would create such a shit storm of data floating around.

Every single time a new unit is affected by the aura you need to research it. then disable it when they leave the affects of the aura.

By this time you now have two different researches for the same person. Each and every time they enter and leave 2 more, it would be an exponential growth in Triggers and researches for each and every unit in your map. 2,4,8,etc.

Not even possible, nor worth doing.

Like I said, give my method a shot man, it works 100% flawlessly and with no researching. Just use the bonus HP item ability.
 

Axe.killer

New Member
Reaction score
24
Ha ha. That would create such a shit storm of data floating around.

Every single time a new unit is affected by the aura you need to research it. then disable it when they leave the affects of the aura.

By this time you now have two different researches for the same person. Each and every time they enter and leave 2 more, it would be an exponential growth in Triggers and researches for each and every unit in your map. 2,4,8,etc.

Not even possible, nor worth doing.

Like I said, give my method a shot man, it works 100% flawlessly and with no researching. Just use the bonus HP item ability.
You would use integer strings. For example.
int count = 1

if(Unit enters, HP is <= 100,)
{
Research HP(count);
Leaves, Research HPreduction(count);
}

Most effective method is my method. No excess in data flow. The unit enters aura (which is not nearly as buggy as unit within range) Do such and such. Leaves remove such and such. Say on an average occasion you have 7 units around you, thats not going to even scratch lag....
 

jedi8955

New Member
Reaction score
4
Sorry to necro post, I know it's been awhile on this.

I got the bloody thing working. It was stupid simple too.

Brilliance Aura, which I had originally based the ability off of flat out *does not* work on structures, no matter what you set the flags to.

However, I was playing around with another aura that gave nearby structures a hit point regeneration, and based that off of Devotion Aura. Boom, structure takes it, all's well.

Rebased the +HP Max aura on Devo, works just fine. It's acting slightly strange in that the unit giving the aura itself is not getting the +HP, but I'm not entirely concerned. If I can get it to work, cool. If not, it's a more important unit to protect and will give the player another interesting choice in his combat strategy.

I'll probably leave it broken, haha.

Thanks for all the help with this.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top