The map is a single player RPG where you control only one unit of your party at a time (Player 1). The other two party members are controlled by a computer (Player 2) and follow the controlled member around.
I'll include all of the triggers I have for the system, but to test the problem I created a hero owned by computer player 3 whom I have no triggers for, did nothing but ordered him to attack a golem surrounded by murlocs, and he still ignored the golem and went straight for the closest murloc. When I changed the owner of that hero to human player 1, the hero attacked only the golem with no problems. This leads me to believe that the problem is with the default computer AI, though I'm still relatively new the triggering, so I could be entirely wrong.
Here are the involved triggers:
-
Initialization
-
Events
-
Time - Elapsed game time is 0.01 seconds
-
Conditions
-
Actions
-
Unit - Create 1 Arthas (wielding Frostmourne) for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
-
Set ControlledUnit = (Last created unit)
-
Set HeroAngle = (Facing of ControlledUnit)
-
Unit - Create 1 Muradin Bronzebeard for Player 1 (Red) at ((Position of ControlledUnit) offset by 200.00 towards (HeroAngle + 140) degrees) facing Default building facing degrees
-
Set PartyMember[0] = (Last created unit)
-
Unit Group - Add (PartyMember[0]) to ComputerUnits
-
Unit - Change ownership of PartyMember[0] to Player 2 (Blue) and Retain color
-
Unit - Create 1 Jaina for Player 1 (Red) at ((Position of ControlledUnit) offset by 200.00 towards (HeroAngle - 140) degrees) facing Default building facing degrees
-
Set PartyMember[1] = (Last created unit)
-
Unit Group - Add (PartyMember[1]) to ComputerUnits
-
Unit - Change ownership of PartyMember[0] to Player 2 (Blue) and Retain color
The trigger has more actions, but none are relevant to the Assault ability.
-
Assault On
-
Events
-
Unit - A unit Begins casting an ability
-
Conditions
-
(Ability being cast) equal to Assault
-
Actions
-
Set AssaultTarget = (Target unit of ability being cast)
-
Unit - Order (Casting unit) to Stop
-
Set Assaulting = True
-
Trigger - Turn on Assault Off <gen>
-
Unit Group - Pick every unit in ComputerUnits and do (Actions)
-
Loop - Actions
-
Unit - Order (Picked Unit) to Attack AssaultTarget
When Assault begins casting, the target is set but the caster stops before the spell is fully cast to prevent mob aggro. The two computer units owned by Player 2 are ordered to Attack the target.
-
Assault Off (Initially Off)
-
Events
-
Conditions
-
(Dying unit) Equal to AssaultTarget
-
Actions
-
Set Assaulting = False
-
Trigger - Turn on Combat Check <gen>
-
Trigger - Turn off (This trigger)
When AssaultTarget dies, the computer controlled units will go back to their default behavior.
-
Combat Check
-
Events
-
Time - Every 0.50 seconds of game time
-
Conditions
-
Actions
-
Set CombatEnemies = Units within 500.00 of (Position of ControlledUnit) matching (((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True) and (((Matching unit) is alive) Equal to True)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Assaulting Equal to False
-
(CombatEnemies is empty) Equal to True
-
Then - Actions
-
Else - Actions
Checks whether there are any enemies close to Player 1 and whether the Assault ability has been used. If so, it prevents the following trigger:
-
Movement P0
-
Events
-
Time - Every 0.50 seconds of game time
-
Conditions
-
(Owner of ControlledUnit) Equal to Player 1 (Red)
-
InCombat Equal to False
-
Actions
-
Unit - Order PartyMember[0] to Attack-Move To ((Position of ControlledUnit) offset by 200.00 towards (HeroAngle + 140 degrees)
-
Unit - Order PartyMember[1] to Attack-Move To ((Position of ControlledUnit) offset by 200.00 towards (HeroAngle - 140 degrees)
If InCombat is set to False, the computer units will continuously Attack-Move into a triangle formation behind the controlled hero. HeroAngle is set in a separate trigger that, along with other angle and camera related actions, sets HeroAngle to Player 1's hero's facing angle every 0.01 second.
The only one I can see that could even remotely affect the Assault ability other than the default computer AI is Movement P0's Attack-Move Actions, but those should be disabled until AssaultTarget is killed and it should have not affect computer player 3's unit at all. Also, as I said above, I am pretty new to triggering, so if you spot any leaks or funky triggering, please let me know. Thanks again!