| 12-28-2006, 07:09 PM | #1 |
Hello, I have been trying to get the ability life drain to work on allies and enemies, but I don't think it is possible. So I have to make it with triggers. I am not making it for the life drain effect, I want it for the lightning effect and I want the unit that casts it to do the same thing a unit casting life drain would do. He casts it and channels it for X seconds, if the casting unit moves or the target unit goes out of range, or if the target gets stunned or something, or if the time runs out the ability stops. As long as he is channeling the spell the life drain lightning effect should go from the caster to the target. Any help with this would be great, I will work on it and post what I triggered. |
| 12-28-2006, 07:33 PM | #2 |
Set allowed targets to both allies and enemies, then make it so that the health sapped/received is zero. As far as I can see, thats about all there is to it. Maybe theres smething in Gameplay Constants pertaining to Drain thats messing it up. |
| 12-28-2006, 07:48 PM | #3 |
I have tried changing the constants, it doesn't work. I am trying to get the unit to channel when the ability it cast, I did this. Trigger: Unit - Order (Triggering unit) to Special - ChannelThis doesn't seem to work, when the ability is cast the unit doesn't channel, the animation doesn't change. |
| 12-28-2006, 07:57 PM | #4 |
I thought life drain channels by default? |
| 12-28-2006, 08:09 PM | #5 | |
Quote:
That's normal if Channel is supposed to target an enemy. There is only channel in GUI for Self. Not targets or point. |
| 12-28-2006, 08:36 PM | #6 |
Channel is an ability, I think you instead want to set the unit's animation to "channel" instead. |
| 12-29-2006, 06:08 AM | #7 |
Trigger: Untitled Trigger 002
![]() Conditions
Does this leak? and is it right because if the unit goes farther away than 800, then the spell should stop channeling. |
| 12-29-2006, 01:14 PM | #8 | |
Quote:
It does leak. You are using a location (Position of Casting_Unit_Drain) without removing it later. Also, remove the 'Do Nothing' action, it does nothing and it's useless. |
| 12-30-2006, 07:16 PM | #10 |
How do you set the unit variable to null? Everytime the unit casts the ability it sets the unit variables again. Also something is wrong, when I go far away and then cast it on a unit, so the caster has to run up and cast it, the spell stop immediately. I guess position of unit and the point where the unit is for the object editor is different, because the casting range is set to 800. |
| 12-30-2006, 07:20 PM | #11 |
custom script: set udg_(your variablename) = null if its a global, it wont leak, so you dnot have to bother. but if its a global turned into a local, you need to. |
| 01-02-2007, 08:03 PM | #12 |
Should I just make the distance between the two points more than 800, does anyone know how much it is off by? |
| 01-02-2007, 09:24 PM | #13 | |
Quote:
thats not the reason why he should set it to null (in GUI you can set it to No Unit (= null)). If he doesnt turn the trigger on and off, it will constatly check the distance between the two variables, so, if the globals is pointing to some other units, or those, and the distance is greater than 800. then, the Casting_Unit_Drain will halt whatever its doing (for example moving) every 0.1 second. edit: about the distance, the range you are looking for (if you didn't already know) is the Area of Effect value, which will be checked every 1 second (by default) |
