- Joined
- May 31, 2008
- Messages
- 698
I am working on a spell similar to black arrow (skeleton spawns when you kill a unit) but i want to make it so when you kill a unit with the spell, that unit that you just killed respawns but for you. The base spell was black arrow. If there seems to be no way to fix this i was thinking of a passive ability where there is a percent chance that the unit will spawn, but i dont know how to do this.
This is the trigger i made but it doesnt really work all the time, sometimes more than one unit spawns and idk how to fix this:
This is the trigger i made but it doesnt really work all the time, sometimes more than one unit spawns and idk how to fix this:
-
Possessive Arrow
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
Actions
-
Set Possessive_Owner[(Player number of (Owner of (Attacking unit)))] = (Owner of (Attacking unit))
-
Set Possessive_Target[(Player number of (Owner of (Attacked unit)))] = (Attacked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Possessive_Target[(Player number of (Owner of (Attacked unit)))] has buff Possessive Arrow ) Equal to True
-
-
Then - Actions
-
Wait until ((Possessive_Target[(Player number of (Owner of (Attacked unit)))] is dead) Equal to True), checking every 0.10 seconds
-
Unit - Create 1 (Unit-type of Possessive_Target[(Player number of (Owner of (Attacked unit)))]) for Possessive_Owner[(Player number of (Owner of (Attacking unit)))] at (Position of Possessive_Target[(Player number of (Owner of (Attacked unit)))]) facing Default building facing degrees
-
-
Else - Actions
-
Do nothing
-
-
-
-