• 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.

[General] Damage/Heal Triggers

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
Trigger #1
  • Self Damage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Unit = YourUnit
      • Unit - Cause Unit to damage Unit, dealing 10.00 damage of attack type Spells and damage type Normal
Trigger #2
  • Gain HP
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set Unit = (Triggering unit)
      • Unit - Set life of Unit to ((Life of Unit) + 250.00)
Trigger #3
  • Lumber Health
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Set Unit = YourUnit
      • Player - Set (Owner of Unit) Current lumber to (Integer((Life of Unit)))
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
1. Do you want a unit to be damaged by 10 each second for the whole game or when it is targeted by a spell?

2.
  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to [your ability]
    • Actions
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 250.00)
3.
  • Player - Set Player 1 (Red) Current lumber to (Integer((Life of (someUnit))))
EDIT: For point 1: use defskull's trigger if you want a unit to be damaged every second for the whole game.
You don't need to set a variable in each of these triggers if you use Triggering unit less than 3 times. Otherwise it is recommended to set a temporary variable for efficiency reasons.
 
Status
Not open for further replies.
Top