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

[Trigger] Mirror Shield

Status
Not open for further replies.
Level 6
Joined
Dec 28, 2007
Messages
178
If you want an ability like the Cryptlord's passive ability that can reduce the ranged attacks' damage here's a kinda solution:

give tha skill to your hero and make it give a buff.
Here comes the trigger:
Need one that stores the hero's heath in a real variable everey .... 0.2 seconds...

Another:anytime a ranged unit attacks a unit that has the buff(you can make the spell with 3 buffs- one for each level to detect in the trigger its level) set the hero's health to(for example): health now + ((stored health-health now)/2)

and that will heal the half of the damage

the problem is: the hero will take the damage and after that it will be healed, so if it has 60hp, and has 50% damage reduction, and a unit attacks it with 100 damage it will die, cuz it works like that:
1.hero takes damage
2.hero will get some lost hp back

*if you really want i may make the triggers for ya
 
Level 6
Joined
Dec 28, 2007
Messages
178
oh i see, so its easier :wink:

need a trigger to store the hero who learns the skill

event
(stored hero) takes damage
condition
unit has buff (mirror shield)
action
unit - cause (stored hero) to damage (attacker) dealing (damage taken)..blah

thats all
 
Level 9
Joined
Apr 6, 2008
Messages
436
dealing (damage taken)
And that's impossible.
Try a modified version of "Torns aura?"
I can't use it to do so.

Edit: I found the variable "Damage Taken". I'm sorry, I shouldn't even have created this thread... But that damn "Damage Taken" was hidden in "Response to the event"

Edit: Damage Taken only works for the Only-Jass Event EVENT_UNIT_DAMAGED, which must be referred to a unit in particular, so I can't use it. Any other ideas?
 
Last edited:
Level 6
Joined
Dec 28, 2007
Messages
178
Here's the working Mirror Shield
This unit will protect himself with the Mirror Shield. Every taken damage will be taken back to the attacker.
Lasts 10 seconds

based on berserk :p
 

Attachments

  • MirrorShield.w3x
    17.7 KB · Views: 65
Level 22
Joined
Dec 31, 2006
Messages
2,216
Trigger 1:
  • Events
    • Unit - A unit Learns a skill
  • Conditions
    • (Learned Hero Skill) Equal to YOUR SKILL
  • Actions
    • Trigger - Add to SOME TRIGGER <gen> the event (Unit - (Triggering unit) Takes damage)
Trigger 2:
  • Events
  • Conditions
  • Actions
    • Set Attacker = (Damage source)
    • Unit - Cause (Triggering unit) to damage Attacker, dealing (Damage taken) damage of attack type Normal and damage type Normal
Edit: LightBloOD was faster..

Edit2: I tested the spell and it's not MUI and not permanent like mine.
 
Status
Not open for further replies.
Top