HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

GUI Triggered Life Drain

12-28-2006, 07:09 PM#1
Odin845
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
darkwulfv
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
Odin845
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 - Channel

This 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
darkwulfv
I thought life drain channels by default?
12-28-2006, 08:09 PM#5
Chocobo
Quote:
Originally Posted by Odin845
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 - Channel

This doesn't seem to work, when the ability is cast the unit doesn't channel, the animation doesn't change.

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
wyrmlord
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
Odin845
Trigger:
Untitled Trigger 002
Collapse Events
Time - Every 0.10 seconds of game time
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Target_of_Ability_Drain is in (Units within 800.00 of (Position of Casting_Unit_Drain))) Equal to False
Collapse Then - Actions
Unit - Order Casting_Unit_Drain to Stop
Collapse Else - Actions
Do nothing

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
wyrmlord
Quote:
Originally Posted by Odin845
Trigger:
Untitled Trigger 002
Collapse Events
Time - Every 0.10 seconds of game time
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Target_of_Ability_Drain is in (Units within 800.00 of (Position of Casting_Unit_Drain))) Equal to False
Collapse Then - Actions
Unit - Order Casting_Unit_Drain to Stop
Collapse Else - Actions
Do nothing

Does this leak? and is it right because if the unit goes farther away than 800, then the spell should stop channeling.

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-29-2006, 03:13 PM#9
oNdizZ
he also leaks a group,
use the real comparsion 'Distance Between Locations' instead, and store the two points into variables and at the end of your trigger, remove them.
humm, ill give an example in a min.

Trigger:
asd
Collapse Events
Time - Every 0.10 seconds of game time
Conditions
Collapse Actions
Set tempPoint = (Position of (Casting_Unit_Drain))
Set tempPoint2 = (Position of (Target_of_Ability_Drain))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Distance between tempPoint and tempPoint2) Greater than 800.00
Collapse Then - Actions
Unit - Order (Casting_Unit_Drain) to Stop
/*I suggest you set your two unit variables to null here or add another boolean so your caster won't get stopped all the time after casting this ability once*/
Else - Actions
Custom script: call RemoveLocation(udg_tempPoint)
Custom script: call RemoveLocation(udg_tempPoint2)
12-30-2006, 07:16 PM#10
Odin845
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
darkwulfv
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
Odin845
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
oNdizZ
Quote:
Originally Posted by darkwulfv
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.

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)