- Joined
- May 16, 2020
- Messages
- 660
Hi guys,
I'm building an aura which reduces the magic resitance of nearby enemies.
The trigger below works for two Heroes who are affecting different units. However, as soon as both Heroes affect the same unit, or a Hero dies while affecting enemies, it bugs:
***
I'm building an aura which reduces the magic resitance of nearby enemies.
The trigger below works for two Heroes who are affecting different units. However, as soon as both Heroes affect the same unit, or a Hero dies while affecting enemies, it bugs:
- If Hero_1 affects unit X and I bring Hero_2 into range of unit X, the spell works. However, if move one of the Heros away from unit X, unit X loses the debuff, even though the other Hero is still nearby.
- If a Hero dies while affecting units, the special effect stays forever. I can only fix it by brining the other Hero nearby affected units and moving him out of range again.
***
-
Searing Elements
-
Events
-
Unit - A unit Learns a skill
-
-
Conditions
-
(Learned Hero Skill) Equal to Searing Elements
-
(Learned skill level) Equal to 1
-
-
Actions
-
Unit Group - Add (Triggering unit) to SearingElements_GroupHero
-
Set VariableSet SearingElements_CV = (Custom value of (Triggering unit))
-
Custom script: set udg_SearingElements_GroupInside[udg_SearingElements_CV] = CreateGroup()
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Searing Elements Loop <gen> is on) Equal to False
-
-
Then - Actions
-
Trigger - Turn on Searing Elements Loop <gen>
-
-
Else - Actions
-
-
-
-
Searing Elements Loop
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in SearingElements_GroupHero and do (Actions)
-
Loop - Actions
-
Set VariableSet SearingElements_Caster = (Picked unit)
-
Set VariableSet SearingElements_CV = (Custom value of SearingElements_Caster)
-
Set VariableSet SearingElements_Point[1] = (Position of SearingElements_Caster)
-
-------- ADD UNITS --------
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 650.00 of SearingElements_Point[1].) and do (Actions)
-
Loop - Actions
-
Set VariableSet SearingElements_TempUnit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(SearingElements_Caster is alive) Equal to False
-
(SearingElements_TempUnit is alive) Equal to True
-
(SearingElements_TempUnit is A structure) Equal to False
-
(SearingElements_TempUnit is Magic Immune) Equal to False
-
(SearingElements_TempUnit belongs to an enemy of (Owner of SearingElements_Caster).) Equal to True
-
(SearingElements_TempUnit is in SearingElements_GroupInside[SearingElements_CV].) Equal to False
-
-
Then - Actions
-
Unit Group - Add SearingElements_TempUnit to SearingElements_GroupInside[SearingElements_CV]
-
Unit - Add Searing Elements (Magic Reduction) to SearingElements_TempUnit
-
Ability - Set Ability: (Unit: SearingElements_TempUnit's Ability with Ability Code: Searing Elements (Magic Reduction))'s Real Level Field: Damage Reduction ('isr2') of Level: 0 to (-0.05 + (-0.05 x (Real((Level of Searing Elements for SearingElements_Caster)))))
-
Unit - Add Searing Elements (Aura) to SearingElements_TempUnit
-
-
Else - Actions
-
-
-
-
-------- REMOVE UNITS --------
-
Unit Group - Pick every unit in SearingElements_GroupInside[SearingElements_CV] and do (Actions)
-
Loop - Actions
-
Set VariableSet SearingElements_TempUnit = (Picked unit)
-
Set VariableSet SearingElements_Point[2] = (Position of SearingElements_TempUnit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(SearingElements_Caster is alive) Equal to False
-
(SearingElements_TempUnit is alive) Equal to False
-
(Distance between SearingElements_Point[1] and SearingElements_Point[2]) Greater than 650.00
-
-
-
-
Then - Actions
-
Unit Group - Remove SearingElements_TempUnit from SearingElements_GroupInside[SearingElements_CV].
-
Unit - Remove Searing Elements (Magic Reduction) from SearingElements_TempUnit
-
Unit - Remove Searing Elements (Aura) from SearingElements_TempUnit
-
Unit - Remove Searing Elements (Enemy) buff from SearingElements_TempUnit
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_SearingElements_Point[2])
-
-
-
Custom script: call RemoveLocation(udg_SearingElements_Point[1])
-
-
-
-