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

[Spell] Aura that increases Max hp

Level 6
Joined
May 13, 2023
Messages
44
Hi, I would like an aura ability that increases max hp based on the Hero's max health. Let's say if the hero possessing the aura ability has 1000hp and health increase from the aura is 10% if this is the case every allied unit around the hero should have their health increased by 100 regardless of their health.
I tried the solutions here on this thread by checking unit has specific buff or not, but couldn't make it work https://www.hiveworkshop.com/threads/aura-that-increases-max-hp.39659/
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,546
Check out the Celerity aura map I made in this thread:
The above aura system is used here as well but is slightly modified:

Also, that thread you linked is from 2007, a lot has changed since then.
 
Level 6
Joined
May 13, 2023
Messages
44
Hi tnx to your advice I made the spell but i think it is bit poorly made so I would like your advice on ways to improve it.
Aura Initiation
  • Perseverance Aura Init
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Perseverance Aura
    • Actions
      • Set PerseveranceCaster = (Triggering unit)
      • Unit Group - Add PerseveranceCaster to PerseveranceGroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Perseverance Aura Bonus <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Perseverance Aura Bonus <gen>
          • Trigger - Turn on Perseverance Aura Take <gen>
        • Else - Actions
          • Do nothing
Aura Bonus Giving Trigger Notice that PerseveranceGiveGroup is used to prevent the units from getting extra health every 1 second.
  • Perseverance Aura Bonus
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in PerseveranceGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (PerseveranceCaster is alive) Equal to True
              • (Level of Perseverance Aura for PerseveranceCaster) Greater than 0
            • Then - Actions
              • Set PerseverancePoint = (Position of PerseveranceCaster)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within 800.00 of PerseverancePoint) and do (Actions)
                • Loop - Actions
                  • Set PerseveranceTarget = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (PerseveranceTarget is alive) Equal to True
                      • (PerseveranceTarget belongs to an ally of (Owner of PerseveranceCaster)) Equal to True
                      • (PerseveranceTarget is A structure) Equal to False
                      • (PerseveranceTarget has buff Perseverance Aura ) Equal to True
                    • Then - Actions
                      • Unit Group - Add PerseveranceTarget to PerseveranceTargetGroup
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (PerseveranceTarget is in PerseveranceGiveGroup) Equal to False
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Level of Perseverance Aura for PerseveranceCaster) Equal to 1
                            • Then - Actions
                              • Set PerseveranceBonus = (Integer(((Max life of PerseveranceCaster) x 0.10)))
                            • Else - Actions
                              • Do nothing
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Level of Perseverance Aura for PerseveranceCaster) Equal to 2
                            • Then - Actions
                              • Set PerseveranceBonus = (Integer(((Max life of PerseveranceCaster) x 0.15)))
                            • Else - Actions
                              • Do nothing
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Level of Perseverance Aura for PerseveranceCaster) Equal to 3
                            • Then - Actions
                              • Set PerseveranceBonus = (Integer(((Max life of PerseveranceCaster) x 0.20)))
                            • Else - Actions
                              • Do nothing
                          • Unit - Set Max HP of PerseveranceTarget to (PerseveranceBonus + (Max HP of PerseveranceTarget))
                          • Unit Group - Add PerseveranceTarget to PerseveranceGiveGroup
                          • Unit Group - Remove PerseveranceTarget from PerseveranceTakeGroup
                        • Else - Actions
                          • Do nothing
                    • Else - Actions
                      • Do nothing
              • Custom script: call RemoveLocation(udg_PerseverancePoint)
            • Else - Actions
              • Unit Group - Remove PerseveranceCaster from PerseveranceGroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in PerseveranceGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off Perseverance Aura Bonus <gen>
        • Else - Actions
          • Do nothing
Aura Bonus take trigger
  • Perseverance Aura Take
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 2000.00 of (Position of PerseveranceCaster) matching (((Matching unit) belongs to an ally of (Owner of PerseveranceCaster)) Equal to True)) and do (Actions)
        • Loop - Actions
          • Set PerseveranceTarget = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (PerseveranceTarget is alive) Equal to True
              • (PerseveranceTarget has buff Perseverance Aura ) Equal to False
              • (PerseveranceTarget is in PerseveranceTargetGroup) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (PerseveranceTarget is in PerseveranceTakeGroup) Equal to False
                • Then - Actions
                  • Unit - Set Max HP of PerseveranceTarget to ((Max HP of PerseveranceTarget) - PerseveranceBonus)
                  • Unit Group - Add PerseveranceTarget to PerseveranceTakeGroup
                  • Unit Group - Remove PerseveranceTarget from PerseveranceGroup
                  • Unit Group - Remove PerseveranceTarget from PerseveranceGiveGroup
                • Else - Actions
                  • Do nothing
            • Else - Actions
              • Do nothing
