PDA

View Full Version : [Trigger] Armor increases with more Enemy Heroes nearby


Jackhamme
08-04-2012, 06:58 AM
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?

WaterKnight
08-04-2012, 08:06 AM
There is no Matching unit in A unit enters region, it is not even an event response. You want to have Triggering unit or Entering unit, as you have already used in the actions.

In Human enemy check, when picking units, do not use Matching player but Owner of Matching Unit.

Jackhamme
08-04-2012, 08:22 AM
Oh such a simple mistake I didn't even notice!

Thank you so much WaterKnight! It was rather annoying trying to make it work.