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

[Trigger] Armor increases with more Enemy Heroes nearby

Status
Not open for further replies.
Level 7
Joined
Sep 8, 2011
Messages
211
Hey guys, I have created a new champion for my DotA style map but his passive ability doesn't work. I'll copy the tool tip for it.

Defensive Stance: Nikoro turns to a more defensive stance the more enemy heroes are around him. If there is 1 enemy hero near Nikoro, his armor will increase by 2. If there are 2 enemy heroes near Nikoro his armor will increase by 3. If there is 3 or more enemy heroes around Nikoro, his armor will increase by 4.5.

Oh and if there is 0 enemy heroes near him it doesn't get an armor increase. The way the work is this. The ability its self has 4 levels, and level 1 its no armor increase and at level 2 its 2 armor etc etc. What I tried to do was make a trigger that when a nearby enemy unit comes within a certain range it changes the level of the ability. Here are the triggers:

  • Human enemy check
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Set integer_NUMBER = (Number of units in (Units within 700.00 of (Position of Human_Samuria) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching player) is an enemy of (Owner of Human_Samuria)) Equal to True))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • integer_NUMBER Equal to 0
        • Then - Actions
          • Unit - Set level of Defensive Stance for Human_Samuria to 1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • integer_NUMBER Equal to 1
            • Then - Actions
              • Unit - Set level of Defensive Stance for Human_Samuria to 2
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • integer_NUMBER Equal to 2
                • Then - Actions
                  • Unit - Set level of Defensive Stance for Human_Samuria to 3
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • integer_NUMBER Greater than or equal to 3
                    • Then - Actions
                      • Unit - Set level of Defensive Stance for Human_Samuria to 4
                    • Else - Actions


And here is where the Human_Samurai variable comes from.

  • Human Samurai
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Matching unit)) Equal to Samurai
      • Or - Any (Conditions) are true
        • Conditions
          • (Owner of (Matching unit)) Equal to Player 1 (Red)
          • (Owner of (Matching unit)) Equal to Player 2 (Blue)
          • (Owner of (Matching unit)) Equal to Player 3 (Teal)
    • Actions
      • Set Human_Samuria = (Triggering unit)


I have no idea why it isn't working, can someone please help me out?
 
Status
Not open for further replies.
Top