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

[General] How to absorb damage?

Status
Not open for further replies.

EdgeOfChaos

E

EdgeOfChaos

No need for DDS. Give him 100% magic resist Runic Bracer or w/e it's called ability. Start a timer based on playernumber (if there'll only be one hero per player.) When the timer expires, remove the ability. If you want an effect, add one to the unit.

You can also use a dummy with Antimagic Shell. There IS an AMS that absorbs damage, not makes immune, you just have to find it.
 
afaik antimagic shield renders your unit magic immune for the time being. Best way is to use DDS, one that can distinguish between spell and normal damage, like this one

It depends on which Anti Magic Shield is being used.
Another work around if DDS is too much of a hassle is to increase the unit's armor by a ridiculous amount for a timed period.
Like adding a self targeting Devotion Aura with +999999 armor
 
bump: better question might be how to transfer damage? A unit is hit but the damage goes to another unit?


this is what i can do, any other ideas?

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacked unit) Equal to unit
    • Actions
      • Set newhp = (Life of unit)
      • Set resulhp = (oldhp - newhp)
      • Unit - Set life of unit to ((Life of unit) + resulhp)
      • Set oldhp = (Life of unit)
 
Last edited:
Level 3
Joined
Jun 18, 2014
Messages
30
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacked unit) Equal to unit
    • Actions
      • Set newhp = (Life of unit)
      • Set resulhp = (oldhp - newhp)
      • Unit - Set life of unit to ((Life of unit) + resulhp)
      • Set oldhp = (Life of unit)
^That kill the unit so definitly doesn't work.

Maybe it's a stupid question but you really need triggers?
If not, you can use Thorns Aura to back the demage and you can use Hardened Skin to ignore it, use Elune's Blessing to ignore magic demage.

Thorns Aura can't back magic demages.
 

EdgeOfChaos

E

EdgeOfChaos

Your trigger will not work because "Is Attacked" takes place well before the damage is dealt. It is also not MUI, it will overwrite other "oldhp"s.

Here are a bunch of non-trigger-based methods.

Damage Return:
- Spiked Carapace (0% prevention some % return)
- Thorns Aura

Physical Damage Prevention
- Spiked Carapact (0% return, 100% reduction)
- Hardened Skin, min dmg = 0, absorbed dmg = 99999999
- Any armor-increasing ability: give 999999999999 armor
- 100% evasion

Magical Damage Prevention:
- Runed Bracer skill (100% magic resist)
- Anti-Magic Shell

Spiked Carapace has a neat field called "Received damage". You can set this to 0 for 100% damage reduction. It can also be used as a damage return.

How to return magic damage?
Index every spell and level with how much damage it will do. Then get that value and deal damage back to the unit. Or use DDS. No way without triggers (i think).
 
So then how do I make a shield that absorbs 300 damage of any kind and upon reaching the limit to fade?

If you need all kinds of damage reduced you have to trigger the shield since Anti Magic Shield only reduces magic damage.
Just go with the +armor solution? That way you ensure all types of damage is neglected.
 
I saw the damage detection system, the descriptions says it can completely block damage, but it's not given for example in the map. How do you suggest I do it?
the examples only how to reduce damage done, how to double damage adone and how to return fixed amount of damage(the unit is still damaged) or to heal on hits.
 
Ok, if I block the damage with this (the attacker has 0 damage against shielded targets) how do I calculate what is that absorbed damage and when it becomes equal to 300 so I remove the shield.
Also my try here is unsuccessful
  • fregbrey
    • Events
      • Game - damageEventTrigger becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • damageType Equal to SPELL
              • damageType Equal to CODE
              • damageType Equal to PHYSICAL
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (target has buff Frost Armor) Equal to True
            • Then - Actions
              • Set amount = 0.00
            • Else - Actions
        • Else - Actions
edit: this is how i'd block the damage
edit 2: Hmm I saw that despite preventing damage it still calculates! :D
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Damage can't be physical and spell (which is what you are checking for with your if). Therefore it won't work.

To your first question: Use a global real variable and accumulate in it the value of the amount variable (blocked_damage = blocked_damage + amount). Then check if blocked_damage is bigger than 300 and if so, remove the shield and set blocked_damage to 0.
 
