- Joined
- May 16, 2020
- Messages
- 660
Hi guys,
The following trigger is supposed to create X amount of illusions for every enemy hero on the map, move these illusions instantly to the enemy heroes and then force the illusions to attack the enemy heroes. The player should not be able to control these illusions or change who these illusions attack.
The spell functionally does what it's supposed to do, but the 3rd trigger with the 0.1 sec loop doesn't turn off when I want it to. I want to turn off the spell when "no more illusions with buff Haunt are found in Group Haunt_TempGroup" - but for some reason this doesn't work... I know this because the Footman 0172 who is supposed to die at this step doesn't die, nor do I receive a text "Haunt Loop OFF" that should come at this branch.
Does anyone know why?
Edit: If you find any leaks, please let me know.
***
The following trigger is supposed to create X amount of illusions for every enemy hero on the map, move these illusions instantly to the enemy heroes and then force the illusions to attack the enemy heroes. The player should not be able to control these illusions or change who these illusions attack.
The spell functionally does what it's supposed to do, but the 3rd trigger with the 0.1 sec loop doesn't turn off when I want it to. I want to turn off the spell when "no more illusions with buff Haunt are found in Group Haunt_TempGroup" - but for some reason this doesn't work... I know this because the Footman 0172 who is supposed to die at this step doesn't die, nor do I receive a text "Haunt Loop OFF" that should come at this branch.
Does anyone know why?
Edit: If you find any leaks, please let me know.
***
-
Haunt
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Haunt
-
-
Actions
-
Set VariableSet Haunt_Caster_Position = (Position of (Triggering unit))
-
Set VariableSet Haunt_Counter = 0
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering player).) Equal to True))) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is alive) Equal to True
-
-
Then - Actions
-
Set VariableSet Haunt_Counter = (Haunt_Counter + 1)
-
Set VariableSet Haunt_Enemy_Hero[Haunt_Counter] = (Picked unit)
-
-
Else - Actions
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Haunt_Counter Not equal to 0
-
-
Then - Actions
-
Set VariableSet Haunt_Caster = (Triggering unit)
-
Unit - Create 1 Dummy for (Triggering player) at Haunt_Caster_Position facing Default building facing degrees
-
Unit - Add Haunt Illusion to (Last created unit)
-
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
-
Unit - Set level of Haunt Illusion for (Last created unit) to (Level of (Ability being cast) for (Triggering unit))
-
For each (Integer A) from 1 to Haunt_Counter, do (Actions)
-
Loop - Actions
-
Custom script: call IssueTargetOrderById(bj_lastCreatedUnit, 852274, udg_Haunt_Caster)
-
-
-
Trigger - Turn on Haunt Loop Copy 2 <gen>
-
Game - Display to (All players) the text: Haunt Loop ON
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_Haunt_Caster_Position)
-
-
-
Haunt Illusion
-
Events
-
Unit - A unit Spawns a summoned unit
-
-
Conditions
-
((Summoned unit) has buff Haunt ) Equal to True
-
-
Actions
-
Custom script: set udg_Haunt_Counter2 = bj_forLoopAIndex
-
Unit - Set (Summoned unit) movement speed to 400.00
-
Unit - Turn collision for (Summoned unit) Off.
-
Unit - Move (Summoned unit) instantly to ((Position of Haunt_Enemy_Hero[Haunt_Counter2]) offset by 100.00 towards (Random angle) degrees.)
-
Unit - Order (Summoned unit) to Attack Haunt_Enemy_Hero[Haunt_Counter2]
-
Set VariableSet Haunt_Unit[Haunt_Counter2] = (Summoned unit)
-
-
-
Haunt Loop Copy 2
-
Events
-
Time - Every 0.10 seconds of game time
-
-
Conditions
-
Actions
-
Set VariableSet Haunt_TempGroup = (Units in (Playable map area) matching (((Matching unit) has buff Haunt ) Equal to True))
-
Unit Group - Pick every unit in Haunt_TempGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Haunt_TempGroup is empty) Equal to True
-
-
Then - Actions
-
Game - Display to (All players) the text: Haunt Loop OFF
-
Unit - Kill Footman 0172 <gen>
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
Unit - Kill Nature's Prophet 0039 <gen>
-
For each (Integer A) from 1 to Haunt_Counter2, do (Actions)
-
Loop - Actions
-
Unit - Order Haunt_Unit[(Integer A)] to Attack Haunt_Enemy_Hero[(Integer A)]
-
-
-
-
-
-
-
Unit Group - Remove all units from Haunt_TempGroup.
-
-