[Trigger Help] Deal damage to units owned by player, when entering rect

krog99

New Member
Reaction score
2
The title says it all. I am trying to make a trigger dealing damage to units owned by player 11 and 12, if they are entering the rect.

The damage should be 5% of the units total life, each second. Until they leave the rect again.

I've tried a few things. But i can't make it work. In my head the solution is to create a trigger with a unit group-variable adding all units in the rect to this group. And then another trigger to deal the damage each second. But as i said. I can't make it work.

Can any of you guys help me out please?
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Trigger:
  • Damage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempRect = Hurt Me <gen>
      • Set TempGroup = (Units in TempRect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
              • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
        • Then - Actions
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Life of (Picked unit)) x 0.05) damage of attack type Spells and damage type Normal
        • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: call RemoveRect(udg_TempRect)

Im sure this leaks.
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Yes
Trigger:
  • Custom script: call DestroyGroup(udg_TempGroup)
Removes the group which it creates.
Trigger:
  • Custom script: call RemoveRect(udg_TempRect)
Removes the Region.

Check i just updated it, i forgot to set TempRect.

Trigger:
  • Set TempRect = **Your Region** <gen>
 
General chit-chat
Help Users

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top