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

Healing Spell

Status
Not open for further replies.
Level 3
Joined
Aug 12, 2008
Messages
34
Hey guys:grin:!

So I am making a healing spell and though it seems simple enough, I just can't make it work. So a unit casts a healing spell on a targeted unit, healing over 4 seconds. But in the end, it's supposed to "explode" and heal every unit around the target for X health. Here's what I have come up with so far;

  • Wild Seed bloom
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Wild Seed
    • Actions
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 498.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 498.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 498.00)
      • Wait 1.00 seconds
      • Unit Group - Pick every unit in (Units within 400.00 of (Position of (Target unit of ability being cast)) matching (((Matching unit) belongs to an ally of (Owner of (Casting unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 2102.00)
Though I thought this should do the trick, it doesn't. As after the first heal, everything just stops. Could someone please tell me why? :D

~Razorwind~
 
Level 3
Joined
Aug 12, 2008
Messages
34
Well, as the wait-time is necessary to complete the spell, I cannot remove it (it's a healing-over-time spell :)). However, without it - everything works great.

How about a periodic event trigger that will start when a unit gets the buff (heal)?
 

Vunjo

Hosted Project: SC
Level 14
Joined
Jul 1, 2010
Messages
1,340
yap, that should work. Make it periodic event, and activate the trigger when it casts a spell. It will work ^^
W00t!? healing for 498? Why didn't you set it to 500? xD
 

Vunjo

Hosted Project: SC
Level 14
Joined
Jul 1, 2010
Messages
1,340
random what? xD

On map initialization trigger, turn off Periodic Trigger.
When the hero casts a spell, turn ON Periodic Trigger, and turn it off after few seconds (depending on how many times do you want it to heal)
Periodic Trigger:
Every 1 seconds of the game
Your healing action =)

Note: You must have a unit in variable. On trigger who's event is casts a spell, make target unit a variable. For a blast, you will have to make another trigger, to the same thing, and after you turned off Periodic trigger, turn on that new trigger.

Hope that helped =)
 
Level 7
Joined
Sep 5, 2006
Messages
334
Two triggers one for cast and one for healing each second. use 2 variable,one call TMP that's a unit, another call Heal_G1 that's a unit group.


  • Heal
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Inner Fire
    • Actions
      • Unit Group - Add (Target unit of ability being cast) to Heal_G1
  • HealS
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Heal_G1 and do (Actions)
        • Loop - Actions
          • Set TMP = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TMP has buff Inner Fire) Equal to True
            • Then - Actions
              • Unit - Set life of TMP to ((Life of TMP) + 100.00)
              • -------- Set it to whatever value you want to heal every second --------
            • Else - Actions
              • Unit Group - Pick every unit in (Units within 400.00 of (Position of TMP)) and do (Actions)
                • Loop - Actions
                  • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 500.00)
                  • Unit Group - Remove (Picked unit) from Heal_G1
              • -------- Set it to whatever value you want to heal at the end of the 4s --------
 
Status
Not open for further replies.
Top