Redirecting Damage

Siefer

New Member
Reaction score
8
Anyone know on how I would go about making an ability that redirects damage?
I was going to try an ability that puts a buff on another unit that does nothing, and then make a trigger than when the unit with the buff is attacked, heal the unit by a certain amount, damage the attacker by that same amount, and remove the buff. But this doesn't seem like redirecting damage at all, since if the hero is dealt 2 damage, then it would heal for 300 and deal 300 damage to the attacker (also it isn't working).
I just need a way that looks like it redirects damage, from either spells or attacks, that can preferrably be cast on other units. Help please?
 

SFilip

Gone but not forgotten
Reaction score
634
spirit link would be your answer i suppose...
 

Siefer

New Member
Reaction score
8
Spirit Link? How? I want it to prevent damage to a unit and send the damage back to the unit that caused it. If I set Spirit Link to 100% and make it target an enemy will it redirect damage to it or something?
 
K

Kevin

Guest
If spirit link isn't your answer, try spiked carapace, however I believe SC only works with melee attackers :(
 
D

dArKzEr0

Guest
Spiked Carapace? Though that will only work for melee units.
Vampiric Aura? You could make it effective on enemies instead of allies and give it a negative value, though also only for melee units.
Item Life Steal? You could have a trigger give the ability to attacking units and then remove the ability, which will work on ranged units, but this seems buggy, you'd have to give it a negative percentage of course.

Just tossing out ideas, I hope they help.

-darkz
 

Siefer

New Member
Reaction score
8
dArKzEr0 said:
Spiked Carapace? Though that will only work for melee units.
Vampiric Aura? You could make it effective on enemies instead of allies and give it a negative value, though also only for melee units.
Item Life Steal? You could have a trigger give the ability to attacking units and then remove the ability, which will work on ranged units, but this seems buggy, you'd have to give it a negative percentage of course.

Just tossing out ideas, I hope they help.

-darkz

You sure the item life steal works on ranged units? It seems to be working on melee units well enough, but not ranged units, or at least not on these trolls I'm testing it out on.

Chocobo said:
Take note they won't be able to life steal an enemy without an item / skill who has a higher priority than the aura.
What does that mean?
 

Siefer

New Member
Reaction score
8
For a while, I was content with the ability. Now I am bringing it back, because the thing Chocobo said. So I am putting it out there again.
To rephrase what would be most ideal:
Imagine an ability where when you target an ally, he gains a buff that allows him to redirect damage he takes to the attacking opponent.
Or imagine an ability where when you target an enemy, he gains a debuff that causes damage to be reflected back at him when he attacks.
Both of them would preferrably work all of the time.
An ability like one of those two would be most ideal. But, about now, I'm getting kind of desperate, any ideas?
 
D

deathtomato

Guest
Well, i wrote something similar be4 for a lightsaber bolt reflection in my stawars map (^^) Might be helpful...

ill post original trigger here, play around with it.

Code:
Laser Reflect
    Events
        Unit - A unit Is attacked
    Conditions
        ((Attacked unit) has buff Lightsaber Reflect ) Equal to True
              If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Random integer number between 1 and 5) Equal to 5
            Then - Actions
                Unit - Set life of (Attacked unit) to ((Life of (Attacked unit)) + (Damage taken))
                Unit - Cause (Attacked unit) to damage (Attacking unit), dealing ((Damage taken) + 50.00) damage of attack type Normal and damage type Magic
                Special Effect - Create a special effect attached to the overhead of (Attacking unit) using Abilities\Spells\Undead\Curse\CurseTarget.mdl
                Wait 1.00 seconds
                Special Effect - Destroy (Last created special effect)
            Else - Actions
                Do nothing
This basically gives a 1 in 5 chance to do the damage that the attacked unit takes + 50 (you could change it to divide 2 for half damage), and heals attacking unit for whatever dmg it took (again could change to /2)
 

Chocobo

White-Flower
Reaction score
409
Code:
Laser Reflect
    Events
        Unit - A unit Is attacked
    Conditions
        ((Attacked unit) has buff Lightsaber Reflect ) Equal to True
              If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Random integer number between 1 and 5) Equal to 5
            Then - Actions
                Unit - Set life of (Attacked unit) to ((Life of (Attacked unit)) + (Damage taken))
                Unit - Cause (Attacked unit) to damage (Attacking unit), dealing ((Damage taken) + 50.00) damage of attack type Normal and damage type Magic
                Special Effect - Create a special effect attached to the overhead of (Attacking unit) using Abilities\Spells\Undead\Curse\CurseTarget.mdl
                Wait 1.00 seconds
                Special Effect - Destroy (Last created special effect)
            Else - Actions
                Do nothing

