Hello,
I've been trying to get this spell working but the problem is that it does only trigger once completly (few low-hp units get healed), and I passed a long time trying to find out what's the problem but can't find it...
Basicly this spell takes the weakest allied units near the guy with the buff and heal them. Here's my code.
Big thx to whoever help me. Red.
I've been trying to get this spell working but the problem is that it does only trigger once completly (few low-hp units get healed), and I passed a long time trying to find out what's the problem but can't find it...
Basicly this spell takes the weakest allied units near the guy with the buff and heal them. Here's my code.
Trigger:
- Soothing Auragroupevar
- Events
- Time - Every 4.00 seconds of game time
- Conditions
- Actions
- Player Group - Pick every player in (All players) and do (Actions)
- Loop - Actions
- Set Temp_Group_Soother = (Units owned by (Picked player) matching (((Matching unit) has buff Soothing Aura ) Equal to True))
- Unit Group - Pick every unit in Temp_Group_Soother and do (Actions)
- Loop - Actions
- Set Temp_Spell_Level = (Level of Soothing Aura for (Picked unit))
- Set Temp_Point = (Position of (Picked unit))
- Set Temp_Group = (Units within 500.00 of Temp_Point matching ((((Owner of (Matching unit)) is an ally of (Picked player)) Equal to True) and (((Matching unit) is A structure) Equal to False)))
- Custom script: call RemoveLocation(udg_Temp_Point)
- Unit Group - Remove (Picked unit) from Temp_Group
- For each (Integer A) from 1 to (Temp_Spell_Level + 2), do (Actions)
- Loop - Actions
- Set Temp_Real = 100.00
- Unit Group - Pick every unit in Temp_Group and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Percentage life of (Picked unit)) Less than Temp_Real
- Then - Actions
- Set Temp_Real = (Percentage life of (Picked unit))
- Set Temp_Unit_LowestHP = (Picked unit)
- Else - Actions
- Do nothing
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Unit Group - Remove Temp_Unit_LowestHP from Temp_Group
- Unit Group - Add Temp_Unit_LowestHP to Temp_Group_ToHeal
- Loop - Actions
- Custom script: call DestroyGroup(udg_Temp_Group)
- Unit Group - Pick every unit in Temp_Group_ToHeal and do (Actions)
- Loop - Actions
- Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) + ((Real(Temp_Spell_Level)) + 2.00))%
- Set Temp_Point = (Position of (Picked unit))
- Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Human\Heal\HealTarget.mdl
- Wait for (Last played sound) to be 0.00 seconds from finished playing
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation(udg_Temp_Point)
- Loop - Actions
- Custom script: call DestroyGroup(udg_Temp_Group_ToHeal)
- Loop - Actions
- Custom script: call DestroyGroup(udg_Temp_Group_Soother)
- Loop - Actions
- Player Group - Pick every player in (All players) and do (Actions)
- Events
Big thx to whoever help me. Red.