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

[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 12
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