- Joined
- Dec 19, 2012
- Messages
- 5
Hey Hive, I have a problem with figuring a trigger out.
The thing is, I want it so the units doesn't just flee when they see they have less % hp then the other unit. I want it to be a % difference.
Like; "percentage life of attacked unit is 15% greater than percentage of attacking unit". But I can't figure it out. Ty for help.
Here's what the trigger looks like:
Flee
Events
Unit - A unit Is attacked
Conditions
((Attacked unit) is A Hero) Equal to True
((Attacking unit) is A Hero) Equal to True
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Percentage life of (Attacked unit)) Greater than (Percentage life of (Attacking unit))
Then - Actions
Unit - Order (Attacked unit) to Attack (Attacking unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Attacking unit)) Equal to Player 1 (Red)
Then - Actions
Unit - Order (Attacking unit) to Move To (Position of Town Hall 0004 <gen>)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Attacking unit)) Equal to Player 2 (Blue)
Then - Actions
Unit - Order (Attacking unit) to Move To (Position of Town Hall 0001 <gen>)
Else - Actions
Do nothing
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Percentage life of (Attacking unit)) Greater than (Percentage life of (Attacked unit))
Then - Actions
Unit - Order (Attacking unit) to Attack (Attacked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Attacking unit)) Equal to Player 2 (Blue)
Then - Actions
Unit - Order (Attacked unit) to Move To (Position of Town Hall 0004 <gen>)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Attacking unit)) Equal to Player 1 (Red)
Then - Actions
Unit - Order (Attacked unit) to Move To (Position of Town Hall 0001 <gen>)
Else - Actions
Do nothing
Else - Actions
Do nothing
The thing is, I want it so the units doesn't just flee when they see they have less % hp then the other unit. I want it to be a % difference.
Like; "percentage life of attacked unit is 15% greater than percentage of attacking unit". But I can't figure it out. Ty for help.
Here's what the trigger looks like:
Flee
Events
Unit - A unit Is attacked
Conditions
((Attacked unit) is A Hero) Equal to True
((Attacking unit) is A Hero) Equal to True
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Percentage life of (Attacked unit)) Greater than (Percentage life of (Attacking unit))
Then - Actions
Unit - Order (Attacked unit) to Attack (Attacking unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Attacking unit)) Equal to Player 1 (Red)
Then - Actions
Unit - Order (Attacking unit) to Move To (Position of Town Hall 0004 <gen>)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Attacking unit)) Equal to Player 2 (Blue)
Then - Actions
Unit - Order (Attacking unit) to Move To (Position of Town Hall 0001 <gen>)
Else - Actions
Do nothing
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Percentage life of (Attacking unit)) Greater than (Percentage life of (Attacked unit))
Then - Actions
Unit - Order (Attacking unit) to Attack (Attacked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Attacking unit)) Equal to Player 2 (Blue)
Then - Actions
Unit - Order (Attacked unit) to Move To (Position of Town Hall 0004 <gen>)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Attacking unit)) Equal to Player 1 (Red)
Then - Actions
Unit - Order (Attacked unit) to Move To (Position of Town Hall 0001 <gen>)
Else - Actions
Do nothing
Else - Actions
Do nothing