It can not work. Attacked unit doesn't mean the attacking unit damaged it, it just the animation before the attack.
 

Effane

Save/Load Code Tutorial
Reaction score
51
Yep, Chocobo is right. Just did a test map for it. The damage isnt done till after that event.

but I am sure a wait earlier on would allow you to find the damage out though. Just because the damage hasnt hit at the event time frame, doesnt mean it wont hit in the actions. Whats the longest attack animation, about 1.5 secs. You just gotta wait about that long.
 
W

Wazat

Guest
There isn't a "Unit is Damaged" event? Perhaps there should be. :(

One thing to note about preventing damage in this way, if the initial damage (before reduction/reflect) is lethal, the unit will die, even though it gets to reflect the damage back at the enemy. I also suspect that the method above will not prevent damage from spells or abilities, although perhaps you could make another trigger based off of "A unit finishes casting an ability" for most of those...

If you get this working I'll be glad to hear it, since this could be handy for my mod too! Good luck.
 
M

MoonRazer

Guest
ok i dont know if this will work but you could try this.

Code:
Trigger 1
    Events
        Unit - A unit Is attacked
    Conditions
        (Level of Channel for (Attacking unit)) Not equal to 0
    Actions
        Set ChannelAttacked = (Attacked unit)
        Trigger - Turn on Trigger 2 <gen>
        Trigger - Add to Trigger 2 <gen> the event (Unit - ChannelAttacked Takes damage)

Code:
Trigger 2
    Events
    Conditions
    Actions
        Set Allies = (All allies of (Owner of (Triggering unit)))
        Set Damage = (Damage taken)
        Player Group - Pick every player in (All allies of (Owner of (Triggering unit))) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Owner of (Damage source)) Equal to (Picked player)
                    Then - Actions
                        Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + Damage)
                        Unit - Set life of (Damage source) to ((Life of (Damage source)) - Damage)
                    Else - Actions
                        Do nothing
        Trigger - Turn off (This trigger)

It should work.
 

Sooda

Diversity enchants
Reaction score
318
I' m learning spell makeing too right now doing my first cool custom spell what has nice triggering already. I can do all with triggers but in Object Editor I' m like beginner dunno what t o do and what to add.
Just tossing out random ideas, hope you don' t mind :eek: Try to make abilty based off somekind Stone Gigant what has change to block ammount of dmg change it to 1000000 with 100 % change . Now make that ability active. So idea is that it chould be active with 5% change to cast "lighting bolt" what is disguised as ohh now I got it 100% to block 1000000 dmg. And one trigger what checks if that ability is used and then event responce to get dmg dealt to abiltiy finished casting or so and "reflect" it around you.
 
M

MoonRazer

Guest
ok about the 1000000 damage, i am just going to make it all damage.

Here are your 2 triggers

Code:
Trigger 3
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Your_Ability
    Actions
        Set StoneGiant = (Casting unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Random integer number between 1 and 100) Less than or equal to 5
            Then - Actions
                Trigger - Turn on Trigger 4 <gen>
                Trigger - Add to Trigger 4 <gen> the event (Unit - StoneGiant Takes damage)
            Else - Actions
                Do nothing

Code:
Trigger 4
    Events
    Conditions
    Actions
        Set _damage = (Damage taken)
        Unit - Set life of StoneGiant to ((Life of (Triggering unit)) + _damage)
        Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 500.00 at (Position of (Triggering unit)), dealing _damage damage of attack type Chaos and damage type Normal
        Wait 15.00 seconds
        Trigger - Turn off (This trigger)

There u go that should work
 
D

deathtomato

Guest
It can not work. Attacked unit doesn't mean the attacking unit damaged it, it just the animation before the attack.

Really?? Im pretty sure its ok... The editor states that attacked unit is ->
"When responding to an 'Is Attacked' unit event, this refers to the unit being attacked"


Effane was right if you put a wait in it it works fine, i think =_=, i used the ability for ages and i thought it was working fine...
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      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