Ok after thinking over this i found the solution.
  • fregbrey
    • Events
      • Game - damageEventTrigger becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • absorbed Greater than or equal to 300.00
        • Then - Actions
          • Unit - Remove Frost Armor buff from target
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • damageType Equal to SPELL
              • damageType Equal to CODE
              • damageType Equal to PHYSICAL
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (target has buff Frost Armor) Equal to True
            • Then - Actions
              • Set absorbed = (absorbed + amount)
              • Set amount = 0.00
            • Else - Actions
        • Else - Actions
Thanks to all for trying to help. I'd give you +rep
 
I see everyone wants DDS -_- but if you want it fast and without dds (but with leaks etc...) here are the triggers:
  • Add to absorb entering unit
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
    • Actions
      • Trigger - Add to Damage Detect <gen> the event (Unit - (Entering unit) Takes damage)
  • Add to absorb
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Entire map)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Damage Detect <gen> the event (Unit - (Picked unit) Takes damage)
  • Damage Detect Trigger
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) has buff !ABSORB! ) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Real((Custom value of (Attacked unit)))) Greater than or equal to (!Your desired amount of absorbed damage!)
            • Then - Actions
              • Unit - Remove !ABSORB! buff from (Attacked unit)
              • Unit - Set the custom value of (Attacked unit) to 0
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Attacked unit) has buff !ABSORB!) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Life of (Attacked unit)) + (Damage taken)) Greater than or equal to (Max life of (Attacked unit))
                    • Then - Actions
                      • Unit - Add (!+9999999 HP!) to (Attacked unit)
                      • Wait 0.01 seconds
                      • Unit - Set life of (Attacked unit) to ((Life of (Attacked unit)) + (Damage taken))
                      • Unit - Set the custom value of (Attacked unit) to ((Custom value of (Attacked unit)) + (Integer((Damage taken))))
                      • Unit - Remove !+9999999 HP! from (Attacked unit)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Attacked unit) has buff !ABSORB!) Equal to True
                          • ((Life of (Attacked unit)) + (Damage taken)) Less than (Max life of (Attacked unit))
                        • Then - Actions
                          • Unit - Set life of (Attacked unit) to ((Life of (Attacked unit)) + (Damage taken))
                          • Unit - Set the custom value of (Attacked unit) to ((Custom value of (Attacked unit)) + (Integer((Damage taken))))
                        • Else - Actions
                • Else - Actions
        • Else - Actions
! ! - you can name it what you want

In the first 2 triggers you add the units into the dds (create there an even the unit - takes damage), first one is at the start of the game and the other one every time an unit enters the map (is created, spawned, summoned...)

That +9999999 HP is a spell which adds health to the unit with the absorb a lot of health (enough to resist nearly everything) so it wont look like your health is jumping from 50(whatever) to maximum.

I know it's NOT MUI and Leakless, but just a concept and i think the only dds which can be made w/o jass knowledge (maybe).

Credits to Pasto (PastoEntertainment) - for the idea of the DDS.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
that code will never work. It will lag your map like fuck, even then the second problem is that the "Damage Detect Trigger" trigger will have even dead units registered to it, and one trigger can only handle so many events before the game crashes.

Do you really thing if it was so easy to create DDS systems, it would require separate, quite complicated resources?

I see everyone wants DDS -_- but if you want it fast and without dds (but with leaks etc...) here are the triggers:...

you basically say without DDS, and you create one yourself, very lesser and one that can potentionally crash the game
 
you basically say without DDS, and you create one yourself, very lesser and one that can potentionally crash the game

Sorry, fail, didn't notice :D
But if he wants to learn he must start somewhere - as i said it's NOT Mui/Leakless.
Better start from nothing than copy others (even if it's worse)
And now, i am going to sleep. (It's nearly 10PM)
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
well yea, to bring someone to the realm of how DDS works outside of the biggest problem, that is trigger refreshing, this is good, I will keep that in mind next time(not everyone is pro, neither am I :D), and it in fact would be(or maybe is, dunno anymore) MUI, if you didnt use the wait(I dont know anymore about the state of Attacked unit and those alike), but again, for teaching purposes, not the worst thing, but not completly leakless
 
Status
Not open for further replies.
Top