• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Trigger] Half damage taken in mana?

Status
Not open for further replies.
Level 4
Joined
Jun 22, 2009
Messages
63
Im creating an ability called Reversal Armor. it's supposed to give half the damage you take in mana. But i cant find any way to detect the damage taken.
 
Never done this before but try:

  • Reversal Armor Learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Reversal Armor
    • Actions
      • Trigger - Add to Reversal Armor Cast <gen> the event (Unit - (Learning Hero) Takes damage)
      • Trigger - Turn off (This trigger)
  • Reversal Armor Cast
    • Events
    • Conditions
    • Actions
      • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + ((Damage taken) x 0.50))
 
Ok what you want is actually fairly simple, however it can only be detected by the Unit Specific Unit takes damage event. You can't use a Unit Generic Unit Event.

So basically you have to register the event on every unit that learns that ability. Yes this does leak if the heroes are disposable, but usually heroes tend not to be.

  • Set Up
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Reversal Armor
    • Actions
      • Trigger - Add to DoReversal <gen> the event (Unit - (Learning Hero) Takes damage)
  • DoReversal
    • Events
    • Conditions
    • Actions
      • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + ((Damage taken) x 0.50))
Tested, it works hehe
 
you could if you used custom script: set udg_unit = GetTriggerUnit()
where udg_unit is a global variable called unit then just use unit whenever referring to the attacked unit.
 
Status
Not open for further replies.
Back
Top