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

Enemy Health Regen System

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,602
Hey.

I'm requesting a GUI made enemy health regeneration system for a single-player campaign.


  • The generation is only made for neutral hostile units.
  • After 10 seconds the regeneration starts if no damage is taken(health must be lower than 100% of course).
  • Regeneration starts, with 0,5% per second and it increases per second by 0,5% up to 5% per second(max health).
  • The regeneration is immediately cancelled when a unit takes damage.
  • At the beginning of game, specific types of unit types are chosen who has this regeneration(not all enemies has this regeneration).

Rep and credits will be given to the creator of the system.
 
Last edited:

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
  • Untitled Trigger 002
    • Events
    • Damage detection event here
    • Conditions
      • damage detection unit variable belong to neutral hostile
    • Actions
      • Unit Group - Add unit_variable to In_combat_group
      • Unit Group - Remove unit_variable from Heal_group
  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Heal_group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Picked unit)) Less than 100.00
            • Then - Actions
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + ((Max life of (Picked unit)) / 20.00))
            • Else - Actions
      • Unit Group - Pick every unit in Heal_group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Picked unit)) Less than 100.00
            • Then - Actions
              • Set counter = (Load 1 of (Key (Picked unit)) from Hashtable)
              • Set counter = (counter + 1)
              • Hashtable - Save counter as 1 of (Key (Picked unit)) in Hashtable
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • counter Greater than or equal to 10
                • Then - Actions
                  • Unit Group - Add (Picked unit) to Heal_group
                  • Unit Group - Remove (Picked unit) from In_combat_group
                • Else - Actions
            • Else - Actions
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
@Darkgrom
Remember to clear the hashtable data of the child key when the unit dies.
Because, a normal unit, is a normal unit, once die, it cannot be revived, you must create another new

Unlike Heroes, we can revive Heroes therefore we do not clear the child key (for this trigger case)
 
Status
Not open for further replies.
Top