• 🏆 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!

Need help creating trigger that damages units per second when they are in region

Status
Not open for further replies.
Level 14
Joined
Mar 27, 2008
Messages
1,003
Well basically on my map I have a lava section. I have four regions covering the whole lava area (so it's all covered) and I need a trigger that makes it so if a unit walks into any of these regions, he suffers 1 hit point of damage per second. (Units only have 50 HP on my map with no regen)
Can anyone help?
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
trig 1

event
. unit enters region ( ur region)
conditions
. unit is ground
actions
. add unit to group lavaReg
. if lavaBoolean == false
. then
. set lavaBoolean = true
. turn on trig 3
. else

trig 2

event
. unit leaves region ( ur region)
conditions
. unit is in group lavaG
actions
. remove unit from group lavaReg

trig 3
event
. every one second
conditions
. lavaBoolean = true
actions
. pick every unit in group lavaReg
. and damage unit for set damage
. if unit group is empty
. then
. set lavaBoolean = false
. turn off ( this trigger)
. else
 
Level 14
Joined
Mar 27, 2008
Messages
1,003
trig 1

event
unit enters region ( ur region)
conditions
unit is ground
actions
add unit to group lavaReg

trig 2

event
unit leaves region ( ur region)
conditions
unit is in group lavaG
actions
remove unit from group lavaReg

trig 3
event
every one second
conditions
actions
pick every unit in group lavaReg
and damage unit for set damage

+ Rep, thanks a ton! It works perfect!
Hey send me a visitor message mate I gotta talk to you about something.
 
Status
Not open for further replies.
Top