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

Can you add damage in Triggers?

Status
Not open for further replies.
Level 2
Joined
May 16, 2013
Messages
27
I want to make a trigger wherein if a units mana is at 100, he gains 25 damage. I made a base trigger, but I don't know where or if I can add a damage bonus. Please guide me, heroes.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Yeah Gorrila is right on.
You need to make the Item Damage Bonus, its a custom item ability in the object editor.
Here's an example trigger of what I think you're looking for.
  • Extra Dmg from Mana
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Mana of (Picked unit)) Greater than or equal to 100.00
            • Then - Actions
              • Unit - Add Item Damage Bonus +25 to (Picked unit)
            • Else - Actions
              • Unit - Remove Item Damage Bonus +25 from (Picked unit)
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: set udg_TempGroup = null
Hope this helps!
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
  • Untitled Trigger 001
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (Triggering unit)) Less than or equal to >>>Write here 50% mana of unit<<<
        • Then - Actions
          • Unit - Add Item Damage Bonus (+25) to (Triggering unit)
        • Else - Actions

and to turn off effect once again

  • Untitled Trigger 001
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (Triggering unit)) Greater than or equal to >>>Write here 50% mana of unit<<<
        • Then - Actions
          • Unit - Remove Item Damage Bonus (+25) from (Triggering Unit)
        • Else - Actions
Or another option is put in the Else the Remove trigger because it shows that the Condition is not met like this.

  • Untitled Trigger 001
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (Triggering unit)) Greater than or equal to >>>Write here 50% mana of Unit<<<
        • Then - Actions
          • Unit - Add Item Damage Bonus (+25) to (Triggering unit)
        • Else - Actions
          • Unit - Remove ITem Damage Bonus (+25) to (Triggering Unit)
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
No no no.

  • Stuff
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mana of (Attacking unit)) Greater than or equal to (>=) 100.00
        • Then - Actions
          • Unit - Add Item Damage Bonus (+25) to (Attacking unit)
        • Else - Actions
          • Unit - Remove Item Damage Bonus (+25) from (Attacking unit)
Using loops in this case is unnecessary, since the "Unit - A unit Is attacked" is triggered before damage is done, so in this case you just add the ability(you can't doubleadd it anyway). If mana is under 100 you remove it(can't doubleremove either).

It's the most basic trigger I've made in months.
 
Status
Not open for further replies.
Top