• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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