Is there any way to check if a unit is dead, or dying? I have a chain lightning spell based off of Daelin's Tutorial (good 1 btw ) and it is supposed to summon a unit upon another's death. Heres the trigger, important part bolded
edit: i cant link nething right now (im goin thru a proxy) so heres the tutorial URL
www.thehelper.net/forums/showthread.php?t=38181
Code:
Void Lightning
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Void Lightning
Actions
Set VL_prev = (Casting unit)
Set VL_targ = (Target unit of ability being cast)
Set VL_level = (Level of Void Lightning for (Casting unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VL_level Less than or equal to 3
Then - Actions
Set VL_targetsnum = 3
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VL_level Greater than or equal to 3
VL_level Less than or equal to 4
Then - Actions
Set VL_targetsnum = 4
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VL_level Greater than or equal to 5
VL_level Less than or equal to 6
Then - Actions
Set VL_targetsnum = 5
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VL_level Equal to 7
Then - Actions
Set VL_targetsnum = 6
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VL_level Equal to 8
Then - Actions
Set VL_targetsnum = 7
Else - Actions
For each (Integer MB_cur) from 1 to VL_targetsnum, do (Actions)
Loop - Actions
Unit Group - Add VL_targ to VL_alltargs
-------- Effect Part --------
Set VL_TempPoint = (Position of VL_prev)
Unit - Create 1 Albatross for (Owner of (Triggering unit)) at VL_TempPoint facing Default building facing degrees
Custom script: call RemoveLocation(udg_MB_TempPoint)
Animation - Change (Last created unit) flying height to 50.00 at 0.00
Unit - Hide (Last created unit)
Unit - Add Void Lightning (EFFECT) to (Last created unit)
Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike VL_targ
Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
-------- Waiting part --------
Wait until (((VL_targ has buff Void Lightning ) Equal to True) or ((VL_targ is dead) Equal to True)), checking every 0.35 seconds
-------- Spell part --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(VL_targ is dead) Equal to False
Then - Actions
Set VL_TempPoint = (Position of VL_targ)
Unit - Create 1 Albatross for (Owner of (Triggering unit)) at VL_TempPoint facing Default building facing degrees
Custom script: call RemoveLocation(udg_MB_TempPoint)
Unit - Hide (Last created unit)
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Unit - Add Void Lightning [Chain Spell] to (Last created unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VL_level Greater than or equal to 1
VL_level Less than or equal to 2
Then - Actions
Unit - Set level of Void Lightning [Chain Spell] for (Last created unit) to (((3 x (VL_level - 1)) + 0) + MB_cur)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VL_level Greater than or equal to 3
VL_level Less than or equal to 4
Then - Actions
Unit - Set level of Void Lightning [Chain Spell] for (Last created unit) to (((4 x (VL_level - 3)) + 6) + MB_cur)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VL_level Greater than or equal to 5
VL_level Less than or equal to 6
Then - Actions
Unit - Set level of Void Lightning [Chain Spell] for (Last created unit) to (((5 x (VL_level - 5)) + 14) + MB_cur)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VL_level Equal to 7
Then - Actions
Unit - Set level of Void Lightning [Chain Spell] for (Last created unit) to ((25 - 1) + MB_cur)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
VL_level Equal to 8
Then - Actions
Unit - Set level of Void Lightning [Chain Spell] for (Last created unit) to ((31 - 1) + MB_cur)
Else - Actions
Set VL_prev = VL_targ
Set VL_TempPoint = (Position of VL_prev)
Unit - Order (Last created unit) to Human Mountain King - Storm Bolt VL_targ
Unit - Remove Stunned (Pause) buff from VL_targ
Wait 0.01 game-time seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
[B] If - Conditions
(VL_targ is dead) Equal to True
Then - Actions
Set Temp_Point = VL_TempPoint
Unit - Create 1 Void_Summons_Units[(Random integer number between ((VL_level x 2) - 1) and (VL_level x 2))] for (Owner of (Casting unit)) at Temp_Point facing Default building facing degrees
Custom script: call RemoveLocation (udg_Temp_Point)
Else - Actions[/B]
Else - Actions
Set MB_cur = (VL_targetsnum + 1)
-------- Choice Part --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MB_cur Less than VL_targetsnum
Then - Actions
Unit Group - Pick every unit in (Units within 500.00 of (Position of VL_prev)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is A structure) Equal to False
((Picked unit) is Magic Immune) Equal to False
((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
((Picked unit) is dead) Equal to False
((Picked unit) is in VL_alltargs) Equal to False
Then - Actions
Set VL_targ = (Picked unit)
Else - Actions
Unit Group - Remove (Picked unit) from (Last created unit group)
Else - Actions
Custom script: call RemoveLocation(udg_MB_TempPoint)
Unit Group - Remove all units from VL_alltargs
edit: i cant link nething right now (im goin thru a proxy) so heres the tutorial URL
www.thehelper.net/forums/showthread.php?t=38181