HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Reducing life with triggers

11-30-2003, 03:48 PM#1
Kolibri
I have some triggers activated by an ability that use the

Set life to current life - <SOME VALUE>

If this trigger kills the unit the casting unit obviously don't get any gold, but does it get XP for killing the unit?

What I'm asking is if a unit dies by triggers (either by setting its life to a negative value or 0 or by using Unit - Kill action) will closeby heroes owned by enemies of the dying unit get XP?
11-30-2003, 03:59 PM#2
Norbo
I'm fairly positive that the answer is no. It doesn't know which player to give the experience to, so it just sits on its butt.

You could do it manually with more triggers maybe.
11-30-2003, 04:15 PM#3
Kolibri
Bummer.

I thought the computer just gave out the XP equally to all enemy heroes close by (as it normally does).

EDIT: Can anybody confirm that units killed by the Set Life Action DOES NOT give XP?
11-30-2003, 06:42 PM#4
Captain Griffen
Yes, I can.

Simply just use a mathimatical trigger (look under gameplay constants for what it is) and give xp/number of heros around to each of the heros.
11-30-2003, 06:48 PM#5
linkmaster23
No Kolribi, it does not. You will have to make a Trigger thats not intailly on, and in the middle of the triggered move, turn it on. Like

Event-A unit dies
Action-Set hero exp + However much u need

Thats about as close as you can get it. At least thats how im going to do it.Just make sure it gives the EXP to the Hero, and not to an enemy hero!
11-30-2003, 06:51 PM#6
vjeux
Create an unit who get lvl of died unit by trigger
Set it to 1pv
Create an other unit to player who need to get xp
order to kill the first unit
kill 2 last created unit

you can remove shadow and set a wrong model (invisible) :)

11-30-2003, 06:58 PM#7
linkmaster23
Dude that made no sense, if i didnt know how to do it, then i would have never comprehened what u just said. Let me Translate.

Create a trigger that reconizes the dying unit. Then create 2 invisible units with no shadow. one for you and one for the enemy that ur killing. Then just order your unit to kill it. That simple. Make sure the enemy unit has low life so your not waiting 4 hours for it to die.
11-30-2003, 07:42 PM#8
Kolibri
Great, now I have to edit a bunch of my trigger-based abilities. :(
11-30-2003, 07:44 PM#9
linkmaster23
Well dude, your last possible out come is to just give him XP for just using the move and hurting an enemy. That way you dont have to edit so much.
11-30-2003, 08:20 PM#10
Ligature
The easiest way around this problem is: NEVER use the "Unit - Set Life" action to have spells kill units. Have your spell create an invisible damage dealing unit of some kind and have IT hurt the target. Or if you must use the trigger, force your trigger to set the target's life to 1 if the result is going to be less than that, and then use the damage dealer.

A good choice for damage dealing is the AOE damage on death ability - give it to some invisible unit, move the unit to the target's location, and kill it: instant damage, with nothing left to clean up.
11-30-2003, 08:25 PM#11
linkmaster23
LOL, the lag...
11-30-2003, 08:27 PM#12
Xinlitik
Yep, I never use set life, except when it's to heal somebody.

It's just so much easier to create an invisible to storm bolt the target or whatever than to create a shadow unit and kill it and blah..
11-30-2003, 10:27 PM#13
Kolibri
It turned that I only used the Set Life Action to deal damage once in a old trigger, so it seems I got lucky. :D