• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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?
 
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