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

GUI - Attack Once & Auto-Attack

Status
Not open for further replies.
Level 9
Joined
May 9, 2009
Messages
536
When my unit attacks, I want him to only attack once. I dont want him to just keep attacking, but I want him to attack only once when ordered to attack via right-click or attack. I also dont want other unit auto-attacking back and both units have attacks. I need to find a way so that when one unit attacks, he attacks only once per order and I need to disable auto-attacking. I need to find a way to intercept the smarts of attack and the order attack to replace it with attack once. Answer will get lots of rep(Probably +4)
 
What about
  • Trigger1
  • Events
    • Unit - A unit is attacked
  • Conditions
  • Actions
    • Set Timer1 = (Last created timer)
    • Set Unit1 = (Attacking unit)
    • Set Unit2 = (Attacked unit)
    • Countdown Timer - Start Timer1 as a one-shot timer that will expire in 1.00 seconds
  • Trigger2
  • Events
    • Time - Timer1 expires
  • Conditions
  • Actions
    • Set Point1 = (Position of (Unit2))
    • Unit - Create 1 dummy at (Point1) for (Owner of (Unit1)) facing default building degrees
    • Unit - Order (Last created unit) to Human - Banish (Unit2)
    • Unit - Add a 2.00 second generic expiration timer to (Last created unit)
    • Custom script: call RemoveLocation (udg_Point1)
    • Custom script: call DestroyTimer (udg_Timer1)
    • Set Unit1 = No unit
    • Set Unit2 = No unit
 
Status
Not open for further replies.
Top