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

[Spell] trigger: Mana Loss on taking damage

Status
Not open for further replies.
Level 3
Joined
Jun 3, 2013
Messages
39
If a unit takes damage, deplete attacked unit of the same amount of mana
Already got the damage part done, just need to know how to get the exact amount of health damaged.
 
Level 3
Joined
Jun 3, 2013
Messages
39
  • aeiou
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Attacked unit)) Equal to Daemon
    • Actions
      • Set Real_Mana_Depleted = (Damage taken)
      • Unit - Set mana of (Attacked unit) to ((Unit: (Attacked unit)'s Real Field: Mana ('umpc')) - Real_Mana_Depleted)
Now that I've tested it, the event doesn't seem to be actually triggering.
 
Level 5
Joined
Jul 12, 2016
Messages
59
It's because you're using the "A unit is attacked" event, you need to be using the "A unit takes damage" event. You can't add it as a generic unit event, you need to add it as a specific unit event. The way I usually get around it is that I make a second trigger that goes like this:
  • Add Unit to Group
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) is in UnitGroup_DamageEvent.) Equal to False
    • Actions
      • Unit Group - Add (Triggering unit) to UnitGroup_DamageEvent
      • Trigger - Add to Your ManaDamage Trigger <gen> the event (Unit - (Triggering unit) Takes damage)
The action you're looking for is called "Trigger - Add New Event"
 
Level 3
Joined
Jun 3, 2013
Messages
39
It's because you're using the "A unit is attacked" event, you need to be using the "A unit takes damage" event. You can't add it as a generic unit event, you need to add it as a specific unit event. The way I usually get around it is that I make a second trigger that goes like this:
  • Add Unit to Group
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) is in UnitGroup_DamageEvent.) Equal to False
    • Actions
      • Unit Group - Add (Triggering unit) to UnitGroup_DamageEvent
      • Trigger - Add to Your ManaDamage Trigger <gen> the event (Unit - (Triggering unit) Takes damage)
The action you're looking for is called "Trigger - Add New Event"
Now working! thx
 
Level 1
Joined
Mar 23, 2020
Messages
5
You can use the Arcane Tower's feedback ability. It burns fixed amount of mana of target every hit.
 
Last edited:
Status
Not open for further replies.
Top