Don't get me wrong. The code works great, but the Invisibility lasts for a few seconds. Is there a way to make it last permanently and can only be turned off if the Hero's life is over 10%?
-
Get them
-
Events
- Unit - A unit Is attacked
-
Conditions
- ((Attacked unit) has buff Frost Armor (my version)) Equal to True
- (Percentage life of (Attacked unit)) Less than 10.00
- One_Time Equal to 0
-
Actions
- Hero - Create Invisibility and give it to (Attacked unit)
- Set One_Time = 0
- Set Attacked_Unit = (Attacked unit)
-
Events
-
Invisibility
-
Events
- Unit - A unit Is attacked
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Attacked unit) has an item of type Invisibility) Equal to True
- (Percentage life of (Attacked unit)) Less than 10.00
- One_Time Equal to 0
-
Then - Actions
- Hero - Order (Attacked unit) to use (Item carried by (Attacked unit) of type Invisibility)
- Wait 0.01 seconds
- Item - Remove (Item carried by (Attacked unit) of type Invisibility)
- Set One_Time = (One_Time + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
One Time Per Death
-
Events
- Unit - A unit Dies
-
Conditions
- (Unit-type of (Dying unit)) Equal to (Unit-type of (Attacked unit))
-
Actions
- Set One_Time = 0
-
Events