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

Triggered damage block

Status
Not open for further replies.
Level 8
Joined
Apr 30, 2009
Messages
338
How can I get around how triggered damage block heals the unit before the damage is done, making any damage they take at max HP not be blocked?

Actions
Events
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has buff ~Sanctified Bond (Paladin)) Equal to True
Then - Actions
Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
Else - Actions

If unit has 100/100 HP and takes 25 damage, they lose 25 HP.

If unit has 90/100 HP and takes 25 damage, they lose 15 HP.

If unit has 75/100 HP and takes 25 damage, they lose 0 HP.

How do I make it so I can temporarily increase their max HP and heal them to 100 so it looks like it was blocked?
 
How do I make it so I can temporarily increase their max HP and heal them to 100 so it looks like it was blocked?
You need an hp bonus dummy ability:
http://www.thehelper.net/forums/showthread.php?t=147544

Read that thread and it might shine some light. Mostly look at Kingkingyyk3's posts. Basically, just make a dummy ability based on the hp item bonus or whatever it is called, set it to max, add it to the unit, heal him, and then remove it.

For the other part about the x/100 health, care to explain it a bit more? Like, do you mean percentage-wise (as in 75% health = 0 damage, 100% = full damage)?
 
set the unit and the damage to a variable, then use a 0.00 timer then heal the unit using the variable... this method is fully MUI

UNIT is a unit variable while HEAL is a real variable

  • Events
    • Unit - A unit takes damage
  • Actions
    • Set UNIT = Triggering Unit
    • Set HEAL = Damage taken
    • Countdown Timer - Start Timer as a one-shot timer that expires in 0.00 seconds
  • Events
    • Timer - Timer Expires
  • Actions
    • Unit - Set Life of UNIT to (Hit points of UNIT + HEAL)
 
Level 8
Joined
Apr 30, 2009
Messages
338
  • Damage Block
    • Events
    • Conditions
    • Actions
      • Set temp_damage_real = (Damage taken)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff ~Sanctified Bond (Paladin)) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Life of (Triggering unit)) Less than ((Max life of (Triggering unit)) - temp_damage_real)
            • Then - Actions
              • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + temp_damage_real)
            • Else - Actions
              • Set temp_damage_unit = (Triggering unit)
              • Countdown Timer - Start temp_damage_timer as a One-shot timer that will expire in 0.00 seconds
        • Else - Actions
  • Overflow Heal
    • Events
      • Time - temp_damage_timer expires
    • Conditions
    • Actions
      • Unit - Set life of temp_damage_unit to ((Life of temp_damage_unit) + temp_damage_real)
 
Status
Not open for further replies.
Top