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

[Spell] Armor increases with more Enemy Heroes nearby

Status
Not open for further replies.
Level 7
Joined
Sep 8, 2011
Messages
211
Hey guys, just wanted to ask why my trigger doesn't seem to be working. I;m not the best at triggering custom spells but from what I can see this trigger should be working. The spell does this :

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.

This ability has 4 levels, first level is + 0 armor, second level is + 2 armor and so on. The trigger for this is: (I will only show you the first few lines because its a long trigger.)

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units within 700.00 of (Position of Human_Samurai) matching ((((Triggering unit) is A Hero) Equal to True) and (((Triggering player) is an enemy of (Owner of Human_Samurai)) Equal to True)))) Equal to 0
Then - Actions
Unit - Set level of Defensive Stance for Human_Samurai to 1
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units within 700.00 of (Position of Human_Samurai) matching ((((Triggering unit) is A Hero) Equal to True) and (((Triggering player) is an enemy of (Owner of Human_Samurai)) Equal to True)))) Equal to 1
Then - Actions
Unit - Set level of Defensive Stance for Human_Samurai to 2
Else - Actions

Any ideas why this doesn't work? If you need more information I can provide that. Oh and the basic ability used is Devotion Aura.

Thanks :)
 
(Number of units in (Units within 700.00 of (Position of Human_Samurai) matching ((((Triggering unit) is A Hero) Equal to True) and (((Triggering player) is an enemy of (Owner of Human_Samurai)) Equal to True)))) Equal to 0
Triggering unit should be replaced with matching unit. Same for player, use owner of matching unit.

Also your way is really bad do it this way.

Code:
Set integer NUMBER = number of units bla bla bla bla
if NUMBER > 4 then
     set Ability Level to 4
else
     set Ability Level to NUMBER + 1
endif
 
Level 7
Joined
Sep 8, 2011
Messages
211
Ah this works perfectly! Thanks Kobas for the help!

Editing: Well it did work, now it isn't at all. I changed the code to suit what you suggested but it's still not working now :/.
This is the code for setting the variable for "Human_Samurai"

Human Samuria
Events
Unit - A unit enters (Playable map area)
Conditions
(Unit-type of (Matching unit)) Equal to Samurai
(Owner of (Matching unit)) Equal to Player 1 (Red)
Actions
Set Human_Samuria = (Matching unit)

But I doubt that is the issue.
 
Last edited:
Status
Not open for further replies.
Top