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

[Trigger] Absorb and heal damage

Status
Not open for further replies.
Level 6
Joined
Jan 2, 2015
Messages
171
hi everyone. i am making aura that have 25% chance to absorb damage and convert 25% of damage to hp (for example unit A taking 100 damage, he will block 100 damage and healed for 25 HP). But my problem is Boss also get cured even he dont have this aura and sometimes my unit recovered their HP from their own damage instead of using damage taken from boss. any solution for this?
i use Damage Modification trigger from someone in this forum ( sorry i dont know his name)

i tried testing it with chance 100%
  • Set Chance = (Random integer number between 1 and 100)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Chance Less than or equal to 100
      • DamageEventType Equal to 0
      • (DamageEventTarget has buff Dalaran Aura ) Equal to True
    • Then - Actions
      • Wait 0.10 seconds
      • Special Effect - Create a special effect attached to the origin of (DamageEventTarget) using Abilities\Spells\Human\Heal\HealTarget.mdl
      • Unit - Set life of DamageEventTarget to ((Life of DamageEventTarget) + (DamageEventAmount x 1.30))
    • Else - Actions
bump. The Damage Modification was made by rulesofiron99
 
Last edited by a moderator:
Using a wait is not a good idea for damage events. Between that 0.1-0.3 seconds (the wait times are inaccurate), another unit could have easily caused damage, and the variables for 'DamageEventType', 'DamageEventTarget', 'DamageEventSource', and 'Chance' will have changed.

I'm not familiar with rulerofiron's damage modification system, but chances are that there is a value that you can set to modify the damage rather than setting the unit's life directly. Damage events are tricky because they fire before the damage is actually caused. That is why you resorted to a wait--but that method has its own flaws (e.g. let's say a unit is at 100 hp and is taking a 100 damage attack--if he is supposed to absorb 25% of it, he should still be alive with 25 hp. But since your trigger takes the damage in first and then adds life, he'll end up dying).

If you are using Bribe's damage detection system (or lookingforhelp's), it is really easy to modify damage:
Bribe's Damage Engine
looking_for_help's Damage Engine

If you were using Bribe's DDS, you would do this:
  • Aura
    • Events
      • DamageModifierEvent Equal to 1.00
    • Conditions
      • DamageEventType Equal to 0
      • (DamageEventTarget has buff Dalaran Aura) Equal to True
    • Actions
      • Set Chance = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Chance Less than or equal to 100
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of (DamageEventTarget) using Abilities\Spells\Human\Heal\HealTarget.mdl
          • Set DamageEventAmount = (-1.00 x (DamageEventAmount x 0.25))


Note: I'm not 100% sure whether negative damage is interpreted as healing. If it doesn't heal the unit, then you might need to set DamageEventAmount = 0 (to absorb 100% of damage) and then ask Bribe how to do the healing part.

If you are using looking_for_help's system:
  • Aura
    • Events
      • Game - PDD_damageEventTrigger becomes Equal to 1.00
    • Conditions
      • PDD_damageType Equal to PDD_PHYSICAL
      • (PDD_target has buff Dalaran Aura) Equal to True
    • Actions
      • Set Chance = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Chance Less than or equal to 100
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of (PDD_target) using Abilities\Spells\Human\Heal\HealTarget.mdl
          • Set PDD_amount = (-1.00 x (DamageEventAmount x 0.25))
Good luck.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
If you were using Bribe's DDS, you would do this:
  • Aura
    • Events
      • DamageModifierEvent Equal to 1.00
    • Conditions
      • DamageEventType Equal to 0
      • (DamageEventTarget has buff Dalaran Aura) Equal to True
    • Actions
      • Set Chance = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Chance Less than or equal to 100
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of (DamageEventTarget) using Abilities\Spells\Human\Heal\HealTarget.mdl
          • Set DamageEventAmount = (-1.00 x (DamageEventAmount x 0.25))
I can confirm this heals the unit.
 
Status
Not open for further replies.
Top