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

Regeneration depending on terrain

Status
Not open for further replies.
Level 8
Joined
Jul 14, 2010
Messages
235
Hello! Im trying to make a passive ability for my Ent Lord, Batuan. Its named "Evergrowing", and it regenerate HP of Batuan every 2 second, as long as he is on grass terrain. However, if he step on dirt, rough dirt or blight, he will loose HP each 2 second. So with little knowledge of triggers etc. I made this:
  • Batuan Blight Reduction Init
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Batuan
    • Actions
      • Set BatuanPosition = (Sold unit)
      • Trigger - Turn on Batuan Blight Reduction <gen>
  • Batuan Blight Reduction
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set BatuanPosition = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain type at (Position of (Triggering unit))) Not equal to Lordaeron Summer - Grassy Dirt
          • (Terrain type at (Position of (Triggering unit))) Not equal to Lordaeron Summer - Grass
          • (Terrain type at (Position of (Triggering unit))) Not equal to Lordaeron Summer - Dark Grass
        • Then - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - (20.00 x 1.00))
        • Else - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (20.00 x 1.00))
But it doesn't seem to store Batuan in the variable BatuanPosition
 
Level 8
Joined
Jul 14, 2010
Messages
235
oh nevermind ._.
I just did this and everything is working:
  • Batuan Blight Reduction
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain type at (Position of BatuanPosition)) Not equal to Lordaeron Summer - Grassy Dirt
          • (Terrain type at (Position of BatuanPosition)) Not equal to Lordaeron Summer - Grass
          • (Terrain type at (Position of BatuanPosition)) Not equal to Lordaeron Summer - Dark Grass
        • Then - Actions
          • Unit - Set life of BatuanPosition to ((Life of BatuanPosition) - (4.00 x 1.00))
        • Else - Actions
          • Unit - Set life of BatuanPosition to ((Life of BatuanPosition) + (4.00 x 1.00))
 
Status
Not open for further replies.
Top