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

buff trigger

Status
Not open for further replies.
Level 4
Joined
Apr 9, 2008
Messages
73
i need a trigger thats says this:


events
-a unit get a buff

conditions
-buff is equal to (my buff)

actions
-...
-...
-...

but i cant find something like this
 
Level 7
Joined
Jun 16, 2008
Messages
327
Um...what actions did yo have in mind? A little more information would be helpful.
But, here's what you're looking for...so far.

There is no event that registers when a buff is activated. So, we use a periodic checker to see if the unit you want has the buff you want:

  • Buff Checker
  • Events
    • Time - Every 2.00 seconds of Game time
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (<YourUnit> <gen> has has buff <YourBuff) Equal to True
      • Then - Actions
        • -------- Put all your actions here --------
      • Else - Actions
You can find the "Unit - Unit has specific buff" in the Boolean comparison condition type.
I hope this helped you.
 
Level 4
Joined
Apr 9, 2008
Messages
73
unit have the buff for 10 sec. and the actions are:

first healing the unit ones then giving the unit an armor bonus for the 10 sec and then the unit should get 20 hp per sec

but when i use the trigger of elite slayer i have to choose a specific unit that is ckecked for the buff, but it should be for all units

Do NOT double-post. Use the Edit button.
~Posts Merged
 
Last edited by a moderator:
Level 7
Joined
Jun 16, 2008
Messages
327
THERE ARE TWO WAYS TO DO IT, THEN:

1. Then use a universal unit group in the place of the specific unit. Something like a custom variable named "AllUnits". You can create a unit group variable in the "Set Variable" action and use this action:

  • Actions
    • Unit Group - Add all units of (Units in (Playable map area)) to AllUnits
Or, if there are units that spawn during gameplay in your map, make an event like this:
  • Events
    • Unit - A unit enters (Playable map area)
  • Conditions
  • Actions
    • Unit Group - Add (Entering Unit) to AllUnits
The above trigger example will add any new or spawned units to the AllUnits unit group.

2. In the primary trigger, instead of using a unit group variable, use "All Units in (Playable map area)".

If you want a unit from a unit group for all unit, then the primary trigger changes a bit:
  • Buff Checker
    • Events
      • Time - Every 2.00 seconds of Game time
    • Conditions
    • Actions
      • -------- If you don't have an unit goup, use "All units in (Playable map area)" --------
      • Unit Group - Pick every unit in AllUnits and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff YourBuff) Equal to True
            • Then - Actions
              • -------- Put your actions here --------
            • Else - Actions
The above trigger can be used if you're using a UNIT GROUP VARIABLE.
If you're NOT using a unit group variable, do this trigger:

  • Buff Checker
    • Events
      • Time - Every 2.00 seconds of Game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff YourBuff) Equal to True
            • Then - Actions
              • -------- Put your actions here --------
            • Else - Actions
 
Level 4
Joined
Apr 9, 2008
Messages
73
oh now that trigger makes wc3 to collapse because i did

Time - Every 0.01 seconds of Game time
 
Status
Not open for further replies.
Top