• 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] Please help me with my spell

Status
Not open for further replies.
Level 5
Joined
Jan 17, 2014
Messages
131
Hey guys and girls, I'm making an earth shield spell. If you've played World of Warcraft you'd know what it does. Everything is fine except for 1 thing. I want the earth shield to heal after the unit takes damage, but I can't figure out how. My test map should clarify things.
 

Attachments

  • Earth Shield.w3x
    69.3 KB · Views: 43
Level 5
Joined
Jan 17, 2014
Messages
131
You will need damage detection system which detects when unit takes damage.
There are plenty of those here on hive, just download one which suits you the best and use it.

You didn't look at my map did you? You see, my trigger detects damage, but even when I use the function "Unit Takes Damage" the trigger runs before the actual damage is applied. It goes like this. The unit is healed and then it takes the damage. What I need is that the unit would take the damage first and then be healed.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Yes, the Unit takes damage event fires before the actual damage is applied. However unless your Earth Shield ability is selfcast only (compared to the one in WoW which can be cast on any friendly target), adding unit to the "Unit takes damage" event is inefficient.

More than that, a damage detection system allows you to catch when unit takes damage and modify that damage. It's also set up so there's only 1 damage dealt, not that there's one damage dealt by unit and then one modified by your spell.
It will also solve things like unit with full health taking damage and your trigger healing that unit before the damage is dealt, thus the heal is negated --> with DDS if unit with full health takes damage, the heal will be applied correctly.
 
Level 5
Joined
Jan 17, 2014
Messages
131
Yes, the Unit takes damage event fires before the actual damage is applied. However unless your Earth Shield ability is selfcast only (compared to the one in WoW which can be cast on any friendly target), adding unit to the "Unit takes damage" event is inefficient.

More than that, a damage detection system allows you to catch when unit takes damage and modify that damage. It's also set up so there's only 1 damage dealt, not that there's one damage dealt by unit and then one modified by your spell.
It will also solve things like unit with full health taking damage and your trigger healing that unit before the damage is dealt, thus the heal is negated --> with DDS if unit with full health takes damage, the heal will be applied correctly.

I've tried several GUI DDS and they aren't much different than mine, but if you mean JASS forget it. I'm unfamiliar with JASS.

P.S.: If you please, why don't you have a look at the map? I'm sure it will make things a lot easier.
 
Level 5
Joined
Jan 17, 2014
Messages
131
If there is no GUI way to do this, then I'll have to use... Phffff... Waits. They might(most definitely) backfire though.
 
Status
Not open for further replies.
Top