Hello! The title isn't so clear so I'll explain here what I want to do.
Players in my map (survival map) have the possibility of making units to gather resources and repair buildings.
I'm adding a custom (triggering ability) that work as follow:
There's a chance that the unit becomes agressive and attack the player (changing ownership of the unit) but the problem is, I want the unit to come back to his ancient owner if its health drops bellow 20.
Here is what I have so far:
Thanks!
Edit: Wow... nevermind... I never saw the change to previous owner function... *feeling dumb* -.-
Players in my map (survival map) have the possibility of making units to gather resources and repair buildings.
I'm adding a custom (triggering ability) that work as follow:
There's a chance that the unit becomes agressive and attack the player (changing ownership of the unit) but the problem is, I want the unit to come back to his ancient owner if its health drops bellow 20.
Here is what I have so far:
-
RageMode
-
Events
-
Time - Every 20.00 seconds of game time
-
-
Conditions
-
Actions
-
Set RageModeNumber = (Random integer number between 1 and 10)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
RageModeNumber Equal to 3
-
-
Then - Actions
-
Unit - Change ownership of (Random unit from TamedZombies[(Player number of (Random player from PlayingPlayers))]) to Player 12 (Brown) and Change color
-
-
Else - Actions
-
-
-
-
RageMode2
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
((Attacked unit) is alive) Equal to True
-
(Life of (Attacked unit)) Less than or equal to 20.00
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of (Attacked unit)) Equal to Repair Zombie
-
(Unit-type of (Attacked unit)) Equal to Tamed Zombie
-
-
-
-
Actions
-
Unit - Make (Attacked unit) Invulnerable
-
-
Thanks!
Edit: Wow... nevermind... I never saw the change to previous owner function... *feeling dumb* -.-