Hello,
I would like to have all healing spells e.g Holy Light, Rejuvenation, Healing Wave, etc to have target priority in the unit group iteration.
It would be best if we could have the targering prio:
1) First priority is to target melee (frontline) units. /// if no melee units are present then switch to prio 2
2) Target the most "wounded" unit on your team.
?(3) Maybe target self if the caster is "in combat", taking damage from an enemy or taken X amount of damage in Y time. This could be the second highest priority if it's not too hard to produce.
So the first prio would be to target a melee unit with least life remaining. Currently im just using a get random unit from unit group with life less than unit max hp. And to the reason I would like to have this is that my current project will be mostly played front-to-back style with some small nuances. The player units are given to an ai player and all units will cast their spells when they have reached their maxium mana.
I had some attempts on this, but unfortunately it was a failure. Below is the normal trigger that just finds one target randomly without any priority.
I would like to have all healing spells e.g Holy Light, Rejuvenation, Healing Wave, etc to have target priority in the unit group iteration.
It would be best if we could have the targering prio:
1) First priority is to target melee (frontline) units. /// if no melee units are present then switch to prio 2
2) Target the most "wounded" unit on your team.
?(3) Maybe target self if the caster is "in combat", taking damage from an enemy or taken X amount of damage in Y time. This could be the second highest priority if it's not too hard to produce.
So the first prio would be to target a melee unit with least life remaining. Currently im just using a get random unit from unit group with life less than unit max hp. And to the reason I would like to have this is that my current project will be mostly played front-to-back style with some small nuances. The player units are given to an ai player and all units will cast their spells when they have reached their maxium mana.
I had some attempts on this, but unfortunately it was a failure. Below is the normal trigger that just finds one target randomly without any priority.
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit-type of DamageEventSource) Equal to Priest
-
-
Then - Actions
-
Set VariableSet PriestHealerPoint = (Position of DamageEventSource)
-
Set VariableSet PriestHealGroup = (Units within 900.00 of PriestHealerPoint.)
-
Unit Group - Pick every unit in PriestHealGroup 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
-
((Picked unit) belongs to an ally of (Owner of DamageEventSource).) Equal to True
-
((Picked unit) is A structure) Equal to False
-
((Picked unit) is Mechanical) Equal to False
-
(Life of (Picked unit)) Less than (Max life of (Picked unit))
-
-
Then - Actions
-
-------- Filter Only --------
-
-
Else - Actions
-
Unit Group - Remove (Picked unit) from PriestHealGroup.
-
-
-
-
-
Unit Group - Pick every unit in (Random 1 units from PriestHealGroup) and do (Actions)
-
Loop - Actions
-
Set VariableSet PriestHealTarget = (Picked unit)
-
Unit - Order DamageEventSource to Human Paladin - Holy Light PriestHealTarget
-
-
-
Custom script: call DestroyGroup(udg_PriestHealGroup)
-
Custom script: call RemoveLocation(udg_PriestHealerPoint)
-
-
Else - Actions
-