• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Simple Trigger Question

Status
Not open for further replies.
Level 4
Joined
Apr 24, 2009
Messages
115
How do I make it so that an item ability can't be cast on a player's own units?
Also, can I exclude specific non-building units from being targets?


Thanks in advance for any help :)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Untitled Trigger 090
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Finger of Death (item)
      • Or - Any (Conditions) are true
        • Conditions
          • ((Target unit of ability being cast) belongs to an enemy of (Triggering player)) Equal to False
          • (Unit-type of (Target unit of ability being cast)) Equal to Ghoul
    • Actions
      • Unit - Pause (Triggering unit)
      • Custom script: call SetUnitPosition(GetTriggerUnit(), GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()))
      • Unit - Unpause (Triggering unit)
That will still trigger the cooldown though. Add unit types that the ability can't be cast on. Remember to edit targets allowed of the ability. Uncheck allies, friend, enemy and neutral.
 
Level 4
Joined
Apr 24, 2009
Messages
115
  • Untitled Trigger 090
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Finger of Death (item)
      • Or - Any (Conditions) are true
        • Conditions
          • ((Target unit of ability being cast) belongs to an enemy of (Triggering player)) Equal to False
          • (Unit-type of (Target unit of ability being cast)) Equal to Ghoul
    • Actions
      • Unit - Pause (Triggering unit)
      • Custom script: call SetUnitPosition(GetTriggerUnit(), GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()))
      • Unit - Unpause (Triggering unit)
That will still trigger the cooldown though. Add unit types that the ability can't be cast on. Remember to edit targets allowed of the ability. Uncheck allies, friend, enemy and neutral.

Thanks, I'll play around with it
 
Status
Not open for further replies.
Top