• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Units in a region getting healed when percentage-life = lower than 50%

Status
Not open for further replies.
Level 2
Joined
Feb 10, 2017
Messages
19
I'm trying to add a trigger to my custom map where units in a specific region or units that are in range of the healer get healed by the healer when their percentage life drops below 50%.
However it seems like i can't find the right triggers.

I was thinking about something like:

Event: Every 2 sec

Condition: Unit's life in region X/in range below 50%

Action: "healer" casts "healing spell" onto unit with health below 50% in region X/ in range

----

If there are more than 1 unit with 50% health i guess i'd have to say "cast healing spell onto random unit [...]"

i'm too much of a noob to know how to set this trigger up, i basically know what to do but i can't handle the details yet.

can you help me?
 
the overall idea is:
  • Get Healers Position/ is not needed if you use the rect version
  • Save possible targets in an unitgroup
  • Filter the unitgroup (%Life,dead,allied)
    • this is done either by using matching conditions in the group finding with matching unit
    • or by looping the group and use an if and remove units from the group with picked unit if the fail the conditions
  • Order your healing spell.
  • Some stuff
    • Set Loc = (Position of Healer)
    • Set Group = (Units within 800.00 of Loc)
    • Einheitengruppe - Pick every unit in Group and do (Actions)
      • Schleifen - Aktionen
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If -Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • ((Picked unit) is dead) Equal True
                • ((Picked unit) belongs to an enemy of (Owner of Healer)) Equal True
                • (Percentage life of (Picked unit)) Greater as 50.00
          • Then - Actions
            • Einheitengruppe - Remove (Picked unit) from Group
          • Else - Actions
  • Unit - Order Healer to Human Paladin - 'Holy Light' (Random unit from Group)
  • Custom script: call DestroyGroup(udg_Group)
  • Custom script: call RemoveLocation(udg_Loc)
Inside the triggers condition you should place nothing concerning the group (location based).
 
Last edited:
Status
Not open for further replies.
Top