Outbreak191
New Member
- Reaction score
- 17
Im making an ability which kills a unit instantly and gives a chance to make a spirit version (made by creating a copy of killed unit and casting banish on it) but it doesn't seem to create the sprit version of the target of the ability being cast. I know the conditions work because i tested with a visible dummy unit and I could see him.
Code:
Judgement
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Judgement
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of (Ability being cast) for (Casting unit)) Equal to 1
Then - Actions
Set Judgement_Chance = 1
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Judgement_Chance Equal to 1
Then - Actions
Wait 2.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Casting unit) belongs to an ally of Player 1 (Red)) Equal to True
Then - Actions
Unit - Create 1 (Unit-type of (Target unit of ability being cast)) for Player 1 (Red) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
Else - Actions
Unit - Create 1 (Unit-type of (Target unit of ability being cast)) for Player 7 (Green) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
Unit - Add Phoenix Fire to (Last created unit)
Set Judgement_Spirit = (Last created unit)
Unit - Create 1 Dummy Unit for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
Unit - Add Banish to (Last created unit)
Unit - Order (Last created unit) to Human Blood Mage - Banish Judgement_Spirit
Wait 1.00 seconds
Unit - Make Judgement_Spirit Invulnerable
Unit Group - Pick every unit in (Units within 512.00 of (Position of Judgement_Spirit) matching (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units of type (Unit-type of (Picked unit)))) Equal to 0
Then - Actions
Unit - Kill Judgement_Spirit
Else - Actions
Unit - Order Judgement_Spirit to Follow (Picked unit)
Wait 10.00 seconds
Else - Actions
Else - Actions