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

Mana shield that reflects damage

Status
Not open for further replies.
Level 3
Joined
Feb 20, 2008
Messages
54
Hey I want to make a trigger in which if a unit has mana shield actived it has a chance of reflecting the damage done to him back to the attacker... Can anyone help me?
 
Level 3
Joined
Nov 10, 2007
Messages
49
Units is attacked
if attacked units had buff = to mana shield
cause attacked units to deal damage to attacked unit and so on
chance huh cant remember atm
 
Level 3
Joined
Nov 10, 2007
Messages
49
Sorry , but you have to explain this to me again

"I don't know how to do the damage that has been done to him"
You mean when it has been attacked?
 
Level 3
Joined
Feb 20, 2008
Messages
54
Sorry , but you have to explain this to me again

"I don't know how to do the damage that has been done to him"
You mean when it has been attacked?

Well yeah, when it's attacked to give the damage done to him back to the attacker...

@-BerZeKeR- yeah you understood what I meant, hopefully someone will have the answer to this enigma... :D
 
Level 3
Joined
Nov 10, 2007
Messages
49
This is somthing that i got it works the moment the attacked unit has the buff.

Unit - Cause (Attacking unit) to damage (Attacked unit), dealing (7.00 + (3.00 x (Real((Level of Open Wounds for Hero_BloodKnight))))) damage of attack type Normal and damage type Normal
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
it would be very easy

Make a trigger with no events
Events
Conditions
---If Triggering Unit has Mana Shield Buff
Actions
---Cause Triggering Unit to damage (Event Damage Source) by (Damage Done) Attack type of spells etc

When Someone learns Mana Shield
if Level of its mana shield is 1 ( so it will be his first learning)
Add (Triggering Unit) takes damage event to First trigger

Only use for heroes
for units this would leak much
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
Don't forget that the shielded unit could be on low mana... then it's stupid when the manashield absorbs 6 damage and gives 150 damage back..you should calculate the damage done like this:
damageReturn = min( DamageDone, (Level of Mana Shield for (Damaged Unit) + 1 ) *0,5 * (Mana of Damaged unit) )
(If you are using the standard mana shield MP:HP ratios of 1/1,5/2. Otherwise you should adjust the formula.
 
Status
Not open for further replies.
Top