Make a unit unable to take damage. Help

merlinds

Member
Reaction score
15
Hi everybody,
Im trying to creat a skill that makes the hero to not take any damage during a period, not invulnerable only make the unit to not take damage. The skill will be some thing like "Pain Killer" you activate it and consumes mana whiles make you un-damagable. Then if you get out of mana or turn it off you return to normal with the same life that you have before.
I have the idea to use the "Damage Taken" option and after the damage is taken heal the unit for the same amount. But the problem is that if the damage taken is grater than the remaining llife of the uni it will kill it.
Please help me! :p
Thx you all!
Sry for my english!
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
create an ability based off stoneskin (blocks physical damage) with a value of say, 10,000,000 and another ability based on magic damage reduction, with 100%, add both abilities to a spell book, and when the ability is activated, add the spellbook and disable it, both abilities will be hidden and you can remove the spellbook when they deactivate the ability

or try this...

Trigger:
  • Damage Reduction - Detect Units
    • Events
      • Unit - A unit learns an ability
    • Conditions
      • Ability Learned is equal to (defensive stance [thats the base ability])
    • Actions
      • If then else
        • If
          • Boolean - ((Key Triggering unit) of 1 (NOT THE SAME number as the rest of the triggers) in Damage_Reduction_Hashtable) is not equal to false
        • Then
          • Hashtable - Save false as (key triggering unit) of 1 (same number as the one just above but NOT the rest of the triggers) in Damage_Reduction_hashtable
          • Trigger - Add Event (triggering unit takes damage) to Damage Reduction - Takes Damage <gen>
        • Else
      • Set Temp_Group = Units in (Ability)_Group
      • Unit Group - Add triggering unit to Temp_Group
      • Set (Ability)_Group = Units in Temp_Group
      • Custom Script: Calldestroyunitgroup(UDG_Temp_Group)


Trigger:
  • Damage Reduction - Activation
    • Events
      • Unit - A unit activates (defensive stance)
    • Conditions
    • Actions
      • Hashtable - Save true as (key triggering unit) of 0 (same as the other triggers but not the first) in Damage_Reduction_Hashtable
      • Trigger - Turn on Damage Reduction - Mana Cost <gen>
      • Trigger - Turn on Damage Reduction - Takes Damage <gen>


Trigger:
  • Damage Reduction - Deactivation
    • Events
      • Unit - A unit deactivates (defensive stance)
    • Conditions
    • Actions
      • Hashtable - Save false as (key triggering unit) of 1 (same as other triggers but not the first one) in Damage_Reduction_Hashtable
      • If then else
        • If
          • Integer - Number of units in (Ability)_Group matching conditions (Hashtable - (key matching unit) of 1 (same as other triggers but not the first one) in Damage_Reduction_Hashtable and matching unit is alive is equal to true) is equal to 0
        • Then
          • Trigger - Turn off Damage Reduction - Mana Cost <gen>
          • Trigger - Turn off Damage Reduction - Takes Damage <gen>
        • Else


Trigger:
  • Damage Reduction - Mana Cost
    • Events
      • Periodic event - Every 0.2 seconds (or however smooth you want the mana degen to be, faster refresh rate)
    • Conditions
    • Actions
      • Set Temp_Group = Units in (Ability)_Group matching conditions ([(key Matching unit) of 1 (or any other random number) in Damage_Reduction_Hash] equal to true)
      • Unit Group - Pick all units in Temp_Group and do actions
        • Loop Actions
          • If then else
            • If
              • Or (any conditions are true)
                • Unit - Mana of picked unit less than or equal to 2.00 x (Mana cost per second x refresh rate [number from event])
                • Boolean - Unit is alive is equal to false
              • Then
                • Unit - Set mana equal to mana of picked unit - (Mana cost per second x refresh rate [number from event])
                • Ability - Deactivate (defensive stance)
                • Hashtable - Save boolean as false in (key Picked unit) of 0 (or whatever number you used in the condition for matching units) in Damage_Reduction_Hashtable
                • If then else
                  • If
                    • Number of units in Temp_Group = 1
                  • Then
                    • Trigger - Turn off this trigger
                    • Trigger - Turn off Damage Reduction - Takes Damage <gen>
                  • Else
              • Else
                • Unit - Set mana equal to mana of picked unit - (Mana cost per second x refresh rate [number from event])
      • Custom Script: Calldestroyunitgroup(UDG_Temp_Group)


Trigger:
  • Damage Reduction - Takes Damage
    • Events
    • Conditions
      • Boolean - (Key Damaged Unit) of 0 (or w/e number you used in the previous trigger) in Damage_Reduction_Hashtable is equal to True
    • Actions
      • Unit - Set life of triggering unit = life of triggering unit + damage taken
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
I've never tried it, but perhaps Berserk with -100% damage taken increase?

EDIT: Tried it. It appears to work, reducing both spell and attack damage to 0.
EDIT2: If you enter a value of lower than -1.00 into the field, you are actually healed by the extra percentage.
 

vypur85

Hibernate
Reaction score
803
> Berserk
This will definitely work well in this case. But bear in mind that the negative value does not affect the amount of damage taken. Meaning even at a value of -1%, the unit will still get 100% damage free.

On a related note, to use negative values, you will need to hold the SHIFT key and double click the field you want to change. Then add in a negative number.


> If you enter a value of lower than -1.00 into the field, you are actually healed by the extra percentage.
This is new to me. Never actually tested that.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
After all that i just realized it would be SUPER easy to do with mana shield... just activate it, trigger the mana loss and set it to cost 0 mana per point of damage
 

ultimate11

Active Member
Reaction score
25
@GFreak45 is perfectly wright ,i sugest you to use his way is beter then using bersek or use a damage detect system like Weep system :D.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
You probably won't use my method unless you trigger it, but I realised something else.

DotA's Lord of Avernus' Borrowed Time appears to use Berserk. Now we know how to answer all those newbies and people looking for it.
 

merlinds

Member
Reaction score
15
I already make it with berserk, it works perfect. I would stay with it for now since im tryin to reach a "Stable" version of my map. Thx you all!!!!!!
 

Jedi

New Member
Reaction score
63
You probably won't use my method unless you trigger it, but I realised something else.

DotA's Lord of Avernus' Borrowed Time appears to use Berserk. Now we know how to answer all those newbies and people looking for it.

No it doesn't.There is not a buff and it would cause problems with mask of madness.
 

Smitty

Member
Reaction score
20
It probably uses damage detection and a trigger to set the life of the damaged unit to life+(2*damage).
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Apparently Borrowed Time doesn't interrupt orders, and I only know of Wind Walk and Berserk that do that... Wait. There's no green border around the icon. So... it's a toggle skill? Makes sense, combined with the buff.

Never mind, I'm rambling. Does Berserk work fine? :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top