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

Help with reflect damage

Status
Not open for further replies.
Level 5
Joined
Aug 23, 2007
Messages
141
I need help with a buff that increases damage by a high amount, but causes anything you attack while under that buff to reflect damage to you.

5 levels, level 1, 100% reflect, level 2, 90% reflect, level 3, 80% reflect, level 4, 70% reflect, level 5, 60% reflect.

Don't bother suggesting trying to use a dummy with thorns aura by the way... Applying the aura is a bit delayed and it's a bit hard to manipulate it so it only affects the attacked unit. I'll take a jass suggestion, but I'll need it posted, pls. I'm no good at jass... thanks.
 
Level 11
Joined
Dec 31, 2007
Messages
780
well... very well done damage detection systems exists... but perhaps maybe a little too much for a simple spell

if you want i can help you to create a damage detection system in gui (not efficient and that kind of things... but it will work :p)
 
Level 11
Joined
Dec 31, 2007
Messages
780
well... maybe you should try to implement a damage detection system made in jass ... a DDS made in gui can also detect damage taken for many units... but jass is a lot better

else

here is the main idea...

there is an action: "add event to trigger" where you can add an event to a trigger (duh!) but the thing with it is that you can add a unit variable to an event of "takes damage" for IE:

unit starts the effect of an ability

ability beeing cast = to blabla

add to trigger (damage detection) (Castin unit) takes damage


this will make as event in a trigger called "damage detection" your casting unit takes damage

making posible for you to detect when any unit added via this trigger takes damage

the problem is that events are never deleted (even if the unit dies... those events stay there)... if you need (and wanna keep going with this) i can try to help you a little bit more
 
Level 5
Joined
Aug 23, 2007
Messages
141
Hmm. Okay, so damage is detedted. Now how to reflect it, and make sure that the never deleted events don't cause that much of a nuisance? And if the events aren't deleted, might that cause some lag late game?
 
Level 6
Joined
Feb 21, 2008
Messages
205
Unit is attacked
Attacking unit has buff "frenzy" equal to true
If frenzy equal to lvl 1 or something
Make attacked unit Deal damage taken to attacking unit (yes that is possible)
if frenzy equal to lvl 2, can u store the damage taken in a variable, divide it by 100, and multiplie it with 90.

Will that work?
 
Level 11
Joined
Dec 31, 2007
Messages
780
Unit is attacked
Attacking unit has buff "frenzy" equal to true
If frenzy equal to lvl 1 or something
Make attacked unit Deal damage taken to attacking unit (yes that is possible)
if frenzy equal to lvl 2, can u store the damage taken in a variable, divide it by 100, and multiplie it with 90.

unit is attacked fires when the attackers raises his hand... not when the attacked takes damage... so Attacked unit will not work... once you have detected the damage taken by a unit make a trigger that deals "damage taken * 0.something" to (any unit)
 
Level 5
Joined
Aug 23, 2007
Messages
141
Hold everything. I found a bit of a bug with this set. It reflects ALL damage types, whether it's from attack or magic. Kind of like Spectre's dispersion ability. What I need is a skill that increases one's damage, but causes any damage caused by his attacks to be partially reflected back to himself. Any ideas?
 
Level 11
Joined
Dec 31, 2007
Messages
780
Unit is attacked

attacking unit equal to your hero

trigger - turn on X unit tages damage trigger

----

X unit takes damage

Damage source = to (The hero who has splash ability)


trigger - turn off this trigger
all of the other actions


---

A unit starts the effect of an ability

Castin unit equal to (the unit that has splash damage ability)

trigger - turn off X unit takes damage


---

youll need all of those triggers/actions to make it work... but even thou it has its flaws... as i said... i recommend a damage detection system... but this may work... not 100%... perhaps a 70%~80% :p


EDIT: if you add an event for a unit that has already been added it will be added again... you have to use a unit group and check if the unit is in that group... if it is not then add the unit to the event and add the unit to the group... else dont add it to the event
 
Last edited:
Level 5
Joined
Aug 23, 2007
Messages
141
The slight problem is that auras are delayed in activating. When a dummy is summoned with an aura, it takes about 1 point something seconds to apply the aura buff, and another delay to remove it once the dummy is gone.
 
Level 9
Joined
Jan 23, 2008
Messages
384
Ok here is an idea for you :
Make your ability from immolation and when you active immolation you add in to a spell book on your hero a dummy spell made from thons aura but you modify the targets to enemy (only) when you order unimmolation or your out of mana the aura should be removed from the spell book
 
Level 5
Joined
Aug 23, 2007
Messages
141
Well, wont thorns aura reflect damage to every melee unit that attacks and not just the guy with the buff?
 
Level 13
Joined
May 11, 2008
Messages
1,198
it should be so simple as to be able to take the unit is damaged event and put in an action making the damaged unit hurt the source of damage according to the damage ammount. problem with this is that it can only be used with a specific unit.
that's what i found out. so i hit a dead end. eh...it's a mystery.

by the way...can the damage stuff even be used unless you are using units that are placed on the map? i tried using a variable unit for the specific unit event and it doesn't work.
 
Level 17
Joined
Jan 21, 2007
Messages
2,014
it should be so simple as to be able to take the unit is damaged event and put in an action making the damaged unit hurt the source of damage according to the damage ammount. problem with this is that it can only be used with a specific unit.
that's what i found out. so i hit a dead end. eh...it's a mystery.

by the way...can the damage stuff even be used unless you are using units that are placed on the map? i tried using a variable unit for the specific unit event and it doesn't work.

You'll have to add the event through a specific trigger. This leaks though.
 
Level 11
Joined
Dec 31, 2007
Messages
780
well... maybe you should try to implement a damage detection system made in jass ... a DDS made in gui can also detect damage taken for many units... but jass is a lot better

else

here is the main idea...

there is an action: "add event to trigger" where you can add an event to a trigger (duh!) but the thing with it is that you can add a unit variable to an event of "takes damage" for IE:

unit starts the effect of an ability

ability beeing cast = to blabla

add to trigger (damage detection) (Castin unit) takes damage


this will make as event in a trigger called "damage detection" your casting unit takes damage

making posible for you to detect when any unit added via this trigger takes damage

the problem is that events are never deleted (even if the unit dies... those events stay there)... if you need (and wanna keep going with this) i can try to help you a little bit more


unit is attacked fires when the attackers raises his hand... not when the attacked takes damage... so Attacked unit will not work... once you have detected the damage taken by a unit make a trigger that deals "damage taken * 0.something" to (any unit)


Unit is attacked

attacking unit equal to your hero

trigger - turn on X unit tages damage trigger

----

X unit takes damage

Damage source = to (The hero who has splash ability)


trigger - turn off this trigger
all of the other actions


---

A unit starts the effect of an ability

Castin unit equal to (the unit that has splash damage ability)

trigger - turn off X unit takes damage


---

youll need all of those triggers/actions to make it work... but even thou it has its flaws... as i said... i recommend a damage detection system... but this may work... not 100%... perhaps a 70%~80% :p


EDIT: if you add an event for a unit that has already been added it will be added again... you have to use a unit group and check if the unit is in that group... if it is not then add the unit to the event and add the unit to the group... else dont add it to the event

the next time try to read what other people has posted before posting... perhaps you can learn something
 
Status
Not open for further replies.
Top