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

[Spell] How to make trees respawn?

Level 1
Joined
Feb 28, 2024
Messages
2
Hello, I'm very new to world map editor and I'm learning, but I want to create a custom spell that will allow me to resurrect trees in an area will someone please help me? :(
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
Hello, so you're going to need to use a trigger, but it's pretty simple.

Step 1: Copy and paste an existing ability that targets an area. Silence comes to mind.
Step 2: Set it's Targets Allowed field to None, we don't want it to actually do anything since our trigger will handle all of that.
Step 3: Create a new trigger in the Trigger Editor and set it up like this:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Resurrect Trees
  • Actions
    • Destructible - Pick every destructible within 300.00 of (Target point of ability being cast) and do (Actions)
      • Loop - Actions
        • Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Show birth animation
This will resurrect any destructible it finds within a 300 radius of your cast point. You should change this value to match the Area of Effect of your Silence ability so the visuals match up.

If you want it to only work for certain trees then you need to filter the picked destructibles by using an If Then Else action:
  • Destructible - Pick every destructible within 300.00 of (Target point of ability being cast) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
        • Then - Actions
          • Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Show birth animation
        • Else - Actions
This will also help prevent things like Barrels from being resurrected, if that's even possible.
 
Last edited:
Level 1
Joined
Feb 28, 2024
Messages
2
You're the best thank you! I'm still learning and this really helped. I just had the trigger be my wisps detonate xD
Hello, so you're going to need to use a trigger, but it's pretty simple.

Step 1: Copy and paste an existing ability that targets an area. Silence comes to mind.
Step 2: Set it's Targets Allowed field to None, we don't want it to actually do anything since our trigger will handle all of that.
Step 3: Create a new trigger in the Trigger Editor and set it up like this:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Resurrect Trees
  • Actions
    • Destructible - Pick every destructible within 300.00 of (Target point of ability being cast) and do (Actions)
      • Loop - Actions
        • Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Show birth animation
This will resurrect any destructible it finds within a 300 radius of your cast point. You should change this value to match the Area of Effect of your Silence ability so the visuals match up.

If you want it to only work for certain trees then you need to filter the picked destructibles by using an If Then Else action:
  • Destructible - Pick every destructible within 300.00 of (Target point of ability being cast) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
        • Then - Actions
          • Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Show birth animation
        • Else - Actions
This will also help prevent things like Barrels from being resurrected, if that's even possible.
 
Top