Hero Revive Trigger
  • Perseverance Aura Revive
    • Events
      • Unit - A unit Finishes reviving
    • Conditions
      • (Level of Perseverance Aura for (Triggering unit)) Greater than or equal to 1
    • Actions
      • Unit Group - Add (Triggering unit) to PerseveranceGroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Perseverance Aura Bonus <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Perseverance Aura Bonus <gen>
          • Trigger - Turn on Perseverance Aura Take <gen>
        • Else - Actions
          • Do nothing
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,546
I reworked Celerity Aura to adjust Max HP:
  • Perseverance Setup
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- The Hero ability that emits the aura --------
      • Set VariableSet PSV_Ability_For_Hero = Perseverance (Ability - Hero)
      • -------- --------
      • -------- The Unit ability that is applied to nearby allied units --------
      • Set VariableSet PSV_Ability_For_Unit = Perseverance (Ability - Unit)
      • -------- --------
      • -------- The buff for the Unit ability --------
      • Set VariableSet PSV_Buff_For_Unit = Perseverance (Buff - Unit)
      • -------- --------
      • -------- The scaling per level for max hp bonus and area of effect --------
      • Set VariableSet PSV_Scaling_Max_HP[1] = 500
      • Set VariableSet PSV_Scaling_Max_HP[2] = 1000
      • Set VariableSet PSV_Scaling_Max_HP[3] = 1500
      • -------- --------
      • Set VariableSet PSV_Scaling_Area_Of_Effect[1] = 800.00
      • Set VariableSet PSV_Scaling_Area_Of_Effect[2] = 800.00
      • Set VariableSet PSV_Scaling_Area_Of_Effect[3] = 800.00
  • Perseverance Learn Skill
    • Events
      • Unit - A unit Learns a skill
    • Conditions
    • Actions
      • -------- For efficiency sake I keep most triggers off when they're not actually able to run. --------
      • Custom script: if GetLearnedSkill() == udg_PSV_Ability_For_Hero then
      • -------- --------
      • Trigger - Turn on Perseverance Revive Hero <gen>
      • Trigger - Turn on Perseverance DeIndex <gen>
      • -------- --------
      • Unit Group - Add (Triggering unit) to PSV_Source_Group
      • Set VariableSet PSV_Source_Counter = (PSV_Source_Counter + 1)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PSV_Source_Counter Equal to 1
        • Then - Actions
          • Trigger - Turn on Perseverance Aura Loop <gen>
        • Else - Actions
      • -------- --------
      • Custom script: endif
  • Perseverance Aura Loop
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in PSV_Source_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet PSV_Source = (Picked unit)
          • Set VariableSet PSV_Aura_Level = (Level of PSV_Ability_For_Hero for PSV_Source)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (PSV_Source is alive) Equal to True
              • PSV_Aura_Level Greater than 0
            • Then - Actions
              • -------- Adjust the Aura AoE here --------
              • Set VariableSet PSV_Point = (Position of PSV_Source)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within PSV_Scaling_Area_Of_Effect[PSV_Aura_Level] of PSV_Point.) and do (Actions)
                • Loop - Actions
                  • Set VariableSet PSV_Target = (Picked unit)
                  • -------- Adjust the Conditions to use your desired Targets Allowed (Keep Is Alive = True) --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (PSV_Target is alive) Equal to True
                      • (PSV_Target belongs to an ally of (Owner of PSV_Source).) Equal to True
                      • (PSV_Target is A structure) Equal to False
                    • Then - Actions
                      • Set VariableSet PSV_CV = (Custom value of PSV_Target)
                      • -------- --------
                      • -------- Get Highest Level Source --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • PSV_Greatest_Aura_Level[PSV_CV] Less than PSV_Aura_Level
                        • Then - Actions
                          • Set VariableSet PSV_Greatest_Aura_Level[PSV_CV] = PSV_Aura_Level
                        • Else - Actions
                      • -------- --------
                      • -------- Add to Target Group --------
                      • Unit Group - Add PSV_Target to PSV_Target_Group
                    • Else - Actions
              • Custom script: call RemoveLocation( udg_PSV_Point )
            • Else - Actions
              • Unit Group - Remove PSV_Source from PSV_Source_Group.
              • Set VariableSet PSV_Source_Counter = (PSV_Source_Counter - 1)
              • -------- --------
              • -------- Turn Off Loop --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PSV_Source_Counter Equal to 0
                • Then - Actions
                  • Trigger - Turn off Perseverance Aura Loop <gen>
                • Else - Actions
      • -------- --------
      • Unit Group - Pick every unit in PSV_Target_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet PSV_Target = (Picked unit)
          • Set VariableSet PSV_CV = (Custom value of PSV_Target)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PSV_Greatest_Aura_Level[PSV_CV] Greater than 0
            • Then - Actions
              • Set VariableSet PSV_Life_Percentage = (Percentage life of PSV_Target)
              • Unit - Set Max HP of PSV_Target to ((Max HP of PSV_Target) - PSV_Previous_Max_HP[PSV_CV])
              • Set VariableSet PSV_Previous_Max_HP[PSV_CV] = PSV_Scaling_Max_HP[PSV_Greatest_Aura_Level[PSV_CV]]
              • -------- --------
              • Unit - Set Max HP of PSV_Target to ((Max HP of PSV_Target) + PSV_Scaling_Max_HP[PSV_Greatest_Aura_Level[PSV_CV]])
              • Unit - Set life of PSV_Target to PSV_Life_Percentage%
              • -------- --------
              • -------- Add Ability / Art (ELSE) Adjust Level --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of PSV_Ability_For_Unit for PSV_Target) Equal to 0
                • Then - Actions
                  • Unit - Add PSV_Ability_For_Unit to PSV_Target
                  • Unit - Set level of PSV_Ability_For_Unit for PSV_Target to PSV_Greatest_Aura_Level[PSV_CV]
                  • -------- --------
                  • -------- Create the buff Art (unless it's an Aura Source because they don't use this) --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of PSV_Ability_For_Hero for PSV_Target) Equal to 0
                    • Then - Actions
                      • Special Effect - Create a special effect attached to the overhead of PSV_Target using Abilities\Spells\Human\InnerFire\InnerFireTarget.mdl
                      • Set VariableSet PSV_Sfx[PSV_CV] = (Last created special effect)
                    • Else - Actions
                • Else - Actions
                  • Unit - Set level of PSV_Ability_For_Unit for PSV_Target to PSV_Greatest_Aura_Level[PSV_CV]
            • Else - Actions
              • Set VariableSet PSV_Life_Percentage = (Percentage life of PSV_Target)
              • Unit - Set Max HP of PSV_Target to ((Max HP of PSV_Target) - PSV_Previous_Max_HP[PSV_CV])
              • Unit - Set life of PSV_Target to PSV_Life_Percentage%
              • Set VariableSet PSV_Previous_Max_HP[PSV_CV] = 0
              • -------- --------
              • -------- Remove Ability / Art / Group --------
              • Unit - Remove PSV_Ability_For_Unit from PSV_Target
              • Unit - Remove PSV_Buff_For_Unit buff from PSV_Target
              • -------- --------
              • -------- Destroy the buff Art --------
              • Custom script: if udg_PSV_Sfx[udg_PSV_CV] != null then
              • Special Effect - Destroy PSV_Sfx[PSV_CV]
              • Custom script: set udg_PSV_Sfx[udg_PSV_CV] = null
              • Custom script: endif
              • -------- --------
              • Unit Group - Remove PSV_Target from PSV_Target_Group.
          • -------- --------
          • Set VariableSet PSV_Greatest_Aura_Level[PSV_CV] = 0
  • Perseverance Revive Hero
    • Events
      • Unit - A unit Finishes reviving
    • Conditions
      • (Level of PSV_Ability_For_Hero for (Triggering unit)) Greater than or equal to 1
    • Actions
      • Unit Group - Add (Triggering unit) to PSV_Source_Group
      • Set VariableSet PSV_Source_Counter = (PSV_Source_Counter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PSV_Source_Counter Equal to 1
        • Then - Actions
          • Trigger - Turn on Perseverance Aura Loop <gen>
        • Else - Actions
  • Perseverance DeIndex
    • Events
      • Game - UnitIndexEvent becomes Equal to 2.00
    • Conditions
    • Actions
      • -------- The Unit Indexer recycles unused custom values - Let's make sure that certain values are reset back to their default values: --------
      • Set VariableSet PSV_Greatest_Aura_Level[UDex] = 0
      • Set VariableSet PSV_Previous_Max_HP[UDex] = 0
Requires Bribe's Unit Indexer. Do NOT import another Unit Indexer into your map if you already have one!!!
 

Attachments

  • Max HP Aura 1.w3m
    29.6 KB · Views: 2
Top