"Camouflaged units are temporarily revealed when an enemy unit is within a certain range of the camouflaged unit."
Basically, I am currently testing an ability which grants invisibility to a unit for 12 seconds. When the casting unit (CU) casts Ambush, CU is granted a buff for 12 seconds. While CU has this buff, he is given invisibility (the buff and the invisibility are two separate things in this case). If CU attacks or casts a spell, the Ambush buff is lost and CU is no longer able to go invisible. If an enemy unit is within 300 range of CU, CU loses the ability to go invisible, but the Ambush buff is not removed. This means that when the enemy unit is no long within 300 range of CU, CU gains the ability to turn invisible again.
Edit: Issue I have currently is if I have two units who have cast this ability, only the second unit has the Permanent Invisibility ability added and removed (depending on whether there is an enemy unit nearby).
Basically, I am currently testing an ability which grants invisibility to a unit for 12 seconds. When the casting unit (CU) casts Ambush, CU is granted a buff for 12 seconds. While CU has this buff, he is given invisibility (the buff and the invisibility are two separate things in this case). If CU attacks or casts a spell, the Ambush buff is lost and CU is no longer able to go invisible. If an enemy unit is within 300 range of CU, CU loses the ability to go invisible, but the Ambush buff is not removed. This means that when the enemy unit is no long within 300 range of CU, CU gains the ability to turn invisible again.
-
AmbushCast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Ambush (Assassin)
-
-
Actions
-
-------- Store casting unit in Hashtable --------
-
Hashtable - Save Handle Of(Triggering unit) as (Key A_UnitCaster.) of (Key A_Handle.) in A_HastTable.
-
-------- Add invisibility to casting unit --------
-
Unit - Add Permanent Invisibility to (Triggering unit)
-
Trigger - Turn on AmbushDurationEnd <gen>
-
-
-
AmbushDurationEnd
-
Events
-
Time - Every 0.10 seconds of game time
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Load (Key A_UnitCaster.) of (Key A_Handle.) in A_HastTable.) has buff Berserk) Equal to False
-
-
Then - Actions
-
Unit - Remove Permanent Invisibility from (Load (Key A_UnitCaster.) of (Key A_Handle.) in A_HastTable.)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in (Units within 300.00 of (Position of (Load (Key A_UnitCaster.) of (Key A_Handle.) in A_HastTable.)) matching (((Matching unit) belongs to an enemy of (Owner of (Load (Key A_UnitCaster.) of (Key A_Handle.) in A_HastTable.)).) Equal to True) Greater than or equal to 1
-
-
Then - Actions
-
Unit - Remove Permanent Invisibility from (Load (Key A_UnitCaster.) of (Key A_Handle.) in A_HastTable.)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in (Units within 300.00 of (Position of (Load (Key A_UnitCaster.) of (Key A_Handle.) in A_HastTable.)) matching (((Matching unit) belongs to an enemy of (Owner of (Load (Key A_UnitCaster.) of (Key A_Handle.) in A_HastTable.)).) Equal to True) Less than 1
-
(Level of Permanent Invisibility for (Load (Key A_UnitCaster.) of (Key A_Handle.) in A_HastTable.)) Not equal to 1
-
-
Then - Actions
-
Unit - Add Permanent Invisibility to (Load (Key A_UnitCaster.) of (Key A_Handle.) in A_HastTable.)
-
-
Else - Actions
-
-
-
-
-
-
-
Edit: Issue I have currently is if I have two units who have cast this ability, only the second unit has the Permanent Invisibility ability added and removed (depending on whether there is an enemy unit nearby).
Last edited: