• 🏆 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!

Make all units of type target point when ability is cast

Status
Not open for further replies.
Level 5
Joined
Jul 10, 2009
Messages
89
I want to create a trigger such that when the player targets a point with an ability, all specified types of units will "attack move" that point.

Basically, I'm trying to make it easier to control large armies. I want to give hero units this "command" ability, so that when it is cast, all units of a certain type, say ranged units or ground units, will attack the point without the user having to locate and micromanage them.

thanks for any help.
 
Level 11
Joined
Jan 25, 2009
Messages
572
Here's the trigger:

  • Move Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to 'Your spell'
    • Actions
      • Set GroundGroup = (Units owned by (Owner of (Triggering unit)) matching ((((Matching unit) is A ground unit) Equal to True) and (((Matching unit) is A Hero) Equal to False)))
      • Set Temp_Loc = (Target point of ability being cast)
      • Unit Group - Pick every unit in GroundGroup and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To Temp_Loc
      • Custom script: call RemoveLocation (udg_Temp_Loc)
      • Custom script: call DestroyGroup (udg_GroundGroup)
 
Status
Not open for further replies.
Top