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

Using non-real unit variables in events?

Status
Not open for further replies.
Level 2
Joined
Aug 7, 2005
Messages
13
I am trying to make a spell called blessed reversal, if a unit activates it for X seconds any damage that unit takes instead heals it, I have succesfully got the spell to work using the event - Supific unit event - unit takes damage, then using event response - amount of damage taken.
However i would like to do it with a non suspific unit however there is no generic unit event - unit takes damage and i tried using the WE unlimiteds any unit takes damage event but that always returns damage taken as 0.000 is there anyway i can use a unit variable in the event or any other way of doing this?
 
Level 6
Joined
Mar 18, 2005
Messages
153
i never tried such a thing before but guess theres no way to make it in a generic way. detecting an attack is no problem but receiving the damagevalue is hard. either u list all possible units (all heroes?) as eventpossibilities or u find another way like 200% damagereduction... id personally suggest that u save the hp of the unit in a varaible and add the livebonus after the ability is over so it makes at least sense to attack the unit while the ability is active.
e.g. activates while having 70 hp, ability is over and it has 50 hp: it gains 2x20=40 hp and has 90.

edit: in case u make it like that... remember to prevent overlaps! an array should do it.
 
Status
Not open for further replies.
Top