• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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