• 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] Ability that makes a unit invisible near trees?

Status
Not open for further replies.
Base your spell off Invisibility by Sorceress and you just have to make triggers:
  • Trigger
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to X
  • Actions
    • Unit Group - Add (Target unit of ability being cast) to InvisibilityGroup
    • Trigger - Turn on Trigger2 <gen>
  • Trigger2
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (InvisibilityGroup is empty) Equal to False
      • Then - Actions
        • Unit Group - Pick every unit in (InvisibilityGroup) and do (Actions)
          • Loop - Actions
            • Set Point = (Position of (Picked unit))
            • Destructible - Pick every destructible within 200.00 of Point and do (Actions)
              • Loop - Actions
                • If (All conditions are true) then do (Actions) else do (Actions)
                  • If - Conditions
                    • (Picked destructible) Equal to No destructible //Destructible comparison
                  • Then - Actions
                    • Unit Group - Remove (Picked unit) from InvisibilityGroup
                    • Unit - Remove Buff from (Picked unit)
                  • Else - Actions
            • Custom script: call RemoveLocation (udg_Point)
      • Else - Turn off (This trigger)
 
Level 13
Joined
Apr 15, 2008
Messages
1,063
Have you tested this? I am afraid that (Picked destructible) Equal to No destructible won't work, if there is no destructible it just won't be picked.

What you should do is to pick the destructibles, then check whether one of them is a tree, then cast the invisibility with 1 second duration. That way, as soon as the unit leaves forest, no trees will be picked anymore and the spell will fade within one second.
 
Status
Not open for further replies.
Top