Hello everyone,
I have this problem i made this abillity which detects all enemy units with less than 30% health around unit and gives vision of those enemy units to player but i have a problem when i use:
EDIT: found solution with faerie fire if anyone is intrested heres code
Find the Pray - dummy abillity does nothing just tooltip.
Spell Book Find - disabled spellbook contains "Find the Pray (Movement bonus)".
Find the Pray (Movement bonus) - endurance aura just with movement speed bonus (5 levels (1 level does nothing, 2-5 level gives movement speed).
Detect Invisible(Find the Pray) - faerie fire.
Find the Pray (target) - farie fire buff.
EDIT 2: one question does this leaks?
I have this problem i made this abillity which detects all enemy units with less than 30% health around unit and gives vision of those enemy units to player but i have a problem when i use:
- Unit - Grant shared vision of (enemy unit) to (Owner of Unit)
EDIT: found solution with faerie fire if anyone is intrested heres code
Find the Pray - dummy abillity does nothing just tooltip.
Spell Book Find - disabled spellbook contains "Find the Pray (Movement bonus)".
Find the Pray (Movement bonus) - endurance aura just with movement speed bonus (5 levels (1 level does nothing, 2-5 level gives movement speed).
Detect Invisible(Find the Pray) - faerie fire.
Find the Pray (target) - farie fire buff.
-
Find the Pray Learn
-
Events
- Unit - A unit Learns a skill
-
Conditions
- (Learned Hero Skill) Equal to Find the Pray
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of Find the Pray for (Learning Hero)) Equal to 1
-
Then - Actions
- Unit - Add Spell Book Find the Pray to (Learning Hero)
- Unit - Set level of Find the Pray (Movement bonus) for (Learning Hero) to 5
- Set FindThePrayUnitGroup[2] = (Units of type Peasant)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
Find the Pray
-
Events
- Time - Every 0.50 seconds of game time
- Conditions
-
Actions
- Set FindThePrayUnitGroup[0] = (Units in (Entire map) matching ((Level of Find the Pray for (Matching unit)) Greater than 0))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in FindThePrayUnitGroup[0]) Not equal to 0
-
Then - Actions
-
Unit Group - Pick every unit in FindThePrayUnitGroup[0] and do (Actions)
-
Loop - Actions
- Set FindThePrayUnit = (Picked unit)
- Set FindThePrayPoint[0] = (Position of (Picked unit))
- Set FindThePrayUnitGroup[1] = (Units in (Entire map) matching ((((((Matching unit) is A Hero) Equal to True) and ((Percentage life of (Matching unit)) Less than or equal to 30.00)) and (((Region centered at FindThePrayPoint[0] with size (6000.00, 6000.00)) contains (Matching unit)) Equal
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in FindThePrayUnitGroup[1]) Not equal to 0
-
Then - Actions
-
Unit Group - Pick every unit in FindThePrayUnitGroup[1] and do (Actions)
-
Loop - Actions
- Unit - Grant shared vision of (Picked unit) to (Owner of FindThePrayUnit)
- Unit Group - Add (Picked unit) to FindThePrayUnitGroup[2]
- Set FindThePrayUnitGroup[3] = (Units of type Footman)
-
For each (Integer A) from 1 to (Number of units in FindThePrayUnitGroup[1]), do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (FindThePrayVictim[(Integer A)] is in FindThePrayUnitGroup[3]) Equal to False
-
Then - Actions
- Set FindThePrayVictim[(Integer A)] = (Random unit from FindThePrayUnitGroup[1])
- Unit Group - Add FindThePrayVictim[(Integer A)] to FindThePrayUnitGroup[3]
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to (Number of units in FindThePrayUnitGroup[1]), do (Actions)
-
Loop - Actions
- Set Point[1] = (Center of (Entire map))
- Unit - Create 1 Dummy for (Owner of FindThePrayUnit) at Point[1] facing Default building facing degrees
- Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
- Custom script: call RemoveLocation(udg_Point[1])
- Unit - Add Detect Invisible(Find the Pray) to (Last created unit)
- Unit - Order (Last created unit) to Night Elf Druid Of The Talon - Faerie Fire (Picked unit)
-
Loop - Actions
- Custom script: call DestroyGroup(udg_FindThePrayUnitGroup[3])
-
Loop - Actions
- Unit - Set level of Find the Pray (Movement bonus) for FindThePrayUnit to ((Level of Find the Pray for FindThePrayUnit) + 1)
-
Unit Group - Pick every unit in FindThePrayUnitGroup[1] and do (Actions)
-
Else - Actions
- Unit - Set level of Find the Pray (Movement bonus) for FindThePrayUnit to 1
-
If - Conditions
-
Unit Group - Pick every unit in FindThePrayUnitGroup[2] and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked unit) is in FindThePrayUnitGroup[1]) Equal to False
-
Then - Actions
- Unit Group - Remove (Picked unit) from FindThePrayUnitGroup[2]
- Unit - Remove Find the Pray (target) buff from (Picked unit)
- Unit - Deny shared vision of (Picked unit) to (Owner of FindThePrayUnit)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call DestroyGroup(udg_FindThePrayUnitGroup[1])
- Custom script: call RemoveLocation(udg_FindThePrayPoint[0])
-
Loop - Actions
-
Unit Group - Pick every unit in FindThePrayUnitGroup[0] and do (Actions)
- Else - Actions
-
If - Conditions
- Custom script: call DestroyGroup(udg_FindThePrayUnitGroup[0])
-
Events
- Set FindThePrayUnitGroup[0] = (Units in (Entire map) matching ((Level of Find the Pray for (Matching unit)) Greater than 0))
Last edited: