• 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] How to prevent attacking?

Status
Not open for further replies.
Level 7
Joined
Jun 16, 2008
Messages
327
Hello all,
Recently, I have been making a map (coming along very well, may I add), and I ran into a problem that has me seriously stumped. Having tried out all the methods I could think of, I've resorted to relying on your abundance of knowledge to help me out, please.

Okay, so here's what's wrong; basically, as a penalty, I want to make it so that a unit (to be specific, a ranged hero) can temporarily not be able to attack any enemy. (In other words, for a few seconds I want it so that that unit is not able to attack ANYONE...BUT his allies can).

Here's what I've tried so far; making a trigger that adds the "flying" classification to all the enemy units and removing the "able to attack flying units" from the unit...didn't work. Then, I made a trigger that whenever that specific unit is given the order to attack it automatically gives him the stop order, but that didn't work either (not too sure if I made some mistake in entering the order string, but I highly doubt it)
As if that's not enough, I then tried adding the "locust" ability to every enemy unit, but, believe it or not, that ability is not even on the add list, and the Ghost ability doesn't help, either. As a last resort, I made a trigger that made the owner player view the enemy as an ally, but he could still order the unit to attack any enemies manually.
So, right now...I'm downright confused.

Any tips, advice or solutions? It would be deeply appreciated.
Any answer-givers will receive +rep and credit in my map and, of course, my gratitude and the respect of others.

Thanks a lot,
Elite Slayer
 
Level 4
Joined
Mar 26, 2008
Messages
100
it's simple
  • Events
    • Unit - A unit is under attack
  • Conditions
    • (Owner of (Attacked unit)) is equal to player with penalty
  • Actions
    • Unit - Order (Attacking unit) to Stop
enable/disable this trigger when needed
 
Status
Not open for further replies.
Top