• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

how to block all hpregen

Status
Not open for further replies.
Level 14
Joined
Mar 30, 2009
Messages
970
id like to know how to make it so, that if i call the script, then the unit will stop hp regen. that includes normal hp regen (obj editor), item bonuses to regen, unholy aura.
that does not include heal abilities (but if possible, then im interested in that too) like: heal spray, chain heal, heal. also is it possible to block healing potions?
 
You need to check the health of the unit, and then in a periodic event contantly set it to that hp.
  • Trigger0
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hashtable = (Last created hashtable)
  • Trigger
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Pause Regeneration
  • Actions
    • Hashtable - Save (Life of (Target unit of ability being cast)) as (Key(health)) of (Key(Target unit of ability being cast)) in Hashtable
    • Unit - Add (Target unit of ability being cast) to (UnitGroup)
    • Trigger - Turn on (Trigger 2 <gen>)
  • Trigger2
  • Events
    • Time - Every 0.05 seconds of game time
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (UnitGroup) is empty Equal to False
      • Then - Actions
        • Unit Group - Pick every unit in (UnitGroup) and do (Actions)
          • Loop - Actions
            • Unit - Set life of (Picked unit) to (Load (Key(health)) of (Key(Picked unit)) from Hashtable)
      • Else - Actions
        • Trigger - Turn off (This trigger)
 
Notice though, unit won't get damage, as they will heal back to their health.

This will fix that.

  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (UnitGroup) is empty Equal to False
      • Then - Actions
        • Unit Group - Pick every unit in (UnitGroup) and do (Actions)
          • Loop - Actions
            • If (All conditions are true) then do (Actions) else do (Actions)
              • If - Conditions
                • (Picked Unit) Life > (Load (Key(health)))
              • Then - Actions
                • Unit - Set life of (Picked unit) to (Load (Key(health)) of (Key(Picked unit)) from Hashtable)
              • Else - Actions
                • Do nothing
        • Else - Actions
          • Trigger - Turn off (This trigger)
 
Yap that will work but. But if the health is lower than the saved health, it will regen once again. The best way is to code your regen manually and disable the regen in the unit editor for all units. Then check if the unit has the regen aura, remove it from the regen group. So it will stop regen.
 
Status
Not open for further replies.
Back
Top