HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Damaged units in WEU...?

11-11-2005, 06:57 PM#1
Scioninja
I'm making an ability that causes a unit to be healed for 200% of all damage it receives for a duration. I thought this would be a simple matter of using a "Unit takes damage" event and healing for (Damagetaken x 2)on the damaged unit, but WEU doesn't seem to like that idea. Under generic unit events, there is no "unit takes damage" function that I can see, and under specific unit events, I can only reference units that have already been placed which wont do at all. Am I missing something? Why can I not reference the damaged unit? Could someone make this trigger work for me? This is what I tried, in an attempt to get around the weird lack of a generic "unit takes damage" event but it doesnt work:

Code:
Events
    Advanced - Any unit takes damage

Conditions

Actions
    Unit Group - Pick every unit in (Units within 3000.00 of (Position of (Damage source)) matching (((Matching unit) has buff Bend Fate ) Equal to True)) and do (Actions)
        Loop - Actions
            Advanced - Heal (Picked unit) for ((Damage taken) x 2.00) hitpoints

Any help in solving this stupid problem for me would be greatly appreciated. Oh and yes I do have advanced triggers enabled and the map initialization run on them, so that isn't the problem.
11-11-2005, 07:29 PM#2
TaintedReality
Well I've never done it using the WEU function, but there is another pretty easy way to do it that works. Make another trigger with the event Unit Enters Map. Then in the action add the event Unit-Entering Unit Takes Damage to your spell trigger. This won't take pre-placed units, since they never actually enter the map, they're already there, but unless you can just create the pre-placed units with triggers if you need to.
11-11-2005, 09:23 PM#3
Scioninja
Thank you so much. I didn't do exactly what you said, but I ran with it and ended up with:

Code:
Bend Fate
    Events
    Conditions
        (BendFateTarget has buff Bend Fate ) Equal to True
    Actions
        Unit - Set life of BendFateTarget to ((Life of BendFateTarget) + ((Damage taken) x 2.00))

Bend Fate 2
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Bend Fate 
    Actions
        Set BendFateTarget = (Target unit of ability being cast)
        Trigger - Add to Bend Fate <gen> the event (Unit - (Target unit of ability being cast) Takes damage)

And it works! Thanks again!
11-12-2005, 02:31 PM#4
Mystic Prophet
Hmm interesting, I might be able to use this make a stat based version of hardened skin. I'll add that to the project list. I just need to figure out how to set the damage cannot be reduced by more than (ammount) damage part.
Oh i got it. since i'll only be using it on heroes anyway and they'll have variables, I can simply put in some if then statements to set the ammounts. Thanks for indirectly helping me out.
11-13-2005, 05:06 PM#5
Captain Griffen
You could try using berserk, which I use commonly to decrease damage taken; not sure if you can use it to reduce the damage by 200% (shift click and then use minus numbers to reduce damage taken).
11-17-2005, 12:23 AM#6
Mystic Prophet
Ya I know there's other ways to reduce damage but i want to simulate hardened skin. Speaking of which, I'm having a bit of trouble with it. It tends to work for the first hit or two but then it starts going back and forth between the two life totals. such as 100 life to 85 to 65 to 85 to 65 etc.

I realize this won't work in multiplayer but that can be fixed later the part i'm trying to get right is the actions on skin2

Code:
Skin
Events
  Unit - a unit learns a skill
Conditions
  (learned hero skill) equal to Skin
Actions
  Set unit_skin_target = triggering unit
  Trigger - add to skin2 <gen> the event (unit- Unit_skin_target takes damage)

Skin2
Events
Conditions
Actions
  If damage takem equal to ((level of unitskintarget) x (str of unitskintarget/3)+3)then do
  Unit- set life of unitskintarget to (((life of unit skin target) + (damage taken)) -3) else do
  Unit- set life of unitskintarget to (life of unit skin target) + ((level of skin for unitskintarget) x (str of unitskintarget/3))

Both of the actions cause the bug i mentioned above. Not sure why, the math is sound.

Nm found the problem. It was creating the event each time you leveled up the skill. So at any level higher than one it would activate multiple times which would cause you to heal.